ARM Template RoleAssignment not working properly

Xiuyang Bobby Sun 85 Reputation points
2025-04-30T16:21:29.64+00:00

I deployed my Azure Function app using ARM template, everything looks fine, except for one issue, I'm trying to assign roles using the setting below:

{
            "type": "Microsoft.Authorization/roleAssignments",
            "apiVersion": "2022-04-01",
            "name": "[guid(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), 'blob-contributor')]",
            "scope": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('functionAppName'))]",
                "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
            ],
            "properties": {
                "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
                "principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('functionAppName')), '2016-08-01', 'Full').identity.principalId]"
            }
        },
        {
            "type": "Microsoft.Authorization/roleAssignments",
            "apiVersion": "2022-04-01",
            "name": "[guid(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), 'table-data-contributor')]",
            "scope": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('functionAppName'))]",
                "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
            ],
            "properties": {
                "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '17d1049b-9a84-46fb-8f53-869881c3d3ab')]",
                "principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('functionAppName')), '2016-08-01', 'Full').identity.principalId]"
            }
        },
        {
            "type": "Microsoft.Authorization/roleAssignments",
            "apiVersion": "2022-04-01",
            "name": "[guid(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), 'queue-contributor')]",
            "scope": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('functionAppName'))]",
                "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
            ],
            "properties": {
                "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '974c5e8b-45b9-4653-ba55-5f855dd0fb88')]",
                "principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('functionAppName')), '2016-08-01', 'Full').identity.principalId]"
            }
        }

I got three roles set up successfully:

  • Storage Account Contributor
  • Storage Blob Data Contributor
  • Storage Queue Data Contributor

But got one missing:

  • Storage Table Data Contributor

Could anyone give any advice about what's wrong with my settings?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,724 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Xiuyang Bobby Sun 85 Reputation points
    2025-05-02T22:51:58.9833333+00:00

    Hi, I have resolved the issue. The role ID I used, '17d1049b-9a84-46fb-8f53-869881c3d3ab,' is expired or, for some other reason, not used for Storage Table Data Contributor. I have updated to use '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3' as the role ID, and it works fine now. Thanks for looking into the issue.

    0 comments No comments

Your answer

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