Skip to content

Commit ea7efbc

Browse files
authored
Merge pull request #854 from anosov1960/master
Added namespace migration script for Arcee
2 parents 9503a1e + 9035c7e commit ea7efbc

File tree

4 files changed

+68
-214
lines changed

4 files changed

+68
-214
lines changed

samples/databases/wide-world-importers/sample-scripts/polybase/DemonstratePolybase.sql

Lines changed: 0 additions & 139 deletions
This file was deleted.

samples/databases/wide-world-importers/sample-scripts/polybase/README.md

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
services: Azure Arc enabled SQL Server
3+
platforms: Azure
4+
author: anosov1960
5+
ms.author: sashan
6+
ms.date: 12/08/2020
7+
---
8+
9+
# Running the script using Cloud Shell
10+
11+
Use the following steps to migrate your existing SQL Server - Azure Arc resources from Microsoft.AzureData namespace to Microsoft.AzureArcData namespace.
12+
13+
1. Launch the [Cloud Shell](https://shell.azure.com/). For details, [read more about PowerShell in Cloud Shell](https://aka.ms/pscloudshell/docs).
14+
15+
2. Upload the script to the shell using the following command:
16+
17+
```console
18+
curl https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/manage/azure-arc-enabled-sql-server/migrate-to-azure-arc-data.ps1 -o migrate-to-azure-arc-data.ps1
19+
```
20+
3. Run the script.
21+
22+
```console
23+
./migrate-to-azure-arc-data.ps1
24+
```
25+
26+
> [!NOTE]
27+
> - To paste the commands into the shell, use `Ctrl-Shift-V` on Windows or `Cmd-v` on MacOS.
28+
> - The script will be uploaded directly to the home folder associated with your Cloud Shell session.
29+
> - The script will prompt for the resource group name and print a message when migration is completed.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ---------------------------------------------------------------------------------
14+
#
15+
# Sample script for migrating the existing SQL Server - Azure Arc resources from Microsoft.AzureData namespace to Microsoft.AzureArcData namespace
16+
# within a single Resource Group
17+
#
18+
19+
$ResourceGroup=read-host -Prompt "Enter Resource Group Name"
20+
21+
$SqlArcResources = Get-AzResource -ExpandProperties -ResourceType Microsoft.AzureData/sqlServerInstances -ResourceGroupName $ResourceGroup
22+
foreach ($r in $SqlArcResources) {
23+
if( $null -ne $r.Properties.tcpPorts ){
24+
Write-Warning "The property `"tcpPorts`" has been renamed to `"tcpStaticPorts`". The property name will be updated during resource migration."
25+
$r.Properties | Add-Member -MemberType NoteProperty -Name "tcpStaticPorts" -Value $r.Properties.tcpPorts
26+
$r.Properties.psobject.properties.remove("tcpPorts")
27+
}
28+
29+
if( $null -ne $r.Properties.createTime ){
30+
Write-Warning "There is a known bug in the createTime property. This property will be removed during resource migration."
31+
$r.Properties.psobject.properties.remove("createTime")
32+
}
33+
34+
New-AzResource -ResourceName $r.Name -Location $r.Location -Properties $r.Properties -ResourceGroupName $r.ResourceGroupName `
35+
-ResourceType Microsoft.AzureArcData/sqlServerInstances -Force
36+
}
37+
38+
Write-Host "Namespace migration completed for SQL Server - Azure Arc resources."
39+

0 commit comments

Comments
 (0)