Skip to content

Commit 2e90531

Browse files
Merge pull request #273421 from kof-f/patch-67
Breaking Change AIB API Version 2024-02-01 Documentation Update
2 parents 9957c03 + 994f1af commit 2e90531

File tree

3 files changed

+103
-21
lines changed

3 files changed

+103
-21
lines changed

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

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,93 @@ This article contains all major API changes and feature updates for the Azure VM
1818

1919
## Updates
2020

21+
### May 2024
22+
#### Breaking Change: Case Sensitivity
23+
24+
Starting from May 21, 2024, Azure VM Image Builder's API version 2024-02-01 and beyond will enforce case sensitivity for all fields. This means that the capitalization of letters in your API requests must match exactly with the expected format.
25+
26+
> **Important Note for Existing Azure Image Builder Users**
27+
>
28+
> If you're an existing user of Azure VM Image Builder, rest assured that this change will **not** impact your existing resources. The case sensitivity enforcement applies only to **newly created resources** using **API version 2024-02-01 and beyond**. Your existing resources will continue to function as expected without any changes.
29+
>
30+
> If you encounter any issues related to case sensitivity, please refer to Azure Image Builder's updated API documentation for guidance.
31+
32+
Previously, Azure Image Builder's API was more forgiving in terms of case, but moving forward, precision is crucial. When making API calls, ensure that you use the correct capitalization for field names, parameters, and values. For example, if a field is named “vmBoot,” you must use “vmBoot” (not “VMBoot” or “vmboot”).
33+
34+
If you send an API request to Azure Image Builder's API version 2024-02-01 and beyond with incorrect case or unrecognized fields, the service will reject it. You will receive an error response indicating that the request is invalid. The error will look something like this:
35+
36+
`Unmarshalling entity encountered error: unmarshalling type *v2024_02_01.ImageTemplate: struct field Properties: unmarshalling type *v2024_02_01.ImageTemplateProperties: struct field Optimize: unmarshalling type *v2024_02_01.ImageTemplatePropertiesOptimize: unmarshalling type *v2024_02_01.ImageTemplatePropertiesOptimize, unknown field \"vmboot\". There is an issue with the syntax with the JSON template you are submitting. Please check the JSON template for syntax and grammar. For more information on the syntax and grammar of the JSON template, visit http://aka.ms/azvmimagebuildertmplref.`
37+
38+
The error message will mention an "unknown field" and direct you to the official documentation: [Create an Azure Image Builder Bicep or ARM template JSON template](./linux/image-builder-json.md).
39+
40+
> **Reference Azure Image Builder's Swagger for API Calls**
41+
>
42+
> When making calls to the Azure Image Builder service, always reference the [Swagger documentation](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable), which serves as the definitive source of truth for Azure Image Builder's API specifications. While the public documentation has been updated to include the proper capitalization and field names ahead of the API release, the Swagger definition contains precise details about each AIB API to ensure you are making calls to the service correctly.
43+
44+
Below is a list of the documentation changes that were made to match the field names in API version 2024-02-01:
45+
46+
In the [Create an Azure Image Builder Bicep or ARM template JSON template](./linux/image-builder-json.md) documentation:
47+
48+
**Fields Updated:**
49+
50+
- Replaced several mentions of `vmboot` with `vmBoot`
51+
- Replaced one mention of `imageVersionID` with `imageVersionId`
52+
53+
**Field Removed:**
54+
55+
- `apiVersion`: We recommend avoiding the inclusion of this field in your requests because it is not explicitly specified in our API, so including it in your JSON template _may_ lead to errors in your image build.
56+
57+
In the [Azure VM Image Builder networking options](./linux/image-builder-networking.md) documentation:
58+
59+
**Field Updated:**
60+
61+
- Replaced one mention of `VirtualNetworkConfig` with `vnetConfig`
62+
63+
**Fields Removed:**
64+
65+
- `subnetName` in the `vnetConfig` property – this field is deprecated and the new field is `subnetId`
66+
- `resourceGroupName` in the `vnetConfig` property – this field is deprecated and the new field is `subnetId`
67+
68+
#### How to Pin to an Older Azure Image Builder API Version
69+
70+
> **Important Consideration for Pinning to Older API Versions**
71+
>
72+
> Pinning to an older Azure Image Builder API version can provide compatibility with your existing templates, but it's not recommended due to the following factors:
73+
>
74+
> - Deprecation Risk: Older API versions may eventually be deprecated.
75+
>
76+
> - Missing Features: By pinning to an older API version, you miss out on the latest features and improvements introduced in newer versions. These enhancements often improve performance, security, and functionality.
77+
78+
If you’d like to avoid making changes to the properties in your image templates due to the new case sensitivity rules, you have the option to pin your Azure VM Image Builder API calls to a previous API version. This allows you to continue using the familiar behavior without any modifications.
79+
80+
To ensure compatibility with your existing templates, when creating or updating an image template, specify the desired API version (e.g., api-version=2022-07-01) by including the `api-version` parameter in your call to the service. Example:
81+
82+
# [HTTP](#tab/http)
83+
```http
84+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}?api-version=2022-07-01
85+
```
86+
87+
# [Azure CLI](#tab/-interactive)
88+
89+
```azurecli-interactive
90+
az resource create \
91+
--api-version=2022-07-01 \
92+
--resource-group <resourceGroupName> \
93+
--properties <jsonResource> \
94+
--is-full-object \
95+
--resource-type Microsoft.VirtualMachineImages/imageTemplates \
96+
-n <imageTemplateName>
97+
```
98+
99+
# [Azure PowerShell](#tab/azurepowershell-interactive)
100+
101+
```azurepowershell-interactive
102+
New-AzResourceGroupDeployment -ResourceGroupName <resourceGroupName> -TemplateFile <templateFilePath> -TemplateParameterObject @{"api-version" = "2022-07-01"; "imageTemplateName" = <imageTemplateName>; "svclocation" = <location>}
103+
```
104+
> **Test Your Code**
105+
>
106+
> After pinning to the older API version, test your code to verify that it behaves as expected. Ensure that your existing templates continue to function correctly.
107+
21108
### November 2023
22109
Azure Image Builder is enabling Isolated Image Builds using Azure Container Instances in a phased manner. The rollout is expected to be completed by early 2024. Your existing image templates will continue to work and there is no change in the way you create or build new image templates.
23110

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The basic format is:
2424
```json
2525
{
2626
"type": "Microsoft.VirtualMachineImages/imageTemplates",
27-
"apiVersion": "2022-02-14",
2827
"location": "<region>",
2928
"tags": {
3029
"<name>": "<value>",
@@ -98,16 +97,16 @@ resource azureImageBuilder 'Microsoft.VirtualMachineImages/imageTemplates@2022-0
9897
```
9998

