Skip to content

Commit b999f57

Browse files
authored
Merge pull request #114101 from danielsollondon/patch-24
May reqs
2 parents 9d1f582 + 21b0325 commit b999f57

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create a new VM image version from an existing image version using Azure
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-linux
99
ms.subservice: imaging
@@ -33,15 +33,17 @@ Check your registration.
3333

3434
```azurecli-interactive
3535
az provider show -n Microsoft.VirtualMachineImages | grep registrationState
36-
36+
az provider show -n Microsoft.KeyVault | grep registrationState
37+
az provider show -n Microsoft.Compute | grep registrationState
3738
az provider show -n Microsoft.Storage | grep registrationState
3839
```
3940

4041
If they do not say registered, run the following:
4142

4243
```azurecli-interactive
4344
az provider register -n Microsoft.VirtualMachineImages
44-
45+
az provider register -n Microsoft.Compute
46+
az provider register -n Microsoft.KeyVault
4547
az provider register -n Microsoft.Storage
4648
```
4749

@@ -50,8 +52,6 @@ az provider register -n Microsoft.Storage
5052

5153
If you used [Create an image and distribute to a Shared Image Gallery](image-builder-gallery.md) to create your Shared Image Gallery, you've already created some of the variables we need. If not, please setup some variables to be used for this example.
5254

53-
For Preview, image builder will only support creating custom images in the same Resource Group as the source managed image. Update the resource group name in this example to be the same resource group as your source managed image.
54-
5555

5656
```console
5757
# Resource group name
@@ -84,17 +84,16 @@ sigDefImgVersionId=$(az sig image-version list \
8484
--subscription $subscriptionID --query [].'id' -o json | grep 0. | tr -d '"' | tr -d '[:space:]')
8585
```
8686

87-
88-
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.
89-
87+
## Create a user-assigned identity and set permissions on the resource group
88+
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.
9089

9190
```azurecli-interactive
92-
az role assignment create \
93-
--assignee cf32a0cc-373c-47c9-9156-0db11f6a6dfc \
94-
--role Contributor \
95-
--scope /subscriptions/$subscriptionID/resourceGroups/$sigResourceGroup
91+
#get identity used previously
92+
imgBuilderId=$(az identity list -g $sigResourceGroup --query "[?contains(name, 'aibBuiUserId')].id" -o tsv)
9693
```
9794

95+
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.
96+
9897

9998
## Modify helloImage example
10099
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](image-builder-json.md).
@@ -112,6 +111,7 @@ sed -i -e "s%<sigDefImgVersionId>%$sigDefImgVersionId%g" helloImageTemplateforSI
112111
sed -i -e "s/<region1>/$location/g" helloImageTemplateforSIGfromSIG.json
113112
sed -i -e "s/<region2>/$additionalregion/g" helloImageTemplateforSIGfromSIG.json
114113
sed -i -e "s/<runOutputName>/$runOutputName/g" helloImageTemplateforSIGfromSIG.json
114+
sed -i -e "s%<imgBuilderId>%$imgBuilderId%g" helloImageTemplateforSIGfromSIG.json
115115
```
116116

117117
## Create the image
@@ -179,4 +179,4 @@ az sig image-version list -g $sigResourceGroup -r $sigName -i $imageDefName -o t
179179

180180
## Next steps
181181

182-
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).
182+
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)