Skip to content

Commit 68ad1fb

Browse files
authored
Merge pull request #105349 from emguzman13/patch-2
Adding missing resource provider, fixing code
2 parents fd6a511 + f3a1403 commit 68ad1fb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

articles/virtual-machines/windows/image-builder-powershell.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ If you haven't already done so, register the following resource providers to use
5151
- Microsoft.Storage
5252
- Microsoft.Network
5353
- Microsoft.VirtualMachineImages
54+
- Microsoft.ManagedIdentity
5455

5556
```azurepowershell-interactive
56-
Get-AzResourceProvider -ProviderNamespace Microsoft.Compute, Microsoft.KeyVault, Microsoft.Storage, Microsoft.VirtualMachineImages, Microsoft.Network |
57+
Get-AzResourceProvider -ProviderNamespace Microsoft.Compute, Microsoft.KeyVault, Microsoft.Storage, Microsoft.VirtualMachineImages, Microsoft.Network, Microsoft.ManagedIdentity |
5758
Where-Object RegistrationState -ne Registered |
5859
Register-AzResourceProvider
5960
```
@@ -109,7 +110,7 @@ Grant Azure image builder permissions to create images in the specified resource
109110
1. Create a user identity.
110111

111112
```azurepowershell-interactive
112-
New-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName
113+
New-AzUserAssignedIdentity -ResourceGroupName $imageResourceGroup -Name $identityName -Location $location
113114
```
114115

115116
1. Store the identity resource and principal IDs in variables.
@@ -125,7 +126,7 @@ Grant Azure image builder permissions to create images in the specified resource
125126

126127
```azurepowershell-interactive
127128
$myRoleImageCreationUrl = 'https://raw.githubusercontent.com/azure/azvmimagebuilder/master/solutions/12_Creating_AIB_Security_Roles/aibRoleImageCreation.json'
128-
$myRoleImageCreationPath = "$env:TEMP\myRoleImageCreation.json"
129+
$myRoleImageCreationPath = "myRoleImageCreation.json"
129130
130131
Invoke-WebRequest -Uri $myRoleImageCreationUrl -OutFile $myRoleImageCreationPath -UseBasicParsing
131132
@@ -230,7 +231,7 @@ Grant Azure image builder permissions to create images in the specified resource
230231
```azurepowershell-interactive
231232
$ImgCustomParams02 = @{
232233
FileCustomizer = $true
233-
CustomizerName = 'downloadBuildArtifacts'
234+
Name = 'downloadBuildArtifacts'
234235
Destination = 'c:\\buildArtifacts\\index.html'
235236
SourceUri = 'https://raw.githubusercontent.com/azure/azvmimagebuilder/master/quickquickstarts/exampleArtifacts/buildArtifacts/index.html'
236237
}

0 commit comments

Comments
 (0)