You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/lab-services/how-to-attach-detach-shared-image-gallery.md
+36-7Lines changed: 36 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ This article shows how to attach or detach an Azure compute gallery to a lab pla
19
19
> [!IMPORTANT]
20
20
> To show a virtual machine image in the list of images during lab creation, you need to replicate the compute gallery image to the same region as the lab plan. You need to manually [replicate images](../virtual-machines/shared-image-galleries.md) to other regions in the compute gallery.
21
21
22
-
Saving images to a compute gallery and replicating those images incurs additional cost. This cost is separate from the Azure Lab Services usage cost. Learn more about [Azure Compute Gallery pricing](../virtual-machines/azure-compute-gallery.md#billing).
22
+
Saving images to a compute gallery and replicating those images incurs extra cost. This cost is separate from the Azure Lab Services usage cost. Learn more about [Azure Compute Gallery pricing](../virtual-machines/azure-compute-gallery.md#billing).
23
23
24
24
## Prerequisites
25
25
@@ -32,7 +32,9 @@ Saving images to a compute gallery and replicating those images incurs additiona
32
32
|[Owner](/azure/role-based-access-control/built-in-roles#owner)| Azure compute gallery | If you attach an existing compute gallery. |
33
33
|[Owner](/azure/role-based-access-control/built-in-roles#owner)| Resource group | If you create a new compute gallery. |
34
34
35
-
Learn how to [assign an Azure role in Azure role-based access control (Azure RBAC)](/azure/role-based-access-control/role-assignments-steps#step-5-assign-role).
35
+
- If your Azure account is a guest user in Azure Active Directory, your Azure account needs to have the [Directory Readers](/azure/active-directory/roles/permissions-reference#directory-readers) role to attach an existing compute gallery.
36
+
37
+
Learn how to [assign an Azure role in Azure role-based access control (Azure RBAC)](/azure/role-based-access-control/role-assignments-steps#step-5-assign-role).
36
38
37
39
## Scenarios
38
40
@@ -74,19 +76,20 @@ If you already have an Azure compute gallery, you can also attach it to your lab
74
76
75
77
### Configure compute gallery permissions
76
78
77
-
The Azure Lab Services service principal needs to have the Owner Azure RBAC role on the Azure compute gallery. There are two Azure Lab Services service principals:
79
+
The Azure Lab Services service principal needs to have the [Owner](/azure/role-based-access-control/built-in-roles#owner) Azure RBAC role on the Azure compute gallery. There are two Azure Lab Services service principals:
78
80
79
81
| Name | Application ID | Description |
80
82
| ---- | ----- | ---- |
81
83
| Azure Lab Services | c7bb12bf-0b39-4f7f-9171-f418ff39b76a | Service principal for Azure Lab Services lab plans (V2). |
82
84
| Azure Lab Services | 1a14be2a-e903-4cec-99cf-b2e209259a0f | Service principal for Azure Lab Services lab accounts (V1). |
83
85
84
-
To attach a compute gallery to a lab plan, assign the Owner role to the service principal with application ID `c7bb12bf-0b39-4f7f-9171-f418ff39b76a`.
86
+
To attach a compute gallery to a lab plan, assign the [Owner](/azure/role-based-access-control/built-in-roles#owner) role to the service principal with application ID `c7bb12bf-0b39-4f7f-9171-f418ff39b76a`.
87
+
88
+
If your Azure account is a guest user, your Azure account needs to have the [Directory Readers](/azure/active-directory/roles/permissions-reference#directory-readers) role to perform the role assignment. Learn about [role assignments for guest users](/azure/role-based-access-control/role-assignments-external-users#guest-user-cannot-browse-users-groups-or-service-principals-to-assign-roles).
85
89
86
-
> [!NOTE]
87
-
> When you add a role assignment in the Azure portal, the user interface shows the *object ID* of the service principal, which is different from the *application ID*. The object ID for a service principal can be different in each Azure subscription. You can find the service principal object ID in Azure Active Directory, based on its application ID. Learn more about [Service principal objects](/azure/active-directory/develop/app-objects-and-service-principals#service-principal-object).
90
+
# [Azure CLI](#tab/azure-cli)
88
91
89
-
Follow these steps to grant permissions to the Azure Lab Service service principal by using the Azure CLI:
92
+
Follow these steps to grant permissions to the Azure Lab Services service principal by using the Azure CLI:
90
93
91
94
1. Open [Azure Cloud Shell](https://shell.azure.com). Alternately, select the **Cloud Shell** button on the menu bar at the upper right in the [Azure portal](https://portal.azure.com).
92
95
@@ -116,6 +119,32 @@ Follow these steps to grant permissions to the Azure Lab Service service princip
116
119
117
120
Replace the text placeholders *`<service-principal-object-id>`* and *`<gallery-id>`* with the outcomes of the previous commands.
118
121
122
+
# [Azure portal](#tab/portal)
123
+
124
+
When you add a role assignment in the Azure portal, the user interface shows the *object ID* of the service principal, which is different from the *application ID*. The object ID for a service principal is different in each Azure subscription. Learn more about [Service principal objects](/azure/active-directory/develop/app-objects-and-service-principals#service-principal-object).
125
+
126
+
Follow these steps to grant permissions to the Azure Lab Services service principal by using the Azure portal:
127
+
128
+
1. Sign in to the [Azure portal](https://portal.azure.com).
129
+
1. In the search box at the top, enter *Enterprise applications*, and select **Enterprise applications** from the services list.
130
+
1. On the **All applications** page, remove the **Application type** filter, and enter *c7bb12bf-0b39-4f7f-9171-f418ff39b76a* in the **Application ID starts with** filter.
131
+
132
+
:::image type="content" source="./media/how-to-attach-detach-shared-image-gallery/lab-services-enterprise-applications.png" alt-text="Screenshot that shows the list of enterprise applications in the Azure portal, highlighting the application ID filter." lightbox="./media/how-to-attach-detach-shared-image-gallery/lab-services-enterprise-applications.png":::
133
+
134
+
1. Note the **Object ID** value of the Azure Lab Services service principal.
135
+
1. Go to your Azure compute gallery resource.
136
+
1. Select **Access control (IAM)**, and then select **Add** > **Add role assignment**.
137
+
1. On the **Role** page, select the **Owner** role from the list.
138
+
1. On the **Members** page, select **Select members**.
139
+
1. Enter *Azure Lab Services** in the search box, select both items, and then select **Select**.
140
+
1. In the **Add role assignment** page, remove the item that doesn't match the object ID of the Azure Lab Services service principal.
141
+
142
+
:::image type="content" source="./media/how-to-attach-detach-shared-image-gallery/compute-gallery-add-role-assignment.png" alt-text="Screenshot that shows the add role assignment page for the compute gallery in the Azure portal." lightbox="./media/how-to-attach-detach-shared-image-gallery/compute-gallery-add-role-assignment.png":::
143
+
144
+
1. On the **Review + Assign** page, select **Review + assign** to add the role assignment to the compute gallery.
145
+
146
+
---
147
+
119
148
Learn more about how to [assign an Azure role in Azure role-based access control (Azure RBAC)](/azure/role-based-access-control/role-assignments-steps#step-5-assign-role).
0 commit comments