Skip to content

Commit 1e59bad

Browse files
authored
Merge pull request #114104 from danielsollondon/patch-27
May updates
2 parents 596bf69 + 77c8f0a commit 1e59bad

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

articles/virtual-machines/windows/image-builder-gallery-update-image-version.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create a new image version from an existing image version using Azure Ima
33
description: Create a new VM image version from an existing image version using Azure Image Builder.
44
author: cynthn
55
ms.author: cynthn
6-
ms.date: 05/02/2019
6+
ms.date: 05/05/2020
77
ms.topic: how-to
88
ms.service: virtual-machines-windows
99
---
@@ -35,16 +35,18 @@ Check your registration.
3535

3636
```azurecli-interactive
3737
az provider show -n Microsoft.VirtualMachineImages | grep registrationState
38-
az provider show -n Microsoft.Storage | grep registrationState
38+
az provider show -n Microsoft.KeyVault | grep registrationState
3939
az provider show -n Microsoft.Compute | grep registrationState
40+
az provider show -n Microsoft.Storage | grep registrationState
4041
```
4142

4243
If they do not say registered, run the following:
4344

4445
```azurecli-interactive
4546
az provider register -n Microsoft.VirtualMachineImages
46-
az provider register -n Microsoft.Storage
4747
az provider register -n Microsoft.Compute
48+
az provider register -n Microsoft.KeyVault
49+
az provider register -n Microsoft.Storage
4850
```
4951

5052

@@ -88,17 +90,16 @@ sigDefImgVersionId=$(az sig image-version list \
8890
--subscription $subscriptionID --query [].'id' -o json | grep 0. | tr -d '"' | tr -d '[:space:]')
8991
```
9092

91-
92-
If you already have your own Shared Image Gallery, and did not follow the previous example, you will need to assign permissions for Image Builder to access the Resource Group, so it can access the gallery.
93-
93+
## Create a user-assigned identity and set permissions on the resource group
94+
As you had set the user-identity up in the previous example, you just need to get the Resource ID of it, this will then be appended to the template.
9495

9596
```azurecli-interactive
96-
az role assignment create \
97-
--assignee cf32a0cc-373c-47c9-9156-0db11f6a6dfc \
98-
--role Contributor \
99-
--scope /subscriptions/$subscriptionID/resourceGroups/$sigResourceGroup
97+
#get identity used previously
98+
imgBuilderId=$(az identity list -g $sigResourceGroup --query "[?contains(name, 'aibBuiUserId')].id" -o tsv)
10099
```
101100

101+
If you already have your own Shared Image Gallery, and did not follow the previous example, you will need to assign permissions for Image Builder to access the Resource Group, so it can access the gallery. Please review the steps in the [Create an image and distribute to a Shared Image Gallery](image-builder-gallery.md) example.
102+
102103

103104
## Modify helloImage example
104105
You can review the example we are about to use by opening the .json file here: [helloImageTemplateforSIGfromSIG.json](https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/quickquickstarts/2_Creating_a_Custom_Linux_Shared_Image_Gallery_Image_from_SIG/helloImageTemplateforSIGfromSIG.json) along with the [Image Builder template reference](../linux/image-builder-json.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
@@ -116,6 +117,7 @@ sed -i -e "s%<sigDefImgVersionId>%$sigDefImgVersionId%g" helloImageTemplateforSI
116117
sed -i -e "s/<region1>/$location/g" helloImageTemplateforSIGfromWinSIG.json
117118
sed -i -e "s/<region2>/$additionalregion/g" helloImageTemplateforSIGfromWinSIG.json
118119
sed -i -e "s/<runOutputName>/$runOutputName/g" helloImageTemplateforSIGfromWinSIG.json
120+
sed -i -e "s%<imgBuilderId>%$imgBuilderId%g" helloImageTemplateforSIGfromWinSIG.json
119121
```
120122

121123
## Create the image
@@ -170,4 +172,4 @@ You should now see two directories:
170172

171173
## Next steps
172174

173-
To learn more about the components of the .json file used in this article, see [Image builder template reference](../linux/image-builder-json.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
175+
To learn more about the components of the .json file used in this article, see [Image builder template reference](../linux/image-builder-json.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

0 commit comments

Comments
 (0)