CmdID

CmdID / az / az sig / az sig identity

az sig identity assign

Assign the user or system managed identities. Azure CLI reference

4 examples 3 options Its page in the Azure CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from the Azure CLI, each command read by CmdID

Enable the system assigned identity.

az sig identity assign -g MyResourceGroup -r MyGalleryName --system-assignedIdentify
-gName of resource group.
-rThe name of the Shared Image Gallery.
--system-assignedSet the system managed identity.

Add a user assigned identity.

az sig identity assign -g MyResourceGroup -r MyGalleryName --user-assigned id1Identify
-gName of resource group.
-rThe name of the Shared Image Gallery.
--user-assignedSet the user managed identities.

Add 2 user assigned identities.

az sig identity assign -g MyResourceGroup -r MyGalleryName --user-assigned id1 id2Identify
-gName of resource group.
-rThe name of the Shared Image Gallery.
--user-assignedSet the user managed identities.

Enable system assigned identity and add a user assigned identity.

az sig identity assign -g MyResourceGroup -r MyGalleryName --system-assigned --user-assigned id1Identify
-gName of resource group.
-rThe name of the Shared Image Gallery.
--system-assignedSet the system managed identity.
--user-assignedSet the user managed identities.

Options

3 in the Azure CLI reference
--gallery-name, -rThe name of the Shared Image Gallery.
--mi-system-assigned, --system-assignedSet the system managed identity.
--mi-user-assigned, --user-assignedSet the user managed identities.