Search code examples
azureazure-resource-managerazure-bicep

How to provided multiple permission in bicep for accesspolicy


This is the bicep format for table access policy

resource symbolicname 'Microsoft.Storage/storageAccounts/tableServices/tables@2023-01-01' = {
  name: 'string'
  parent: resourceSymbolicName
  properties: {
    signedIdentifiers: [
      {
        accessPolicy: {
          expiryTime: 'string'
          permission: 'string'
          startTime: 'string'
        }
        id: 'string'
      }
    ]
  }
}
permission List of abbreviated permissions. Supported permission values include 'r','a','u','d' string (required)

so i need to give permission of read and update. but the expected vaule is string and i am not sure how to provide muliple access permission


Solution

  • There are very few official sample codes about this, I find an community one, it is about fileshares, but has the same pattern for tables

    resource share 'Microsoft.Storage/storageAccounts/fileServices/shares@2022-09-01' = {
      name: 'fileshare'
      parent: fileService
      properties: {
        shareQuota: 100 //This is GB
        enabledProtocols: 'SMB'
        signedIdentifiers: [
          {
            accessPolicy: {
              startTime: '2023-03-17T08:49:37.0000000Z'
              expiryTime: '2028-03-17T08:49:37.0000000Z'
              permission: 'rcl' //read, create, list
            }
            id: 'readcreatelist'
          }
        ]
      }
    }
    
    

    Just change the sample permission 'rcl' to 'raud'

    https://github.com/LinkedInLearning/manage-storage-in-azure-4413556/blob/bfdfa83be5d6b0163167db47e663948c24db96c1/chapter-4/04_06/standard-storage.bicep#L132