-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Description of the new feature
GalleryIdentity is already part of the API spec as of 2025-03-03. Here is an example if it being used for CREATE and GET.
Its also part of the SDK
Az.Powershell cmdlets New-AzGallery, Get-AzGallery, Update-AzGallery cannot access or set this property as of now.
GalleryIdentity can be one of System Assigned or User Assigned identities and can be accessed with AZ Powershell. Additionally, GalleryIdentity can also contain a list of User Assigned Managed Identities.
Here are the changes proposed for each cmdlet
- New-AzGallery should include 3 new optional parameters:
a.[-SystemAssignedIdentity <PSObject>]: should accept the output of Get-AzSystemAssignedIdentity
b.[-UserAssignedIdentity <PSObject>]: should accept the output of Get-AzUserAssignedIdentity
c.[-UserAssignedIdentities <PSObject[]>]: should accept a list/collection of User Assigned Identity PSObject(s). - Get-AzGallery output should contain the "identity" field of type GalleryIdentiy as defined in the spec.
- Update-AzGallery needs no change in parameters, but should be able to correctly process -InputObject if it contains the "identity" field of type GalleryIdentiy
- PSObject that is the output of Get-AzGallery should also be able to be directly assigned the output of Get-AzSystemAssignedIdentity, or Get-AzUserAssignedIdentity. for example,
$gallery = Get-AzGallery -ResourceGroupName "myRGName" -Name "myGallery"
$gallery.identity = Get-AzUserAssignedIdentity -ResourceGroupName "myRGName" -Name "myUserAssignedIdentity"
#or
$gallery.identity = Get-AzSystemAssignedIdentity -Scope "/subscriptions/00000000-0000-0000-00000000000/resourcegroups/lucas-rg-test/providers/Microsoft.Web/sites/functionportal01"
it should correctly infer the GalleryIdentity.type when assigned the output of either Get-AzUserAssignedIdentity or Get-AzSystemAssignedIdentity
additionally, the user should also be able to set GalleryIdentity.userAssignedIdentities as a list for example
$uid1 = Get-AzUserAssignedIdentity -ResourceGroupName "myRGName" -Name "id1"
$uid2 = Get-AzUserAssignedIdentity -ResourceGroupName "myRGName" -Name "id2"
$uid3 = Get-AzUserAssignedIdentity -ResourceGroupName "myRGName" -Name "id3"
$gallery = Get-AzGallery -ResourceGroupName "myRGName" -Name "myGallery"
$gallery.identity.userAssignedIdentities = @($uid1, @uid2, @uid3)
Proposed implementation details (optional)
No response