-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c42053a
commit c07a8fa
Showing
7 changed files
with
92 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' | ||
param accountName string | ||
|
||
param roleDefinitionId string | ||
param principalId string = '' | ||
|
||
resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { | ||
parent: cosmos | ||
name: guid(roleDefinitionId, principalId, cosmos.id) | ||
properties: { | ||
principalId: principalId | ||
roleDefinitionId: roleDefinitionId | ||
scope: cosmos.id | ||
} | ||
} | ||
|
||
resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { | ||
name: accountName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.' | ||
param accountName string | ||
|
||
resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { | ||
parent: cosmos | ||
name: guid(cosmos.id, accountName, 'sql-role') | ||
properties: { | ||
assignableScopes: [ | ||
cosmos.id | ||
] | ||
permissions: [ | ||
{ | ||
dataActions: [ | ||
'Microsoft.DocumentDB/databaseAccounts/readMetadata' | ||
'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' | ||
'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' | ||
] | ||
notDataActions: [] | ||
} | ||
] | ||
roleName: 'Reader Writer' | ||
type: 'CustomRole' | ||
} | ||
} | ||
|
||
resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { | ||
name: accountName | ||
} | ||
|
||
output id string = roleDefinition.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters