Skip to content

Commit 2312f21

Browse files
Merge pull request #227011 from ericd-mst-github/erd-aib-troubleshoot
Erd aib troubleshoot
2 parents 2f1ae8b + bb8785a commit 2312f21

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Troubleshoot Azure VM Image Builder
33
description: This article helps you troubleshoot common problems and errors you might encounter when you're using Azure VM Image Builder.
44
author: kof-f
55
ms.author: kofiforson
6-
ms.reviewer: cynthn
7-
ms.date: 10/02/2020
6+
ms.reviewer: erd
7+
ms.date: 02/10/2023
88
ms.topic: troubleshooting
99
ms.service: virtual-machines
1010
ms.subservice: image-builder
@@ -88,6 +88,38 @@ The template already exists.
8888

8989
If you submit an image configuration template and the submission fails, a failed template artifact still exists. Delete the failed template.
9090

91+
### Reassigning MSI on image templates
92+
93+
#### Error
94+
95+
```text
96+
The assigned managed identity cannot be used. Please remove the existing one and re-assign a new identity. For more troubleshooting steps go to https://aka.ms/azvmimagebuilderts.
97+
```
98+
99+
#### Cause
100+
101+
There are cases where [Managed Service Identities (MSI)](/azure/virtual-machines/linux/image-builder-permissions-cli#create-a-user-assigned-managed-identity) assigned to the image template cannot be used:
102+
103+
1. The Image Builder template uses a customer provided staging resource group and the MSI is deleted before the image template is deleted ([staging resource group](/azure/virtual-machines/linux/image-builder-json?#properties-stagingresourcegroup) scenario)
104+
1. The identity is deleted and attempted to recreate the identity with the same name, but without re-assigning the MSI. Though the resource ids are the same, the underlying service principal has been changed.
105+
106+
107+
#### Solution
108+
109+
Use Azure CLI to reset identity on the image template. Ensure you [update](/azure/update-azure-cli) Azure CLI to the 2.45.0 version or later.
110+
111+
Remove the managed identity from the target image builder template
112+
113+
```azurecli-interactive
114+
az image builder identity remove -g <template resource group> -n <template name> --user-assigned <identity resource id>
115+
```
116+
117+
Re-assign identity to the target image builder template
118+
119+
```azurecli-interactive
120+
az image builder identity assign -g <template rg> -n <template name> --user-assigned <identity resource id>
121+
```
122+
91123
### The resource operation finished with a terminal provisioning state of "Failed"
92124

93125
#### Error

0 commit comments

Comments
 (0)