Skip to content

Commit 96fc438

Browse files
authored
Missing Prereqs
Prereq for additional subscription level permissions is not listed in the tutorial, but is listed in the prereqs linked here, https://docs.microsoft.com/en-us/azure/dms/pre-reqs. Adding the subscription level permissions here to complete the article since the other article is not mentioned at all in this tutorial. This same block is needed in several other tutorials as well and I can add those if this is accepted. Another option might be to get rid of the prereqs in the tutorials and link to the prereqs doc directly in each tutorial, happy to make that change as well.
1 parent 21639da commit 96fc438

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

articles/dms/tutorial-sql-server-to-azure-sql.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,79 @@ To complete this tutorial, you need to:
7373
- Ensure that the credentials used to connect to source SQL Server instance have [CONTROL SERVER](/sql/t-sql/statements/grant-server-permissions-transact-sql) permissions.
7474
- Ensure that the credentials used to connect to target Azure SQL Database instance have [CONTROL DATABASE](/sql/t-sql/statements/grant-database-permissions-transact-sql) permission on the target databases.
7575

76+
> [!IMPORTANT]
77+
> Creating an instance of Azure Database Migration Service requires access to virtual network settings that are normally not within the same resource group. As a result, the user creating an instance of DMS requires permission at subscription level. To create the required roles, which you can assign as needed, run the following script:
78+
>
79+
> ```
80+
>
81+
> $readerActions = `
82+
> "Microsoft.Network/networkInterfaces/ipConfigurations/read", `
83+
> "Microsoft.DataMigration/*/read", `
84+
> "Microsoft.Resources/subscriptions/resourceGroups/read"
85+
>
86+
> $writerActions = `
87+
> "Microsoft.DataMigration/services/*/write", `
88+
> "Microsoft.DataMigration/services/*/delete", `
89+
> "Microsoft.DataMigration/services/*/action", `
90+
> "Microsoft.Network/virtualNetworks/subnets/join/action", `
91+
> "Microsoft.Network/virtualNetworks/write", `
92+
> "Microsoft.Network/virtualNetworks/read", `
93+
> "Microsoft.Resources/deployments/validate/action", `
94+
> "Microsoft.Resources/deployments/*/read", `
95+
> "Microsoft.Resources/deployments/*/write"
96+
>
97+
> $writerActions += $readerActions
98+
>
99+
> # TODO: replace with actual subscription IDs
100+
> $subScopes = ,"/subscriptions/00000000-0000-0000-0000-000000000000/","/subscriptions/11111111-1111-1111-1111-111111111111/"
101+
>
102+
> function New-DmsReaderRole() {
103+
> $aRole = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new()
104+
> $aRole.Name = "Azure Database Migration Reader"
105+
> $aRole.Description = "Lets you perform read only actions on DMS service/project/tasks."
106+
> $aRole.IsCustom = $true
107+
> $aRole.Actions = $readerActions
108+
> $aRole.NotActions = @()
109+
>
110+
> $aRole.AssignableScopes = $subScopes
111+
> #Create the role
112+
> New-AzRoleDefinition -Role $aRole
113+
> }
114+
>
115+
> function New-DmsContributorRole() {
116+
> $aRole = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new()
117+
> $aRole.Name = "Azure Database Migration Contributor"
118+
> $aRole.Description = "Lets you perform CRUD actions on DMS service/project/tasks."
119+
> $aRole.IsCustom = $true
120+
> $aRole.Actions = $writerActions
121+
> $aRole.NotActions = @()
122+
>
123+
> $aRole.AssignableScopes = $subScopes
124+
> #Create the role
125+
> New-AzRoleDefinition -Role $aRole
126+
> }
127+
>
128+
> function Update-DmsReaderRole() {
129+
> $aRole = Get-AzRoleDefinition "Azure Database Migration Reader"
130+
> $aRole.Actions = $readerActions
131+
> $aRole.NotActions = @()
132+
> Set-AzRoleDefinition -Role $aRole
133+
> }
134+
>
135+
> function Update-DmsConributorRole() {
136+
> $aRole = Get-AzRoleDefinition "Azure Database Migration Contributor"
137+
> $aRole.Actions = $writerActions
138+
> $aRole.NotActions = @()
139+
> Set-AzRoleDefinition -Role $aRole
140+
> }
141+
>
142+
> # Invoke above functions
143+
> New-DmsReaderRole
144+
> New-DmsContributorRole
145+
> Update-DmsReaderRole
146+
> Update-DmsConributorRole
147+
> ```
148+
76149
## Assess your on-premises database
77150
78151
Before you can migrate data from a SQL Server instance to a single database or pooled database in Azure SQL Database, you need to assess the SQL Server database for any blocking issues that might prevent migration. Using the Data Migration Assistant, follow the steps described in the article [Performing a SQL Server migration assessment](/sql/dma/dma-assesssqlonprem) to complete the on-premises database assessment. A summary of the required steps follows:

0 commit comments

Comments
 (0)