bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Support user-assigned managed identity authentication for Deployment Scripts without requiring shared access key

Open guimatheus92 opened this issue 1 year ago • 5 comments

Currently, the Microsoft.Resources/deploymentScripts resource requires Shared Access Key (allowSharedKeyAccess: true) to be enabled on the associated Storage Account.

This is a problem in environments with strict compliance and security standards, where the use of Shared Key authentication is explicitly disabled or discouraged in favor of Azure AD-based access control using Managed Identities. For example, where subscriptions has this built-in policy Storage accounts should prevent shared key access and also suggested at Prevent Shared Key authorization for an Azure Storage account docs.

Problem:

Using deploymentScripts with a User-Assigned Managed Identity still requires Shared Key access to the storage account used by the script for working directories and logs. This creates a security and compliance conflict, as Shared Key access bypasses fine-grained RBAC controls and increases the attack surface.

Request:

Please add native support for Azure AD-based authentication (e.g., using User-Assigned Managed Identity alone) for deployment scripts in Bicep/ARM. This would allow organizations to disable Shared Key access and rely solely on Managed Identity with proper RBAC configuration.

Expected Behavior:

If a user-assigned managed identity is defined and granted appropriate Storage Blob Data Contributor or similar roles on the storage account and container, the script should run without needing Shared Key access enabled.

Workaround:

Currently I have that policy enabled on my subscription, but with exception to that Storage Account that has been used in Deployment Scripts specifically, that way, it won't block my deployment but it's still uncompliant. Part of code in my deployment script:

    storageAccountSettings: {
      storageAccountName: storageAccountDeploymentName
      #disable-next-line use-secure-value-for-secure-inputs
      storageAccountKey: storageAccount.listKeys().keys[0].value
    }

guimatheus92 avatar May 05 '25 13:05 guimatheus92

Related to #16604

jeskew avatar May 12 '25 18:05 jeskew

Any update on the status of this...? We're still blocked on some deploys because of this issue

lluppesms avatar Oct 01 '25 17:10 lluppesms

Hello MSFT, any update here?

grogalus avatar Oct 15 '25 20:10 grogalus

+1

fatimataayeb avatar Apr 11 '26 17:04 fatimataayeb

Thanks for raising this, and for your patience — it was recently picked up as an open issue for the ARM Deployments team to review.

This is the same ask as #16604: removing the hard dependency on storage-account shared-key auth from Microsoft.Resources/deploymentScripts, so it can run under a user-assigned managed identity / Azure AD-based access in environments where policy blocks shared keys. @jeskew already pointed this back to #16604 in May 2025, so I'm formally consolidating there to keep all the impact statements and the ETA in one place.

For context from that thread: @jeskew explained (March 2025) that deployment scripts rely on the storage account for more than just outputs — the script is delivered to the ACI instance via a file share, and it writes a status file so the service knows whether the run succeeded — so this needs groundwork from the ACI and Storage teams first. @SydneyhSmith has been tracking that dependency; the most recent update (June 2026) is that it's targeted for fall 2026, pending a dependency expected to land around September.

Duplicate of #16604

Closing this in favour of #16604, which is actively being tracked — please add your UAMI / RBAC specifics over there so they're weighed in the design. Feel free to reopen this or ping me if you think your scenario isn't fully covered.

torreymicrosoft avatar Jun 11 '26 22:06 torreymicrosoft