10099
---
100+
## API version
101+
The API version will change over time as the API changes. See [What's new in Azure VM Image Builder](../image-builder-api-update-release-notes.md) for all major API changes and feature updates for the Azure VM Image Builder service.
101102

102-
## Type and API version
103-
104-
The `type` is the resource type, which must be `Microsoft.VirtualMachineImages/imageTemplates`. The `apiVersion` will change over time as the API changes. See [What's new in Azure VM Image Builder](../image-builder-api-update-release-notes.md) for all major API changes and feature updates for the Azure VM Image Builder service.
103+
## Type
104+
The `type` is the resource type, which must be `Microsoft.VirtualMachineImages/imageTemplates`.
105105

106106
# [JSON](#tab/json)
107107

108108
```json
109109
"type": "Microsoft.VirtualMachineImages/imageTemplates",
110-
"apiVersion": "2022-02-14",
111110
```
112111

113112
# [Bicep](#tab/bicep)
@@ -852,8 +851,8 @@ imageResourceGroup=<resourceGroup of image template>
852851
runOutputName=<runOutputName>
853852
854853
az resource show \
855-
--ids "/subscriptions/$subscriptionID/resourcegroups/$imageResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/ImageTemplateLinuxRHEL77/runOutputs/$runOutputName" \
856-
--api-version=2021-10-01
854+
--ids "/subscriptions/$subscriptionID/resourcegroups/$imageResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/ImageTemplateLinuxRHEL77/runOutputs/$runOutputName" \
855+
--api-version=2023-07-01
857856
```
858857

859858
Output:
@@ -1207,7 +1206,7 @@ The `optimize` property can be enabled while creating a VM image and allows VM o
12071206

12081207
```json
12091208
"optimize": {
1210-
"vmboot": {
1209+
"vmBoot": {
12111210
"state": "Enabled"
12121211
}
12131212
}
@@ -1217,15 +1216,15 @@ The `optimize` property can be enabled while creating a VM image and allows VM o
12171216

12181217
```bicep
12191218
optimize: {
1220-
vmboot: {
1219+
vmBoot: {
12211220
state: 'Enabled'
12221221
}
12231222
}
12241223
```
12251224
---
12261225

1227-
- **vmboot**: A configuration related to the booting process of the virtual machine (VM), used to control optimizations that can improve boot time or other performance aspects.
1228-
- state: The state of the boot optimization feature within `vmboot`, with the value `Enabled` indicating that the feature is turned on to improve image creation time.
1226+
- **vmBoot**: A configuration related to the booting process of the virtual machine (VM), used to control optimizations that can improve boot time or other performance aspects.
1227+
- state: The state of the boot optimization feature within `vmBoot`, with the value `Enabled` indicating that the feature is turned on to improve image creation time.
12291228

12301229
To learn more, see [VM optimization for gallery images with Azure VM Image Builder](../vm-boot-optimization.md).
12311230

@@ -1361,7 +1360,7 @@ Sets the source image as an existing image version in an Azure Compute Gallery.
13611360
```json
13621361
"source": {
13631362
"type": "SharedImageVersion",
1364-
"imageVersionID": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<sharedImageGalleryName>/images/<imageDefinitionName/versions/<imageVersion>"
1363+
"imageVersionId": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<sharedImageGalleryName>/images/<imageDefinitionName/versions/<imageVersion>"
13651364
}
13661365
```
13671366

@@ -1755,7 +1754,7 @@ Size of the proxy virtual machine used to pass traffic to the build VM and valid
17551754
To start a build, you need to invoke 'Run' on the Image Template resource, examples of `run` commands:
17561755

17571756
```azurepowershell-interactive
1758-
Invoke-AzResourceAction -ResourceName $imageTemplateName -ResourceGroupName $imageResourceGroup -ResourceType Microsoft.VirtualMachineImages/imageTemplates -ApiVersion "2021-10-01" -Action Run -Force
1757+
Invoke-AzResourceAction -ResourceName $imageTemplateName -ResourceGroupName $imageResourceGroup -ResourceType Microsoft.VirtualMachineImages/imageTemplates -ApiVersion "2023-07-01" -Action Run -Force
17591758
```
17601759

17611760
```azurecli-interactive
@@ -1775,7 +1774,7 @@ The build can be canceled anytime. If the distribution phase has started you can
17751774
Examples of `cancel` commands:
17761775

17771776
```azurepowershell-interactive
1778-
Invoke-AzResourceAction -ResourceName $imageTemplateName -ResourceGroupName $imageResourceGroup -ResourceType Microsoft.VirtualMachineImages/imageTemplates -ApiVersion "2021-10-01" -Action Cancel -Force
1777+
Invoke-AzResourceAction -ResourceName $imageTemplateName -ResourceGroupName $imageResourceGroup -ResourceType Microsoft.VirtualMachineImages/imageTemplates -ApiVersion "2023-07-01" -Action Cancel -Force
17791778
```
17801779

17811780
```azurecli-interactive

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,14 @@ The deployed proxy VM size is *Standard A1_v2*, in addition to the build VM. The
5858
### Image template parameters to support the virtual network
5959

6060
```json
61-
"VirtualNetworkConfig": {
62-
"name": "",
63-
"subnetName": "",
64-
"resourceGroupName": ""
61+
"vnetConfig": {
62+
"subnetId": ""
6563
},
6664
```
6765

6866
| Setting | Description |
6967
|---------|---------|
70-
| `name` | (Optional) The name of a pre-existing virtual network. |
71-
| `subnetName` | The name of the subnet within the specified virtual network. You must specify this setting if, and only if, the `name` setting is specified. |
72-
| `resourceGroupName` | The name of the resource group containing the specified virtual network. You must specify this setting if, and only if, the `name` setting is specified. |
68+
| `subnetId` | Resource ID of a pre-existing subnet on which the build VM and validation VM is deployed. |
7369

7470
Private Link requires an IP from the specified virtual network and subnet. Currently, Azure doesn’t support network policies on these IPs. Hence, you must disable network policies on the subnet. For more information, see the [Private Link documentation](../../private-link/index.yml).
7571

0 commit comments

Comments
 (0)