@@ -133,8 +133,8 @@ $identityName="aibIdentity"+$timeInt
133
133
# create identity
134
134
New-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName
135
135
136
- $idenityNameResourceId =$(Get-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $idenityName ).Id
137
- $idenityNamePrincipalId =$(Get-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $idenityName ).PrincipalId
136
+ $identityNameResourceId =$(Get-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName ).Id
137
+ $identityNamePrincipalId =$(Get-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName ).PrincipalId
138
138
139
139
```
140
140
@@ -155,7 +155,7 @@ Invoke-WebRequest -Uri $aibRoleImageCreationUrl -OutFile $aibRoleImageCreationPa
155
155
New-AzRoleDefinition -InputFile ./aibRoleImageCreation.json
156
156
157
157
# grant role definition to image builder service principal
158
- New-AzRoleAssignment -ObjectId $idenityNamePrincipalId -RoleDefinitionName $imageRoleDefName -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
158
+ New-AzRoleAssignment -ObjectId $identityNamePrincipalId -RoleDefinitionName $imageRoleDefName -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
159
159
```
160
160
161
161
> [ !NOTE]
@@ -229,7 +229,7 @@ Invoke-WebRequest -Uri $templateUrl -OutFile $templateFilePath -UseBasicParsing
229
229
((Get-Content -path $templateFilePath -Raw) -replace '<imageDefName>',$imageDefName) | Set-Content -Path $templateFilePath
230
230
((Get-Content -path $templateFilePath -Raw) -replace '<sharedImageGalName>',$sigGalleryName) | Set-Content -Path $templateFilePath
231
231
((Get-Content -path $templateFilePath -Raw) -replace '<region1>',$location) | Set-Content -Path $templateFilePath
232
- ((Get-Content -path $templateFilePath -Raw) -replace '<imgBuilderId>',$idenityNameResourceId ) | Set-Content -Path $templateFilePath
232
+ ((Get-Content -path $templateFilePath -Raw) -replace '<imgBuilderId>',$identityNameResourceId ) | Set-Content -Path $templateFilePath
233
233
234
234
```
235
235
@@ -284,13 +284,13 @@ Remove-AzImageBuilderTemplate -ResourceGroupName $imageResourceGroup -Name vd10I
284
284
Delete the role assignment.
285
285
286
286
``` azurepowershell-interactive
287
- Remove-AzRoleAssignment -ObjectId $idenityNamePrincipalId -RoleDefinitionName $imageRoleDefName -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
287
+ Remove-AzRoleAssignment -ObjectId $identityNamePrincipalId -RoleDefinitionName $imageRoleDefName -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
288
288
289
289
## remove definitions
290
- Remove-AzRoleDefinition -Name "$idenityNamePrincipalId " -Force -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
290
+ Remove-AzRoleDefinition -Name "$identityNamePrincipalId " -Force -Scope "/subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup"
291
291
292
292
## delete identity
293
- Remove-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $idenityName -Force
293
+ Remove-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName -Force
294
294
```
295
295
296
296
Delete the resource group.
0 commit comments