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
> If using a version of Azure Lab Services prior to the [August 2022 Update](lab-services-whats-new.md), see [Attach or detach a shared image gallery to a lab account in Azure Lab Services](how-to-attach-detach-shared-image-gallery-1.md).
19
-
20
-
This article shows you how to attach or detach an Azure Compute Gallery to a lab plan.
17
+
This article shows how to attach or detach an Azure compute gallery to a lab plan. If you use a lab account, see how to [attach or detach a compute gallery to a lab account](how-to-attach-detach-shared-image-gallery-1.md).
21
18
22
19
> [!IMPORTANT]
23
-
> Lab plan administrators must manually [replicate images](../virtual-machines/shared-image-galleries.md) to other regions in the compute gallery. Replicate an Azure Compute Gallery image to the same region as the lab plan to be shown in the list of virtual machine images during lab creation.
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.
24
21
25
-
Saving images to a compute gallery and replicating those images incurs additional cost. This cost is separate from the Azure Lab Services usage cost. For more information about Azure Compute Gallery pricing, see [Azure Compute Gallery – Billing](../virtual-machines/azure-compute-gallery.md#billing).
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).
26
23
27
24
## Prerequisites
28
25
29
26
- To change settings for the lab plan, your Azure account needs the [Owner](/azure/role-based-access-control/built-in-roles#owner), [Contributor](/azure/role-based-access-control/built-in-roles#contributor), or [Lab Services Contributor](/azure/role-based-access-control/built-in-roles#lab-services-contributor) role on the lab plan. Learn more about the [Azure Lab Services built-in roles](./administrator-guide.md#rbac-roles).
30
27
31
-
- To attach an Azure compute gallery to a lab plan, your Azure account needs the following permissions:
28
+
- To attach an Azure compute gallery to a lab plan, your Azure account needs to have the following permissions:
29
+
30
+
| Azure role | Scope | Note |
31
+
| ---- | ----- | ---- |
32
+
|[Owner](/azure/role-based-access-control/built-in-roles#owner)| Azure compute gallery | If you attach an existing compute gallery. |
33
+
|[Owner](/azure/role-based-access-control/built-in-roles#owner)| Resource group | If you create a new compute gallery. |
32
34
33
-
-[Owner](/azure/role-based-access-control/built-in-roles#owner) role on the Azure compute gallery resource, if you're using an existing compute gallery
34
-
-[Owner](/azure/role-based-access-control/built-in-roles#owner) role on the resource group, if you're creating a new compute gallery
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
36
36
37
## Scenarios
37
38
@@ -45,9 +46,9 @@ When you [save a template image of a lab](how-to-use-shared-image-gallery.md#sav
45
46
A lab creator can create a template VM based on both generalized and specialized images in Azure Lab Services.
46
47
47
48
> [!IMPORTANT]
48
-
> While using an Azure Compute Gallery, Azure Lab Services supports only images that use less than 128 GB of disk space on their OS drive. Images with more than 128 GB of disk space or multiple disks won't be shown in the list of virtual machine images during lab creation.
49
+
> While using an Azure compute gallery, Azure Lab Services supports only images that use less than 128 GB of disk space on their OS drive. Images with more than 128 GB of disk space or multiple disks won't be shown in the list of virtual machine images during lab creation.
49
50
50
-
## Create and attach a compute gallery
51
+
## Attach a new compute gallery to a lab plan
51
52
52
53
1. Open your lab plan in the [Azure portal](https://portal.azure.com).
53
54
@@ -67,7 +68,57 @@ In the bottom pane, you see images in the compute gallery. There are no images i
67
68
68
69
:::image type="content" source="./media/how-to-attach-detach-shared-image-gallery/attached-gallery-empty-list.png" alt-text="Screenshot of the attached image gallery list of images." lightbox="./media/how-to-attach-detach-shared-image-gallery/attached-gallery-empty-list.png":::
69
70
70
-
## Attach an existing compute gallery
71
+
## Attach an existing compute gallery to a lab plan
72
+
73
+
If you already have an Azure compute gallery, you can also attach it to your lab plan. To attach an existing compute gallery, you first need to grant the Azure Lab Services service principal permissions to the compute gallery. Next, you can attach the existing compute gallery to your lab plan.
74
+
75
+
### Configure compute gallery permissions
76
+
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:
78
+
79
+
| Name | Application ID | Description |
80
+
| ---- | ----- | ---- |
81
+
| Azure Lab Services | c7bb12bf-0b39-4f7f-9171-f418ff39b76a | Service principal for Azure Lab Services lab plans (V2). |
82
+
| Azure Lab Services | 1a14be2a-e903-4cec-99cf-b2e209259a0f | Service principal for Azure Lab Services lab accounts (V1). |
83
+
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`.
85
+
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).
88
+
89
+
Follow these steps to grant permissions to the Azure Lab Service service principal by using the Azure CLI:
90
+
91
+
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
+
93
+
Azure Cloud Shell is an interactive, authenticated, browser-accessible terminal for managing Azure resources. Learn how to get started with [Azure Cloud Shell](/azure/cloud-shell/quickstart).
94
+
95
+
1. Enter the following commands in Cloud Shell:
96
+
97
+
1. Select the service principal object ID, based on the application ID:
98
+
99
+
```azurecli-interactive
100
+
az ad sp show --id c7bb12bf-0b39-4f7f-9171-f418ff39b76a --query "id" -o tsv
101
+
```
102
+
103
+
1. Select the ID of the compute gallery, based on the gallery name:
104
+
105
+
```azurecli-interactive
106
+
az sig show --gallery-name <gallery-name> --resource-group <gallery-resource-group> --query id -o tsv
107
+
```
108
+
109
+
Replace the text placeholders *`<gallery-name>`* and *`<gallery-resource-group>`* with the compute gallery name and the name of the resource group that contains the compute gallery. Make sure to remove the angle brackets when replacing the text.
110
+
111
+
1. Assign the Owner role to service principal on the compute gallery:
112
+
113
+
```azurecli-interactive
114
+
az role assignment create --assignee-object-id <service-principal-object-id> --role Owner --scope <gallery-id>
115
+
```
116
+
117
+
Replace the text placeholders *`<service-principal-object-id>`* and *`<gallery-id>`* with the outcomes of the previous commands.
118
+
119
+
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).
120
+
121
+
### Attach the compute gallery
71
122
72
123
The following procedure shows you how to attach an existing compute gallery to a lab plan.
73
124
@@ -105,7 +156,7 @@ To detach a compute gallery from your lab, select **Detach** on the toolbar. Con
105
156
106
157
:::image type="content" source="./media/how-to-attach-detach-shared-image-gallery/attached-gallery-detach.png" alt-text="Screenshot of how to detach the compute gallery from the lab plan.":::
107
158
108
-
Only one Azure compute gallery can be attached to a lab plan. To attach another compute gallery, follow the steps to [attach an existing compute gallery](#attach-an-existing-compute-gallery).
159
+
Only one Azure compute gallery can be attached to a lab plan. To attach another compute gallery, follow the steps to [attach an existing compute gallery](#attach-an-existing-compute-gallery-to-a-lab-plan).
Copy file name to clipboardExpand all lines: articles/lab-services/lab-services-whats-new.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ In this release, there are a few known issues:
38
38
39
39
- When using virtual network injection, use caution in making changes to the virtual network and subnet. Changes may cause the lab VMs to stop working. For example, deleting your virtual network will cause all the lab VMs to stop working. We plan to improve this experience in the future, but for now make sure to delete labs before deleting networks.
40
40
- Moving lab plan and lab resources from one Azure region to another isn't supported.
41
-
- Azure Compute [resource provider must be registered](../azure-resource-manager/management/resource-providers-and-types.md) before Azure Lab Services can [create and attach an Azure Compute Gallery resource](how-to-attach-detach-shared-image-gallery.md#create-and-attach-a-compute-gallery).
41
+
- Azure Compute [resource provider must be registered](../azure-resource-manager/management/resource-providers-and-types.md) before Azure Lab Services can [create and attach an Azure Compute Gallery resource](how-to-attach-detach-shared-image-gallery.md#attach-an-existing-compute-gallery-to-a-lab-plan).
0 commit comments