Skip to content

Commit 0e8a656

Browse files
authored
Merge pull request #258344 from ericd-mst-github/erd-aib-registration-cmd-updates
AIB registration cmd updates
2 parents 1717ca7 + 6e49cd9 commit 0e8a656

13 files changed

+99
-52
lines changed

articles/virtual-machines/image-builder-api-update-release-notes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: kof-f
55
ms.service: virtual-machines
66
ms.topic: conceptual
77
ms.workload: infrastructure
8-
ms.date: 11/01/2023
8+
ms.date: 11/10/2023
99
ms.reviewer: erd
1010
ms.subservice: image-builder
1111
ms.custom: references_regions
@@ -26,6 +26,9 @@ Azure Image Builder is enabling Isolated Image Builds using Azure Container Inst
2626

2727
You might observe a different set of transient Azure resources appear temporarily in the staging resource group but that does not impact your actual builds or the way you interact with Azure Image Builder. For more information, please see [Isolated Image Builds](./security-isolated-image-builds-image-builder.md).
2828

29+
> [!IMPORTANT]
30+
> Make sure your subscription is registered for the `Microsoft.ContainerInstance` provider.
31+
2932
### April 2023
3033
New portal functionality has been added for Azure Image Builder. Search “Image Templates” in Azure portal, then click “Create”. You can also [get started here](https://ms.portal.azure.com/#create/Microsoft.ImageTemplate) with building and validating custom images inside the portal.
3134

articles/virtual-machines/image-builder-triggers-how-to.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: erd
77
ms.service: virtual-machines
88
ms.subservice: image-builder
99
ms.topic: how-to
10-
ms.date: 10/16/2023
10+
ms.date: 11/10/2023
1111
ms.custom: template-how-to-pattern, devx-track-azurecli
1212
---
1313

@@ -25,16 +25,17 @@ Before setting up your first trigger, ensure you're using Azure Image Builder AP
2525

2626
## How to set up a trigger in Azure Image Builder
2727

28-
### Register the features
28+
### Register the providers
2929

30-
To use VM Image Builder with triggers, you need to register the below features. Check your registration by running the following commands:
30+
To use VM Image Builder with triggers, you need to register the below providers. Check your registration by running the following commands:
3131

3232
```azurecli-interactive
3333
az provider show -n Microsoft.VirtualMachineImages -o json | grep registrationState
3434
az provider show -n Microsoft.KeyVault -o json | grep registrationState
3535
az provider show -n Microsoft.Compute -o json | grep registrationState
3636
az provider show -n Microsoft.Storage -o json | grep registrationState
3737
az provider show -n Microsoft.Network -o json | grep registrationState
38+
az provider show -n Microsoft.ContainerInstance -o json | grep registrationState
3839
```
3940

4041
If the output doesn't say registered, run the following commands:
@@ -45,6 +46,7 @@ az provider register -n Microsoft.Compute
4546
az provider register -n Microsoft.KeyVault
4647
az provider register -n Microsoft.Storage
4748
az provider register -n Microsoft.Network
49+
az provider register -n Microsoft.ContainerInstance
4850
```
4951
Register the auto image build triggers feature:
5052

@@ -67,6 +69,8 @@ additionalregion=eastus2
6769
acgName=ibTriggersGallery
6870
# Name of the image definition to be created - ibTriggersImageDef in this example
6971
imageDefName=ibTriggersImageDef
72+
# Name of the Trigger to be created - ibTrigger in this example
73+
ibTriggerName=ibTrigger
7074
# Name of the image template to be created - ibTriggersImageTemplate in this example
7175
imageTemplateName=ibTriggersImageTemplate
7276
# Reference name in the image distribution metadata
@@ -159,12 +163,12 @@ Image template requirements:
159163
After configuring your template use the following command to submit the image configuration to the Azure Image Builder service:
160164

161165
```azurecli-interactive
162-
az resource create --api-version 2022-07-01 --resource-group $resourceGroupName --properties @helloImageTemplateforTriggers.json --is-full-object --resource-type Microsoft.VirtualMachineImages/imageTemplates --name $imageTemplateName
166+
az image builder create -g $resourceGroupName -n $imageTemplateName --image-template helloImageTemplateforTriggers.json
163167
```
164168
You can use the following command to check to make sure the image template was created successfully:
165169

166170
```azurecli-interactive
167-
az resource show --api-version 2022-07-01 --ids /subscriptions/$subscriptionID/resourcegroups/$resourceGroupName/providers/Microsoft.VirtualMachineImages/imageTemplates/$imageTemplateName
171+
az image builder show --name $imageTemplateName --resource-group $resourceGroupName
168172
```
169173
> [!NOTE]
170174
> When running the command above the `provisioningState` should say "Succeeded", which means the template was created without any issues. If the `provisioningState` does not say succeeded, you will not be able to make a trigger use the image template.
@@ -187,12 +191,12 @@ Trigger requirements:
187191
Use the following command to add the trigger to your resource group.
188192

189193
```azurecli-interactive
190-
az resource create --api-version 2022-07-01 --resource-group $resourceGroupName --properties @trigger.json --is-full-object --namespace Microsoft.VirtualMachineImages --parent imageTemplates/$imageTemplateName --resource-type triggers --name source
194+
az image builder trigger create --name $ibTriggerName --resource-group $resourceGroupName --image-template-name $imageTemplateName --kind SourceImage
191195
```
192196
You can also use the following command to check that the trigger was created successfully:
193197

194198
```azurecli
195-
az resource show --api-version 2022-07-01 --ids /subscriptions/$subscriptionID/resourcegroups/$resourceGroupName/providers/Microsoft.VirtualMachineImages/imageTemplates/$imageTemplateName/triggers/source
199+
az image builder trigger show --name $ibTriggerName --image-template-name $imageTemplateName --resource-group $resourceGroupName
196200
```
197201
> [!NOTE]
198202
> When running the command above the `provisioningState` should say `Succeeded`, which means the trigger was created without any issues. In `status`, the code should say `Healthy` and the message should say `Trigger is active.`
@@ -204,14 +208,14 @@ az resource show --api-version 2022-07-01 --ids /subscriptions/$subscriptionID/r
204208
Use the following command to delete the trigger:
205209

206210
```azurecli-interactive
207-
az resource delete --api-version 2022-07-01 --ids /subscriptions/$subscriptionID/resourcegroups/$resourceGroupName/providers/Microsoft.VirtualMachineImages/imageTemplates/$imageTemplateName/triggers/source
211+
az image builder trigger delete --name $ibTriggerName --image-template-name $imageTemplateName --resource-group $resourceGroupName
208212
```
209213
#### Deleting the image template
210214

211215
Use the following command to delete the image template:
212216

213217
```azurecli-interactive
214-
az resource delete --api-version 2022-07-01 --ids /subscriptions/$subscriptionID/resourcegroups/$resourceGroupName/providers/Microsoft.VirtualMachineImages/imageTemplates/$imageTemplateName
218+
az image builder delete --name $imageTemplateName --resource-group $resourceGroupName
215219
```
216220

217221
## Next steps

articles/virtual-machines/linux/image-builder-devops-task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Before you begin, you must:
4242
* Have an Azure DevOps Services (formerly Visual Studio Team Services, or VSTS) account, and a Build Pipeline created.
4343

4444
* Register and enable the VM Image Builder feature requirements in the subscription that's used by the pipelines:
45-
* [Azure PowerShell](../windows/image-builder-powershell.md#register-features)
46-
* [The Azure CLI](../windows/image-builder.md#register-the-features)
45+
* [Azure PowerShell](../windows/image-builder-powershell.md#register-providers)
46+
* [The Azure CLI](../windows/image-builder.md#register-the-providers)
4747

4848
* Create a standard Azure storage account in the source image resource group. You can use other resource groups or storage accounts. The storage account is used transfer the build artifacts from the DevOps task to the image.
4949

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Create a new VM image version from an existing image version by using Azu
33
description: In this article, you'll learn how to create a new VM image version from an existing image version by using VM Image Builder in Linux.
44
author: kof-f
55
ms.author: kofiforson
6-
ms.reviewer: cynthn
7-
ms.date: 03/02/2020
6+
ms.reviewer: erd
7+
ms.date: 11/10/2020
88
ms.topic: how-to
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -18,9 +18,9 @@ In this article, you learn how to update an existing image version in an [Azure
1818

1919
To configure the image, you use a sample JSON template, [helloImageTemplateforSIGfromSIG.json](https://raw.githubusercontent.com/azure/azvmimagebuilder/master/quickquickstarts/2_Creating_a_Custom_Linux_Shared_Image_Gallery_Image_from_SIG/helloImageTemplateforSIGfromSIG.json).
2020

21-
## Register the features
21+
## Register the providers
2222

23-
To use VM Image Builder, you need to register the features.
23+
To use VM Image Builder, you need to register the providers.
2424

2525
1. Check your provider registrations. Make sure that each one returns *Registered*.
2626

@@ -30,6 +30,7 @@ To use VM Image Builder, you need to register the features.
3030
az provider show -n Microsoft.Compute | grep registrationState
3131
az provider show -n Microsoft.Storage | grep registrationState
3232
az provider show -n Microsoft.Network | grep registrationState
33+
az provider show -n Microsoft.ContainerInstance | grep registrationState
3334
```
3435
3536
1. If they don't return *Registered*, register the providers by running the following commands:
@@ -40,6 +41,7 @@ To use VM Image Builder, you need to register the features.
4041
az provider register -n Microsoft.KeyVault
4142
az provider register -n Microsoft.Storage
4243
az provider register -n Microsoft.Network
44+
az provider register -n Microsoft.ContainerInstance
4345
```
4446
4547
## Set variables and permissions

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Use Azure Image Builder & Azure Compute Gallery for Linux VMs
33
description: Learn how to use the Azure Image Builder, and the Azure CLI, to create an image version in an Azure Compute Gallery, and then distribute the image globally.
44
author: kof-f
55
ms.author: kofiforson
6-
ms.reviewer: cynthn
7-
ms.date: 04/11/2023
6+
ms.reviewer: erd
7+
ms.date: 11/10/2023
88
ms.topic: how-to
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -17,11 +17,11 @@ ms.custom: devx-track-azurecli, devx-track-linux
1717

1818
This article shows you how you can use the Azure Image Builder, and the Azure CLI, to create an image version in an [Azure Compute Gallery](../shared-image-galleries.md) (formerly known as Shared Image Gallery), then distribute the image globally. You can also do this using [Azure PowerShell](../windows/image-builder-gallery.md).
1919

20-
We will be using a sample .json template to configure the image. The .json file we are using is here: [helloImageTemplateforSIG.json](https://github.com/azure/azvmimagebuilder/blob/master/quickquickstarts/1_Creating_a_Custom_Linux_Shared_Image_Gallery_Image/helloImageTemplateforSIG.json).
20+
We'll be using a sample .json template to configure the image. The .json file we're using is here: [helloImageTemplateforSIG.json](https://github.com/azure/azvmimagebuilder/blob/master/quickquickstarts/1_Creating_a_Custom_Linux_Shared_Image_Gallery_Image/helloImageTemplateforSIG.json).
2121

2222
To distribute the image to an Azure Compute Gallery, the template uses [sharedImage](image-builder-json.md#distribute-sharedimage) as the value for the `distribute` section of the template.
2323

24-
## Register the features
24+
## Register the providers
2525

2626
To use Azure Image Builder, you need to register the feature.
2727

@@ -33,21 +33,23 @@ az provider show -n Microsoft.KeyVault | grep registrationState
3333
az provider show -n Microsoft.Compute | grep registrationState
3434
az provider show -n Microsoft.Storage | grep registrationState
3535
az provider show -n Microsoft.Network | grep registrationState
36+
az provider show -n Microsoft.ContainerInstance | grep registrationState
3637
```
3738

38-
If they do not say registered, run the following:
39+
If they don't say registered, run the following:
3940

4041
```azurecli-interactive
4142
az provider register -n Microsoft.VirtualMachineImages
4243
az provider register -n Microsoft.Compute
4344
az provider register -n Microsoft.KeyVault
4445
az provider register -n Microsoft.Storage
4546
az provider register -n Microsoft.Network
47+
az provider register -n Microsoft.ContainerInstance
4648
```
4749

4850
## Set variables and permissions
4951

50-
We will be using some pieces of information repeatedly, so we will create some variables to store that information.
52+
We'll be using some pieces of information repeatedly, so we'll create some variables to store that information.
5153

5254
Image Builder only supports 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.
5355

@@ -80,7 +82,7 @@ az group create -n $sigResourceGroup -l $location
8082

8183
## Create a user-assigned identity and set permissions on the resource group
8284

83-
Image Builder will use the [user-identity](../../active-directory/managed-identities-azure-resources/qs-configure-cli-windows-vm.md#user-assigned-managed-identity) provided to inject the image into the Azure Compute Gallery. In this example, you will create an Azure role definition that has the granular actions to perform distributing the image to the gallery. The role definition will then be assigned to the user-identity.
85+
Image Builder uses the [user-identity](../../active-directory/managed-identities-azure-resources/qs-configure-cli-windows-vm.md#user-assigned-managed-identity) provided to inject the image into the Azure Compute Gallery. In this example, you'll create an Azure role definition that has the granular actions to perform distributing the image to the gallery. The role definition will then be assigned to the user-identity.
8486

8587
```azurecli-interactive
8688
# create user assigned identity for image builder to access the storage account where the script is located
@@ -115,7 +117,7 @@ az role assignment create \
115117

116118
## Create an image definition and gallery
117119

118-
To use Image Builder with an Azure Compute Gallery, you need to have an existing gallery and image definition. Image Builder will not create the gallery and image definition for you.
120+
To use Image Builder with an Azure Compute Gallery, you need to have an existing gallery and image definition. Image Builder won't create the gallery and image definition for you.
119121

120122
If you don't already have a gallery and image definition to use, start by creating them. First, create a gallery.
121123

@@ -213,9 +215,9 @@ You should see the image was customized with a *Message of the Day* as soon as y
213215

214216
## Clean up resources
215217

216-
If you want to now try re-customizing the image version to create a new version of the same image, skip the next steps and go on to [Use Azure Image Builder to create another image version](image-builder-gallery-update-image-version.md).
218+
If you want to now try recustomizing the image version to create a new version of the same image, skip the next steps and go on to [Use Azure Image Builder to create another image version](image-builder-gallery-update-image-version.md).
217219

218-
This will delete the image that was created, along with all of the other resource files. Make sure you are finished with this deployment before deleting the resources.
220+
This deletes the image that was created, along with all of the other resource files. Make sure you're finished with this deployment before deleting the resources.
219221

220222
When deleting gallery resources, you need delete all of the image versions before you can delete the image definition used to create them. To delete a gallery, you first need to have deleted all of the image definitions in the gallery.
221223

articles/virtual-machines/linux/image-builder-troubleshoot.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article helps you troubleshoot common problems and errors you
44
author: kof-f
55
ms.author: kofiforson
66
ms.reviewer: erd
7-
ms.date: 11/01/2023
7+
ms.date: 11/10/2023
88
ms.topic: troubleshooting
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -735,10 +735,30 @@ The cause might be a timing issue because of the D1_V2 VM size. If customization
735735

736736
To avoid the timing issue, you can increase the VM size or you can add a 60-second PowerShell sleep customization.
737737

738+
### Unregistered Azure Container Instances provider
739+
740+
#### Error
741+
```text
742+
Azure Container Instances provider not registered for your subscription.
743+
```
744+
745+
#### Cause
746+
Your template subscription doesn't have the Azure Container Instances provider registered.
747+
748+
#### Solution
749+
Register the Azure Container Instances provider for your template subscription and add the Azure CLI or PowerShell commands:
750+
751+
- Azure CLI: `az provider register -n Microsoft.ContainerInstance`
752+
- PowerShell: `Register-AzResourceProvider -ProviderNamespace Microsoft.ContainerInstance`
753+
754+
755+
738756
### Azure Container Instances quota exceeded
739757

740758
#### Error
741-
"Azure Container Instances quota exceeded"
759+
```text
760+
Azure Container Instances quota exceeded"
761+
```
742762

743763
#### Cause
744764
Your subscription doesn't have enough Azure Container Instances (ACI) quota for Azure Image Builder to successfully build an image.

articles/virtual-machines/linux/image-builder.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Use Azure VM Image Builder with an Azure Compute Gallery for Linux VMs
33
description: Create Linux VM images with Azure VM Image Builder and Azure Compute Gallery.
44
author: kof-f
55
ms.author: kofiforson
6-
ms.reviewer: cynthn
7-
ms.date: 04/11/2023
6+
ms.reviewer: erd
7+
ms.date: 11/10/2023
88
ms.topic: how-to
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -20,16 +20,17 @@ This article uses a sample JSON template to configure the image. The JSON file i
2020

2121
To distribute the image to an Azure Compute Gallery, the template uses [sharedImage](image-builder-json.md#distribute-sharedimage) as the value for the `distribute` section of the template.
2222

23-
## Register the features
23+
## Register the providers
2424

25-
To use VM Image Builder, you need to register the feature. Check your registration by running the following commands:
25+
To use VM Image Builder, you need to register the providers. Check your registration by running the following commands:
2626

2727
```azurecli-interactive
2828
az provider show -n Microsoft.VirtualMachineImages -o json | grep registrationState
2929
az provider show -n Microsoft.KeyVault -o json | grep registrationState
3030
az provider show -n Microsoft.Compute -o json | grep registrationState
3131
az provider show -n Microsoft.Storage -o json | grep registrationState
3232
az provider show -n Microsoft.Network -o json | grep registrationState
33+
az provider show -n Microsoft.ContainerInstance -o json | grep registrationState
3334
```
3435

3536
If the output doesn't say *registered*, run the following commands:
@@ -40,6 +41,7 @@ az provider register -n Microsoft.Compute
4041
az provider register -n Microsoft.KeyVault
4142
az provider register -n Microsoft.Storage
4243
az provider register -n Microsoft.Network
44+
az provider register -n Microsoft.ContainerInstance
4345
```
4446

4547
## Set variables and permissions

0 commit comments

Comments
 (0)