Skip to content

Commit a711285

Browse files
Merge pull request #225255 from cynthn/gallery-rbac
RBAC
2 parents cec408e + 5889650 commit a711285

10 files changed

+611
-153
lines changed

articles/virtual-machines/azure-compute-gallery.md

Lines changed: 26 additions & 25 deletions
Large diffs are not rendered by default.

articles/virtual-machines/create-gallery.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: virtual-machines
66
ms.subservice: gallery
77
ms.topic: how-to
88
ms.workload: infrastructure
9-
ms.date: 06/22/2022
9+
ms.date: 02/14/2023
1010
ms.author: saraic
1111
ms.reviewer: cynthn
1212
ms.custom: template-how-to, devx-track-azurecli
@@ -23,11 +23,11 @@ The Azure Compute Gallery lets you share custom VM images and application packag
2323

2424
The gallery is a top-level resource that can be shared in multiple ways:
2525

26-
| Share with\: | Option |
27-
|----|----|
28-
| [Specific people, groups, or service principals](#create-a-private-gallery) | Role-based access control (RBAC) lets you share resources to specific people, groups, or service principals on a granular level. |
29-
| [Subscriptions or tenants](#create-a-direct-shared-gallery) | Direct shared gallery (preview) lets you share to everyone in a subscription or tenant. |
30-
| [Everyone](#create-a-community-gallery) | Community gallery (preview) lets you share your entire gallery publicly, to all Azure users. |
26+
| Sharing with: | People | Groups | Service Principal | All users in a specific subscription (or) tenant | Publicly with all users in Azure |
27+
|---|---|---|---|---|---|
28+
| [RBAC Sharing](./share-gallery.md) | Yes | Yes | Yes | No | No |
29+
| RBAC + [Direct shared gallery](./share-gallery-direct.md) | Yes | Yes | Yes | Yes | No |
30+
| RBAC + [Community gallery](./share-gallery-community.md) | Yes | Yes | Yes | No | Yes |
3131

3232
## Naming
3333

@@ -37,16 +37,13 @@ Allowed characters for gallery name are uppercase (A-Z) and lowercase (a-z) lett
3737
## Create a private gallery
3838

3939

40-
41-
42-
4340
### [Portal](#tab/portal)
4441

4542

4643

4744
1. Sign in to the Azure portal at https://portal.azure.com.
4845
1. Type **Azure Compute Gallery** in the search box and select **Azure Compute Gallery** in the results.
49-
1. In the **Azure Compute Gallery** page, click **Add**.
46+
1. In the **Azure Compute Gallery** page, select **Add**.
5047
1. On the **Create Azure Compute Gallery** page, select the correct subscription.
5148
1. In **Resource group**, select a resource group from the drop-down or select **Create new** and type a name for the new resource group.
5249
1. In **Name**, type a name for the name of the gallery.
@@ -118,11 +115,13 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
118115
>
119116
> You can't currently create a Flexible virtual machine scale set from an image shared to you by another tenant.
120117
118+
To start sharing a direct shared gallery with a subscription or tenant, see [Share a gallery with a subscription or tenant](./share-gallery-direct.md).
119+
121120
### [Portal](#tab/portaldirect)
122121

123122
1. Sign in to the Azure portal at https://portal.azure.com.
124123
1. Type **Azure Compute Gallery** in the search box and select **Azure Compute Gallery** in the results.
125-
1. In the **Azure Compute Gallery** page, click **Add**.
124+
1. In the **Azure Compute Gallery** page, select **Add**.
126125
1. On the **Create Azure Compute Gallery** page, select the correct subscription.
127126
1. Complete all of the details on the page.
128127
1. At the bottom of the page, select **Next: Sharing method**.
@@ -131,7 +130,7 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
131130

132131
:::image type="content" source="media/create-gallery/share-direct.png" alt-text="Screenshot showing the option to share using both role-based access control and share directly.":::
133132

134-
1. When you are done, select **Review + create**.
133+
1. When you're done, select **Review + create**.
135134
1. After validation passes, select **Create**.
136135
1. When the deployment is finished, select **Go to resource**.
137136

@@ -184,12 +183,12 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
184183

185184
---
186185

187-
To start sharing the gallery with a subscription or tenant, use see [Share a gallery with a subscription or tenant](./share-gallery-direct.md).
186+
188187

189188
<a name=community></a>
190189
## Create a community gallery
191190

192-
A [community gallery](azure-compute-gallery.md#community) is shared publicly with everyone. To create a community gallery, you create the gallery first, then enable it for sharing. The name of public instance of your gallery will be the prefix you provide, plus a unique GUID.
191+
A [community gallery](azure-compute-gallery.md#community) is shared publicly with everyone. To create a community gallery, you create the gallery first, then enable it for sharing. The name of public instance of your gallery is the prefix you provide, plus a unique GUID.
193192

194193
During the preview, make sure that you create your gallery, image definitions, and image versions in the same region in order to share your gallery publicly.
195194

@@ -198,21 +197,21 @@ During the preview, make sure that you create your gallery, image definitions, a
198197
>
199198
> To publish a community gallery, you need to register for the preview at [https://aka.ms/communitygallery-preview](https://aka.ms/communitygallery-preview). Creating VMs from the community gallery is open to all Azure users.
200199
201-
When creating an image to share with the community, you'll need to provide contact information. This information will be shown **publicly**, so be careful when providing:
200+
When creating an image to share with the community, you need to provide contact information. This information is shown **publicly**, so be careful when providing:
202201
- Community gallery prefix
203202
- Publisher support email
204203
- Publisher URL
205204
- Legal agreement URL
206205

207-
Information from your image definitions will also be publicly available, like what you provide for **Publisher**, **Offer**, and **SKU**.
206+
Information from your image definitions is also publicly available, like what you provide for **Publisher**, **Offer**, and **SKU**.
208207

209208
### Prerequisites
210209

211210
Only the owner of a subscription, or a user or service principal assigned to the `Compute Gallery Sharing Admin` role at the subscription or gallery level, can enable a gallery to go public to the community. To assign a role to a user, group, service principal or managed identity, see [Steps to assign an Azure role](../role-based-access-control/role-assignments-steps.md).
212211

213212
### [CLI](#tab/cli2)
214213

215-
The `--public-name-prefix` value is used to create a name for the public version of your gallery. The `--public-name-prefix` will be the first part of the public name, and the last part will be a GUID, created by the platform, that is unique to your gallery.
214+
The `--public-name-prefix` value is used to create a name for the public version of your gallery. The `--public-name-prefix` is the first part of the public name, and the last part will be a GUID, created by the platform, that is unique to your gallery.
216215

217216
```azurecli-interactive
218217
location=westus
@@ -235,12 +234,12 @@ az sig create \
235234
--public-name-prefix $prefix
236235
```
237236

238-
The output of this command will give you the public name for your community gallery in the `sharingProfile` section, under `publicNames`.
237+
The output of this command gives you the public name for your community gallery in the `sharingProfile` section, under `publicNames`.
239238

240239
To start sharing the gallery to all Azure users, see [Share images using a community gallery](share-gallery-community.md).
241240

242241
### [REST](#tab/rest2)
243-
To create gallery, submit a PUT request:
242+
To create a gallery, submit a PUT request:
244243

245244
```rest
246245
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2021-10-01
@@ -309,7 +308,7 @@ To start sharing the gallery to all Azure users, see [Share images using a commu
309308
## Next steps
310309

311310
- Create an [image definition and an image version](image-version.md).
312-
311+
- Create a VM from a [generalized](vm-generalized-image-version.md#direct-shared-gallery) or [specialized](vm-specialized-image-version.md#direct-shared-gallery) image in a gallery.
313312
- [Create a VM application](vm-applications-how-to.md) in your gallery.
314313

315314

articles/virtual-machines/image-version.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ ms.service: virtual-machines
66
ms.subservice: gallery
77
ms.topic: how-to
88
ms.workload: infrastructure
9-
ms.date: 05/13/2022
9+
ms.date: 02/14/2023
1010
ms.author: saraic
1111
ms.reviewer: cynthn
1212
ms.custom:
1313

1414
---
1515

16-
17-
1816
# Create an image definition and an image version
1917

2018
A [Azure Compute Gallery](shared-image-galleries.md) (formerly known as Shared Image Gallery) simplifies custom image sharing across your organization. Custom images are like marketplace images, but you create them yourself. Images can be created from a VM, VHD, snapshot, managed image, or another image version.
@@ -325,6 +323,65 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
325323

326324
---
327325

326+
## Create an image in one tenant using the source image in another tenant
327+
328+
In the subscription where the source image exists, grant reader permissions to the user. Once the user has reader permission to the source image, login to both accounts (source and target).
329+
330+
You will need the `tenantID` of the source image, the `subscriptionID` for the subscription where the new image will be stored (target), and the `resourceID` of the source image.
331+
332+
### [CLI](#tab/cli2)
333+
334+
```azurecli-interactive
335+
# Set some variables
336+
tenantID="<tenant ID for the source image>"
337+
subID="<subscription ID where the image will be creted>"
338+
sourceImageID="<resource ID of the source image>"
339+
340+
341+
# Log in to the tenant where the source image is available
342+
az login --tenant $tenantID
343+
344+
# Log back in to the subscription where the image will be created and ensure subscription context is set
345+
az login
346+
az account set --subscription $subID
347+
348+
# Create the image
349+
az sig image-version create `
350+
--gallery-image-definition myImageDef `
351+
--gallery-image-version 1.0.0 `
352+
--gallery-name myGallery `
353+
--resource-group myResourceGroup `
354+
--image-version $sourceImageID
355+
```
356+
357+
358+
### [PowerShell](#tab/powershell2)
359+
360+
```azurepowershell-interactive
361+
# Set variables
362+
$targetSubID = "<subscription ID for the target>"
363+
$sourceTenantID = "<tenant ID where for the source image>"
364+
$sourceImageID = "<resource ID of the source image>"
365+
366+
#Login to the subscription where the new image will be created
367+
Connect-AzAccount -UseDeviceAuthentication -Subscription $targetSubID
368+
369+
# Login to the tenant where the source image is published
370+
Connect-AzAccount -Tenant $sourceTenantID -UseDeviceAuthentication 
371+
372+
# Set the context of the subscription where the new image will be created
373+
Set-AzContext -Subscription $targetSubID 
374+
375+
# Create the image version from another image version in a different tenant
376+
New-AzGalleryImageVersion \
377+
-ResourceGroupName myResourceGroup -GalleryName myGallery \
378+
-GalleryImageDefinitionName myImageDef \
379+
-Location "West US 2" \
380+
-Name 1.0.0 \
381+
-SourceImageId $sourceImageID
382+
```
383+
384+
---
328385

329386
## Next steps
330387

articles/virtual-machines/linux/create-upload-openbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.reviewer: mattmcinnes
1111
---
1212
# Create and Upload an OpenBSD disk image to Azure
1313

14-
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
14+
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
1515

1616
This article shows you how to create and upload a virtual hard disk (VHD) that contains the OpenBSD operating system. After you upload it, you can use it as your own image to create a virtual machine (VM) in Azure through Azure CLI.
1717

articles/virtual-machines/share-gallery-community.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Sharing images to the community is a new capability in [Azure Compute Gallery](.
3333

3434
There are three main ways to share images in an Azure Compute Gallery, depending on who you want to share with:
3535

36-
| Share with\: | Option |
37-
|----|----|
38-
| [Specific people, groups, or service principals](./share-gallery.md) | Role-based access control (RBAC) lets you share resources to specific people, groups, or service principals on a granular level. |
39-
| [Subscriptions or tenants](./share-gallery-direct.md) | Direct shared gallery lets you share to everyone in a subscription or tenant. |
40-
| Everyone (described in this article) | Community gallery lets you share your entire gallery publicly, to all Azure users. |
36+
| Sharing with: | People | Groups | Service Principal | All users in a specific subscription (or) tenant | Publicly with all users in Azure |
37+
|---|---|---|---|---|---|
38+
| [RBAC Sharing](share-gallery.md) | Yes | Yes | Yes | No | No |
39+
| RBAC + [Direct shared gallery](./share-gallery-direct.md) | Yes | Yes | Yes | Yes | No |
40+
| RBAC + [Community gallery](./share-gallery-community.md) | Yes | Yes | Yes | No | Yes |
4141

4242
## Limitations for images shared to the community
4343

@@ -132,7 +132,7 @@ To delete a gallery shared to community, you must first run `az sig share reset`
132132

133133
Create an [image definition and an image version](image-version.md).
134134

135-
Create a VM from a [generalized](vm-generalized-image-version.md#create-a-vm-from-a-community-gallery-image) or [specialized](vm-specialized-image-version.md#create-a-vm-from-a-community-gallery-image) image in a community gallery.
135+
Create a VM from a [generalized](vm-generalized-image-version.md#community-gallery) or [specialized](vm-specialized-image-version.md#community-gallery) image in a community gallery.
136136

137137

138138

articles/virtual-machines/share-gallery-direct.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: virtual-machines
66
ms.subservice: gallery
77
ms.topic: how-to
88
ms.workload: infrastructure
9-
ms.date: 07/25/2022
9+
ms.date: 02/14/2023
1010
ms.author: saraic
1111
ms.reviewer: cynthn
1212
ms.custom: template-how-to , devx-track-azurecli
@@ -29,11 +29,11 @@ This article covers how to share an Azure Compute Gallery with specific subscrip
2929

3030
There are three main ways to share images in an Azure Compute Gallery, depending on who you want to share with:
3131

32-
| Share with\: | Option |
33-
|----|----|
34-
| [Specific people, groups, or service principals](./share-gallery.md) | Role-based access control (RBAC) lets you share resources to specific people, groups, or service principals on a granular level. |
35-
| [Subscriptions or tenants](explained in this article) | Direct shared gallery lets you share to everyone in a subscription or tenant (all users, service principals and managed identities) |
36-
| [Everyone](./share-gallery-community.md) | Community gallery lets you share your entire gallery publicly, to all Azure users. |
32+
| Sharing with: | People | Groups | Service Principal | All users in a specific subscription (or) tenant | Publicly with all users in Azure |
33+
|---|---|---|---|---|---|
34+
| [RBAC Sharing](share-gallery.md) | Yes | Yes | Yes | No | No |
35+
| RBAC + [Direct shared gallery](./share-gallery-direct.md) | Yes | Yes | Yes | Yes | No |
36+
| RBAC + [Community gallery](./share-gallery-community.md) | Yes | Yes | Yes | No | Yes |
3737

3838

3939
## Limitations
@@ -227,4 +227,4 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
227227

228228
## Next steps
229229
- Create an [image definition and an image version](image-version.md).
230-
- Create a VM from a [generalized](vm-generalized-image-version.md#create-a-vm-from-a-gallery-shared-with-your-subscription-or-tenant) or [specialized](vm-specialized-image-version.md#create-a-vm-from-a-gallery-shared-with-your-subscription-or-tenant) image from a direct shared image in the target subscription or tenant.
230+
- Create a VM from a [generalized](vm-generalized-image-version.md#direct-shared-gallery) or [specialized](vm-specialized-image-version.md#direct-shared-gallery) image from a direct shared image in the target subscription or tenant.

articles/virtual-machines/share-gallery.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Share resources in an Azure Compute Gallery
3-
description: Learn how to share resources explicitly or to all Azure users using role-based access control or community galleries.
3+
description: Learn how to share resources explicitly or to all Azure users using role-based access control.
44
author: sandeepraichura
55
ms.service: virtual-machines
66
ms.subservice: gallery
77
ms.topic: how-to
88
ms.workload: infrastructure
9-
ms.date: 02/01/2023
9+
ms.date: 02/14/2023
1010
ms.author: saraic
1111
ms.reviewer: cynthn
1212
ms.custom: template-how-to , devx-track-azurecli
@@ -27,14 +27,15 @@ We recommend sharing at the Gallery level for the best experience. We don't reco
2727

2828
There are three main ways to share images in an Azure Compute Gallery, depending on who you want to share with:
2929

30-
| Share with\: | Option |
31-
|----|----|
32-
| Specific people, groups, or service principals (described in this article) | Role-based access control (RBAC) lets you share resources to specific people, groups, or service principals on a granular level. |
33-
| Share within your organization or even across tenants using an [app registration](share-using-app-registration.md)| Create an app registration use it to share images within your organization or between tenants. |
34-
| [Subscriptions or tenants](./share-gallery-direct.md) | A direct shared gallery lets you share to everyone in a subscription or tenant. |
35-
| [Everyone](./share-gallery-community.md) | Community gallery lets you share your entire gallery publicly, to all Azure users. |
30+
| Sharing with: | People | Groups | Service Principal | All users in a specific subscription (or) tenant | Publicly with all users in Azure |
31+
|---|---|---|---|---|---|
32+
| RBAC Sharing | Yes | Yes | Yes | No | No |
33+
| RBAC + [Direct shared gallery](./share-gallery-direct.md) | Yes | Yes | Yes | Yes | No |
34+
| RBAC + [Community gallery](./share-gallery-community.md) | Yes | Yes | Yes | No | Yes |
3635

3736

37+
You can also create an [App registration](./share-using-app-registration.md) to share images between tenants.
38+
3839
## Share using RBAC
3940

4041
When you share a gallery using RBAC, you need to provide the `imageID` to anyone creating a VM or scale set from the image. There is no way for the person deploying the VM or scale set to list the images that were shared to them using RBAC.
@@ -96,6 +97,6 @@ New-AzRoleAssignment `
9697
## Next steps
9798

9899
- Create an [image definition and an image version](image-version.md).
99-
- Create a VM from a [generalized](vm-generalized-image-version.md#create-a-vm-from-your-gallery) or [specialized](vm-specialized-image-version.md#create-a-vm-from-your-gallery) private gallery.
100+
- Create a VM from a [generalized](vm-generalized-image-version.md) or [specialized](vm-specialized-image-version.md) image in a gallery.
100101

101102

articles/virtual-machines/update-image-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,4 +475,4 @@ az sig image-version list-shared \
475475
## Next steps
476476

477477
- Create an [image definition and an image version](image-version.md).
478-
- Create a VM from a [generalized](vm-generalized-image-version.md#create-a-vm-from-a-community-gallery-image) or [specialized](vm-specialized-image-version.md#create-a-vm-from-a-community-gallery-image) image in a direct shared gallery.
478+
- Create a VM from a [generalized](vm-generalized-image-version.md) or [specialized](vm-specialized-image-version.md) image in an Azure Compute Gallery.

0 commit comments

Comments
 (0)