Skip to content

Instantly share code, notes, and snippets.

@cdennig
Created October 3, 2021 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdennig/204ac9e473d2f77f10699651ee1f7f0a to your computer and use it in GitHub Desktop.
Save cdennig/204ac9e473d2f77f10699651ee1f7f0a to your computer and use it in GitHub Desktop.
roleassign.bicep
var roleAssignId = guid(roleDefId, principalId, cosmosDbAccount.id)
resource roleAssignment 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2021-06-15' = {
name: '${cosmosDbAccount.name}/${roleAssignId}'
properties: {
roleDefinitionId: roleDefinition.id
principalId: principalId
scope: cosmosDbAccount.id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment