Skip to content

Commit 984aab2

Browse files
authored
struc for personal role
1 parent 4094124 commit 984aab2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

terraform-infrastructure/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ resource "null_resource" "cosmosdb_sql_role_assignment" {
328328
# Assign the Cosmos DB role to the user running the deployment
329329
resource "null_resource" "cosmosdb_sql_role_assignment_user" {
330330
provisioner "local-exec" {
331-
command = "for /f %i in ('az cosmosdb sql role assignment list --resource-group ${azurerm_resource_group.rg.name} --account-name ${azurerm_cosmosdb_account.cosmosdb.name} --scope ${azurerm_cosmosdb_account.cosmosdb.id} --query \"length([?principalId=='${data.azurerm_client_config.current.object_id}' && id=='${local.cosmosdb_role_assignment_id}'])\" --output tsv') do if %i==0 az cosmosdb sql role assignment create --resource-group ${azurerm_resource_group.rg.name} --account-name ${azurerm_cosmosdb_account.cosmosdb.name} --role-definition-id /subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.rg.name}/providers/Microsoft.DocumentDB/databaseAccounts/${azurerm_cosmosdb_account.cosmosdb.name}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002 --principal-id ${data.azurerm_client_config.current.object_id} --scope ${azurerm_cosmosdb_account.cosmosdb.id} --role-assignment-id ${local.cosmosdb_role_assignment_id}"
331+
command = "az cosmosdb sql role assignment create --resource-group ${azurerm_resource_group.rg.name} --account-name ${azurerm_cosmosdb_account.cosmosdb.name} --role-definition-id /subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.rg.name}/providers/Microsoft.DocumentDB/databaseAccounts/${azurerm_cosmosdb_account.cosmosdb.name}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002 --principal-id ${data.azurerm_client_config.current.object_id} --scope ${azurerm_cosmosdb_account.cosmosdb.id} --role-assignment-id ${local.cosmosdb_role_assignment_id}"
332332
}
333333

334334
depends_on = [

0 commit comments

Comments
 (0)