Share via

Azure Key Vault data-plane RBAC does not recognize valid role assignment for App Service managed identity in Azure Managed Application managed resource group

Bruno Costa 0 Reputation points
2026-05-08T10:44:00.3133333+00:00

We have an Azure Marketplace Managed Application deployed into a customer subscription. One of the deployed App Services uses a system-assigned managed identity to resolve App Service Key Vault references from an Azure Key Vault in the same managed resource group.

The App Service Key Vault references are failing with:

Status: AccessToKeyVaultDenied Details: Key Vault reference was not able to be resolved because site was denied access to Key Vault reference's vault.

The Key Vault is configured with Azure RBAC authorization enabled:

{
  "enableRbacAuthorization": true,
  "publicNetworkAccess": "Enabled"
}

The App Service managed identity has the Key Vault Secrets User and Key Vault Secrets Officer roles assignments at the Key Vault scope.

Despite this, Key Vault audit logs show the SecretGet request from the same managed identity is denied because no assignment is found:

`OperationName: SecretGet ResultSignature: Forbidden httpStatusCode_d: 403 isRbacAuthorized_b: false

ResultDescription: Caller is not authorized to perform action on resource. If role assignments, deny assignments or role definitions were changed recently, please observe propagation time.

Action: Microsoft.KeyVault/vaults/secrets/getSecret/action

Assignment: (not found) DenyAssignmentId: null DecisionReason: null `

Troubleshooting already performed:

  1. Confirmed the App Service Key Vault reference uses SystemAssigned identity.
  2. Confirmed the managed identity object ID in the Key Vault audit log matches the current App Service system-assigned identity.
  3. Confirmed Key Vault Secrets User exists at the Key Vault scope for that exact principal.
  4. Added Key Vault Secrets Officer at the Key Vault scope for the same principal as an additional test.
  5. Refreshed App Service Key Vault references using: az rest --method post \ --url "https://management.azure.com${APP_ID}/config/configreferences/appsettings/refresh?api-version=2022-03-01"
  6. Updated App Service app settings to trigger refresh.
  7. Restarted the App Service.
  8. Removed and recreated the App Service system-assigned managed identity, which generated a new principal ID.
  9. Recreated the Key Vault RBAC assignments for the new managed identity.
  10. Confirmed Key Vault audit logs now show the new managed identity, but the same RBAC failure remains.
  11. Confirmed the Key Vault request reaches Key Vault, so this does not appear to be a networking or private endpoint issue.
  12. Confirmed the Key Vault audit log shows DenyAssignmentId: null.

Managed Application deny assignment context:

The managed resource group has a system deny assignment created by the Managed Application:

Deny assignment: bb27aa59-83d0-47af-ad83-c558aceb30ea Scope: /subscriptions/xxxxxxxxxxxxxxxxxxxxx/resourceGroups/mrg-name

Condition:

@Subject[ResourceId] StringNotStartsWithIgnoreCase '/subscriptions/xxxxxxxxxxxxxxxxxxxxx/resourceGroups/mrg-name' && @Subject[tid] StringNotEqualsAnyOfIgnoreCase {'xxxxxxxxxxxxxxxxxxxxxxxx'}

The caller resource ID from the Key Vault log is:

/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxx/resourcegroups/mrg-name/providers/Microsoft.Web/sites/app-name

This appears to start with the managed resource group path, so the first part of the deny assignment condition should evaluate to false. Therefore the deny assignment should not apply to this App Service managed identity. The Key Vault audit log also reports:

DenyAssignmentId: null

The deny assignment has:

"dataActions": ["*"],
"notDataActions": [
  "*/read",
  "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/add/action",
  "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
  "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write",
  "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete"
]

However, because the caller is a resource inside the managed resource group, our understanding is that the deny assignment condition should exempt this caller.

We would like to understand why Key Vault data-plane RBAC is not recognizing the valid role assignment for this App Service managed identity in the context of an Azure Managed Application managed resource group.

Azure Key Vault
Azure Key Vault

An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.