Skip to content

Commit 7b23eeb

Browse files
authored
Merge pull request #71491 from kylejdoyle/patch-1
Missing Prereqs in DMS Tutorial
2 parents a568cc8 + 96fc438 commit 7b23eeb

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
@@ -64,6 +64,79 @@ To complete this tutorial, you need to:
6464
- 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.
6565
- 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.
6666

67+
> [!IMPORTANT]
68+
> 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:
69+
>
70+
> ```
71+
>
72+
> $readerActions = `
73+
> "Microsoft.Network/networkInterfaces/ipConfigurations/read", `
74+
> "Microsoft.DataMigration/*/read", `
75+
> "Microsoft.Resources/subscriptions/resourceGroups/read"
76+
>
77+
> $writerActions = `
78+
> "Microsoft.DataMigration/services/*/write", `
79+
> "Microsoft.DataMigration/services/*/delete", `
80+
> "Microsoft.DataMigration/services/*/action", `
81+
> "Microsoft.Network/virtualNetworks/subnets/join/action", `
82+
> "Microsoft.Network/virtualNetworks/write", `
83+
> "Microsoft.Network/virtualNetworks/read", `
84+
> "Microsoft.Resources/deployments/validate/action", `
85+
> "Microsoft.Resources/deployments/*/read", `
86+
> "Microsoft.Resources/deployments/*/write"
87+
>
88+
> $writerActions += $readerActions
89+
>
90+
> # TODO: replace with actual subscription IDs
91+
> $subScopes = ,"/subscriptions/00000000-0000-0000-0000-000000000000/","/subscriptions/11111111-1111-1111-1111-111111111111/"
92+
>
93+
> function New-DmsReaderRole() {
94+
> $aRole = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new()
95+
> $aRole.Name = "Azure Database Migration Reader"
96+
> $aRole.Description = "Lets you perform read only actions on DMS service/project/tasks."
97+
> $aRole.IsCustom = $true
98+
> $aRole.Actions = $readerActions
99+
> $aRole.NotActions = @()
100+
>
101+
> $aRole.AssignableScopes = $subScopes
102+
> #Create the role
103+
> New-AzRoleDefinition -Role $aRole
104+
> }
105+
>
106+
> function New-DmsContributorRole() {
107+
> $aRole = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new()
108+
> $aRole.Name = "Azure Database Migration Contributor"
109+
> $aRole.Description = "Lets you perform CRUD actions on DMS service/project/tasks."
110+
> $aRole.IsCustom = $true
111+
> $aRole.Actions = $writerActions
112+
> $aRole.NotActions = @()
113+
>
114+
> $aRole.AssignableScopes = $subScopes
115+
> #Create the role
116+
> New-AzRoleDefinition -Role $aRole
117+
> }
118+
>
119+
> function Update-DmsReaderRole() {
120+
> $aRole = Get-AzRoleDefinition "Azure Database Migration Reader"
121+
> $aRole.Actions = $readerActions
122+
> $aRole.NotActions = @()
123+
> Set-AzRoleDefinition -Role $aRole
124+
> }
125+
>
126+
> function Update-DmsConributorRole() {
127+
> $aRole = Get-AzRoleDefinition "Azure Database Migration Contributor"
128+
> $aRole.Actions = $writerActions
129+
> $aRole.NotActions = @()
130+
> Set-AzRoleDefinition -Role $aRole
131+
> }
132+
>
133+
> # Invoke above functions
134+
> New-DmsReaderRole
135+
> New-DmsContributorRole
136+
> Update-DmsReaderRole
137+
> Update-DmsConributorRole
138+
> ```
139+
67140
## Assess your on-premises database
68141
69142
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)