|
5 | 5 | "_generator": { |
6 | 6 | "name": "bicep", |
7 | 7 | "version": "0.43.8.12551", |
8 | | - "templateHash": "2315337546245675369" |
| 8 | + "templateHash": "8972167897125395354" |
9 | 9 | } |
10 | 10 | }, |
11 | 11 | "parameters": { |
|
2571 | 2571 | "backendAppServicePrincipalId": { |
2572 | 2572 | "value": "[reference(resourceId('Microsoft.Resources/deployments', take(format('module.ca-backend-api.{0}', parameters('solutionName')), 64)), '2025-04-01').outputs.principalId.value]" |
2573 | 2573 | }, |
| 2574 | + "processorAppServicePrincipalId": { |
| 2575 | + "value": "[reference(resourceId('Microsoft.Resources/deployments', take(format('module.ca-processor.{0}', parameters('solutionName')), 64)), '2025-04-01').outputs.principalId.value]" |
| 2576 | + }, |
2574 | 2577 | "cosmosDbAccountName": { |
2575 | 2578 | "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', take(format('module.cosmos-db.{0}', parameters('solutionName')), 64)), '2025-04-01').outputs.name.value]" |
2576 | 2579 | } |
|
2582 | 2585 | "_generator": { |
2583 | 2586 | "name": "bicep", |
2584 | 2587 | "version": "0.43.8.12551", |
2585 | | - "templateHash": "17859174180959627964" |
| 2588 | + "templateHash": "14585030683408144049" |
2586 | 2589 | } |
2587 | 2590 | }, |
2588 | 2591 | "parameters": { |
|
2628 | 2631 | "description": "Principal ID of the backend App Service system-assigned identity (empty if not deployed)." |
2629 | 2632 | } |
2630 | 2633 | }, |
| 2634 | + "processorAppServicePrincipalId": { |
| 2635 | + "type": "string", |
| 2636 | + "defaultValue": "", |
| 2637 | + "metadata": { |
| 2638 | + "description": "Principal ID of the processor App Service system-assigned identity (empty if not deployed)." |
| 2639 | + } |
| 2640 | + }, |
2631 | 2641 | "deployerPrincipalId": { |
2632 | 2642 | "type": "string", |
2633 | 2643 | "defaultValue": "", |
|
2799 | 2809 | "principalType": "ServicePrincipal" |
2800 | 2810 | } |
2801 | 2811 | }, |
| 2812 | + { |
| 2813 | + "condition": "[and(not(empty(parameters('storageAccountResourceId'))), not(empty(parameters('processorAppServicePrincipalId'))))]", |
| 2814 | + "type": "Microsoft.Authorization/roleAssignments", |
| 2815 | + "apiVersion": "2022-04-01", |
| 2816 | + "scope": "[resourceId('Microsoft.Storage/storageAccounts', last(split(parameters('storageAccountResourceId'), '/')))]", |
| 2817 | + "name": "[guid(parameters('solutionName'), resourceId('Microsoft.Storage/storageAccounts', last(split(parameters('storageAccountResourceId'), '/'))), parameters('processorAppServicePrincipalId'), variables('roleDefinitions').storageBlobDataContributor)]", |
| 2818 | + "properties": { |
| 2819 | + "principalId": "[parameters('processorAppServicePrincipalId')]", |
| 2820 | + "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', variables('roleDefinitions').storageBlobDataContributor)]", |
| 2821 | + "principalType": "ServicePrincipal" |
| 2822 | + } |
| 2823 | + }, |
2802 | 2824 | { |
2803 | 2825 | "condition": "[and(not(empty(parameters('cosmosDbAccountName'))), not(empty(parameters('backendAppServicePrincipalId'))))]", |
2804 | 2826 | "type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", |
|
2810 | 2832 | "scope": "[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbAccountName'))]" |
2811 | 2833 | } |
2812 | 2834 | }, |
| 2835 | + { |
| 2836 | + "condition": "[and(not(empty(parameters('cosmosDbAccountName'))), not(empty(parameters('processorAppServicePrincipalId'))))]", |
| 2837 | + "type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", |
| 2838 | + "apiVersion": "2025-10-15", |
| 2839 | + "name": "[format('{0}/{1}', parameters('cosmosDbAccountName'), guid(parameters('solutionName'), resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', parameters('cosmosDbAccountName'), '00000000-0000-0000-0000-000000000002'), resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbAccountName')), parameters('processorAppServicePrincipalId')))]", |
| 2840 | + "properties": { |
| 2841 | + "principalId": "[parameters('processorAppServicePrincipalId')]", |
| 2842 | + "roleDefinitionId": "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', parameters('cosmosDbAccountName'), '00000000-0000-0000-0000-000000000002')]", |
| 2843 | + "scope": "[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbAccountName'))]" |
| 2844 | + } |
| 2845 | + }, |
2813 | 2846 | { |
2814 | 2847 | "condition": "[and(and(not(parameters('useExistingAIProject')), not(empty(parameters('deployerPrincipalId')))), not(empty(parameters('aiFoundryResourceId'))))]", |
2815 | 2848 | "type": "Microsoft.Authorization/roleAssignments", |
|
3054 | 3087 | "dependsOn": [ |
3055 | 3088 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', take(format('module.ai-foundry-project.{0}', parameters('solutionName')), 64))]", |
3056 | 3089 | "[resourceId('Microsoft.Resources/deployments', take(format('module.ca-backend-api.{0}', parameters('solutionName')), 64))]", |
| 3090 | + "[resourceId('Microsoft.Resources/deployments', take(format('module.ca-processor.{0}', parameters('solutionName')), 64))]", |
3057 | 3091 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', take(format('module.cosmos-db.{0}', parameters('solutionName')), 64))]", |
3058 | 3092 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('aiServiceSubscription'), variables('aiServiceResourceGroup')), 'Microsoft.Resources/deployments', take(format('module.existing-project-setup.{0}', parameters('solutionName')), 64))]", |
3059 | 3093 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', take(format('module.storage-account.{0}', parameters('solutionName')), 64))]" |
|
0 commit comments