Search code examples
azureazure-web-app-service

Using Az.Websites module to set up user assigned managed identity to pull image from ACR


I am trying to configure my app service to use user assigned managed identity to pull image from ACR. I figured how to do it by using az cli tool.

az resource update --ids /subscriptions/<subscription-id>/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/<app-name>/config/web --set properties.acrUseManagedIdentityCreds=True

az resource update --ids /subscriptions/<subscription-id>/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/<app-name>/config/web --set properties.AcrUserManagedIdentityID=$clientId

For certain resons I cannot utilize az cli in my release pipelines. My question is if it would be possible to achieve the same by using Az.Websites, looks like Set-AzWebApp doesn't support this option.


Solution

  • As mentioned in the docs, the current version of the Azure PowerShell cmdlets for Azure App Service do not support user-assigned identities.

    You could instead try setting those properties with the Set-AzResource cmdlet.