diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8edfe8954..c6da84c2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: env: AZURE_ENV_NAME: ${{ github.run_id }} AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }} with: imageName: ghcr.io/roopan-microsoft/psl-cwyd-main cacheFrom: ghcr.io/roopan-microsoft/psl-cwyd-main @@ -52,7 +51,6 @@ jobs: AZURE_SUBSCRIPTION_ID AZURE_ENV_NAME AZURE_LOCATION - AZURE_RESOURCE_GROUP - name: Tidy up uses: devcontainers/ci@v0.3 @@ -60,7 +58,6 @@ jobs: env: AZURE_ENV_NAME: ${{ github.run_id }} AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }} with: push: never imageName: ghcr.io/roopan-microsoft/psl-cwyd-main @@ -72,7 +69,6 @@ jobs: AZURE_SUBSCRIPTION_ID AZURE_ENV_NAME AZURE_LOCATION - AZURE_RESOURCE_GROUP - name: Send Notification on Failure if: failure() diff --git a/Makefile b/Makefile index 6d816c65a..24c047929 100644 --- a/Makefile +++ b/Makefile @@ -57,14 +57,10 @@ azd-login: ## 🔑 Login to Azure with azd and a SPN @echo -e "\e[34m$@\e[0m" || true @azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID} -az-login: ## 🔑 Login to Azure with az and a SPN - az login --service-principal -u ${AZURE_CLIENT_ID} -p ${AZURE_CLIENT_SECRET} --tenant ${AZURE_TENANT_ID} - -deploy: azd-login az-login ## 🚀 Deploy everything to Azure +deploy: azd-login ## 🚀 Deploy everything to Azure @echo -e "\e[34m$@\e[0m" || true @azd env new ${AZURE_ENV_NAME} @azd env set AZURE_APP_SERVICE_HOSTING_MODEL code --no-prompt - @az group create --name ${AZURE_RESOURCE_GROUP} --location ${AZURE_LOCATION} @azd provision --no-prompt @azd deploy web --no-prompt @azd deploy function --no-prompt diff --git a/infra/main.bicep b/infra/main.bicep index b92a9aa7b..9056656a0 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -1,4 +1,14 @@ -param resourceToken string = toLower(uniqueString(subscription().id, resourceGroup().name, resourceGroup().location)) +targetScope = 'subscription' + +@minLength(1) +@maxLength(20) +@description('Name of the the environment which is used to generate a short unique hash used in all resources.') +param environmentName string + +param resourceToken string = toLower(uniqueString(subscription().id, environmentName, location)) + +@description('Location for all resources.') +param location string @description('Name of App Service plan') param hostingPlanName string = 'hosting-plan-${resourceToken}' @@ -305,9 +315,8 @@ var blobContainerName = 'documents' var queueName = 'doc-processing' var clientKey = '${uniqueString(guid(subscription().id, deployment().name))}${newGuidString}' var eventGridSystemTopicName = 'doc-processing' -var resourceGroupName = resourceGroup().name -var tags = { 'azd-env-name': resourceGroupName } -var location = resourceGroup().location +var tags = { 'azd-env-name': environmentName } +var rgName = 'rg-${environmentName}' var keyVaultName = 'kv-${resourceToken}' var azureOpenAIModelInfo = string({ model: azureOpenAIModel @@ -320,19 +329,26 @@ var azureOpenAIEmbeddingModelInfo = string({ modelVersion: azureOpenAIEmbeddingModelVersion }) +// Organize resources in a resource group +resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: rgName + location: location + tags: tags +} + module cosmosDBModule './core/database/cosmosdb.bicep' = { name: 'deploy_cosmos_db' params: { name: azureCosmosDBAccountName location: location } - scope: resourceGroup() + scope: rg } // Store secrets in a keyvault module keyvault './core/security/keyvault.bicep' = if (useKeyVault || authType == 'rbac') { name: 'keyvault' - scope: resourceGroup() + scope: rg params: { name: keyVaultName location: location @@ -390,7 +406,7 @@ var openAiDeployments = concat( module openai 'core/ai/cognitiveservices.bicep' = { name: azureOpenAIResourceName - scope: resourceGroup() + scope: rg params: { name: azureOpenAIResourceName location: location @@ -405,7 +421,7 @@ module openai 'core/ai/cognitiveservices.bicep' = { module computerVision 'core/ai/cognitiveservices.bicep' = if (useAdvancedImageProcessing) { name: 'computerVision' - scope: resourceGroup() + scope: rg params: { name: computerVisionName kind: 'ComputerVision' @@ -419,7 +435,7 @@ module computerVision 'core/ai/cognitiveservices.bicep' = if (useAdvancedImagePr // Search Index Data Reader module searchIndexRoleOpenai 'core/security/role.bicep' = if (authType == 'rbac') { - scope: resourceGroup() + scope: rg name: 'search-index-role-openai' params: { principalId: openai.outputs.identityPrincipalId @@ -430,7 +446,7 @@ module searchIndexRoleOpenai 'core/security/role.bicep' = if (authType == 'rbac' // Search Service Contributor module searchServiceRoleOpenai 'core/security/role.bicep' = if (authType == 'rbac') { - scope: resourceGroup() + scope: rg name: 'search-service-role-openai' params: { principalId: openai.outputs.identityPrincipalId @@ -441,7 +457,7 @@ module searchServiceRoleOpenai 'core/security/role.bicep' = if (authType == 'rba // Storage Blob Data Reader module blobDataReaderRoleSearch 'core/security/role.bicep' = if (authType == 'rbac') { - scope: resourceGroup() + scope: rg name: 'blob-data-reader-role-search' params: { principalId: search.outputs.identityPrincipalId @@ -452,7 +468,7 @@ module blobDataReaderRoleSearch 'core/security/role.bicep' = if (authType == 'rb // Cognitive Services OpenAI User module openAiRoleSearchService 'core/security/role.bicep' = if (authType == 'rbac') { - scope: resourceGroup() + scope: rg name: 'openai-role-searchservice' params: { principalId: search.outputs.identityPrincipalId @@ -462,7 +478,7 @@ module openAiRoleSearchService 'core/security/role.bicep' = if (authType == 'rba } module speechService 'core/ai/cognitiveservices.bicep' = { - scope: resourceGroup() + scope: rg name: speechServiceName params: { name: speechServiceName @@ -476,7 +492,7 @@ module speechService 'core/ai/cognitiveservices.bicep' = { module storekeys './app/storekeys.bicep' = if (useKeyVault) { name: 'storekeys' - scope: resourceGroup() + scope: rg params: { keyVaultName: keyVaultName azureOpenAIName: openai.outputs.name @@ -487,13 +503,13 @@ module storekeys './app/storekeys.bicep' = if (useKeyVault) { speechServiceName: speechServiceName computerVisionName: useAdvancedImageProcessing ? computerVision.outputs.name : '' cosmosAccountName: cosmosDBModule.outputs.cosmosOutput.cosmosAccountName - rgName: resourceGroupName + rgName: rgName } } module search './core/search/search-services.bicep' = { name: azureAISearchName - scope: resourceGroup() + scope: rg params: { name: azureAISearchName location: location @@ -514,7 +530,7 @@ module search './core/search/search-services.bicep' = { module hostingplan './core/host/appserviceplan.bicep' = { name: hostingPlanName - scope: resourceGroup() + scope: rg params: { name: hostingPlanName location: location @@ -535,7 +551,7 @@ var azureCosmosDBInfo = string({ module web './app/web.bicep' = if (hostingModel == 'code') { name: websiteName - scope: resourceGroup() + scope: rg params: { name: websiteName location: location @@ -618,7 +634,7 @@ module web './app/web.bicep' = if (hostingModel == 'code') { module web_docker './app/web.bicep' = if (hostingModel == 'container') { name: '${websiteName}-docker' - scope: resourceGroup() + scope: rg params: { name: '${websiteName}-docker' location: location @@ -700,7 +716,7 @@ module web_docker './app/web.bicep' = if (hostingModel == 'container') { module adminweb './app/adminweb.bicep' = if (hostingModel == 'code') { name: adminWebsiteName - scope: resourceGroup() + scope: rg params: { name: adminWebsiteName location: location @@ -778,7 +794,7 @@ module adminweb './app/adminweb.bicep' = if (hostingModel == 'code') { module adminweb_docker './app/adminweb.bicep' = if (hostingModel == 'container') { name: '${adminWebsiteName}-docker' - scope: resourceGroup() + scope: rg params: { name: '${adminWebsiteName}-docker' location: location @@ -855,7 +871,7 @@ module adminweb_docker './app/adminweb.bicep' = if (hostingModel == 'container') module monitoring './core/monitor/monitoring.bicep' = { name: 'monitoring' - scope: resourceGroup() + scope: rg params: { applicationInsightsName: applicationInsightsName location: location @@ -869,7 +885,7 @@ module monitoring './core/monitor/monitoring.bicep' = { module workbook './app/workbook.bicep' = { name: 'workbook' - scope: resourceGroup() + scope: rg params: { workbookDisplayName: workbookDisplayName location: location @@ -889,7 +905,7 @@ module workbook './app/workbook.bicep' = { module function './app/function.bicep' = if (hostingModel == 'code') { name: functionName - scope: resourceGroup() + scope: rg params: { name: functionName location: location @@ -953,7 +969,7 @@ module function './app/function.bicep' = if (hostingModel == 'code') { module function_docker './app/function.bicep' = if (hostingModel == 'container') { name: '${functionName}-docker' - scope: resourceGroup() + scope: rg params: { name: '${functionName}-docker' location: location @@ -1016,7 +1032,7 @@ module function_docker './app/function.bicep' = if (hostingModel == 'container') module formrecognizer 'core/ai/cognitiveservices.bicep' = { name: formRecognizerName - scope: resourceGroup() + scope: rg params: { name: formRecognizerName location: location @@ -1027,7 +1043,7 @@ module formrecognizer 'core/ai/cognitiveservices.bicep' = { module contentsafety 'core/ai/cognitiveservices.bicep' = { name: contentSafetyName - scope: resourceGroup() + scope: rg params: { name: contentSafetyName location: location @@ -1038,7 +1054,7 @@ module contentsafety 'core/ai/cognitiveservices.bicep' = { module eventgrid 'app/eventgrid.bicep' = { name: eventGridSystemTopicName - scope: resourceGroup() + scope: rg params: { name: eventGridSystemTopicName location: location @@ -1050,7 +1066,7 @@ module eventgrid 'app/eventgrid.bicep' = { module storage 'core/storage/storage-account.bicep' = { name: storageAccountName - scope: resourceGroup() + scope: rg params: { name: storageAccountName location: location @@ -1088,7 +1104,7 @@ module storage 'core/storage/storage-account.bicep' = { // USER ROLES // Storage Blob Data Contributor module storageRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && principalId != '') { - scope: resourceGroup() + scope: rg name: 'storage-role-user' params: { principalId: principalId @@ -1099,7 +1115,7 @@ module storageRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && pr // Cognitive Services User module openaiRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && principalId != '') { - scope: resourceGroup() + scope: rg name: 'openai-role-user' params: { principalId: principalId @@ -1110,7 +1126,7 @@ module openaiRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && pri // Contributor module openaiRoleUserContributor 'core/security/role.bicep' = if (authType == 'rbac' && principalId != '') { - scope: resourceGroup() + scope: rg name: 'openai-role-user-contributor' params: { principalId: principalId @@ -1121,7 +1137,7 @@ module openaiRoleUserContributor 'core/security/role.bicep' = if (authType == 'r // Search Index Data Contributor module searchRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && principalId != '') { - scope: resourceGroup() + scope: rg name: 'search-role-user' params: { principalId: principalId @@ -1131,7 +1147,7 @@ module searchRoleUser 'core/security/role.bicep' = if (authType == 'rbac' && pri } module machineLearning 'app/machinelearning.bicep' = if (orchestrationStrategy == 'prompt_flow') { - scope: resourceGroup() + scope: rg name: azureMachineLearningName params: { location: location @@ -1174,7 +1190,7 @@ output AZURE_OPENAI_API_VERSION string = azureOpenAIApiVersion output AZURE_OPENAI_RESOURCE string = azureOpenAIResourceName output AZURE_OPENAI_EMBEDDING_MODEL_INFO string = azureOpenAIEmbeddingModelInfo output AZURE_OPENAI_API_KEY string = useKeyVault ? storekeys.outputs.OPENAI_KEY_NAME : '' -output AZURE_RESOURCE_GROUP string = resourceGroupName +output AZURE_RESOURCE_GROUP string = rgName output AZURE_SEARCH_KEY string = useKeyVault ? storekeys.outputs.SEARCH_KEY_NAME : '' output AZURE_SEARCH_SERVICE string = search.outputs.endpoint output AZURE_SEARCH_USE_SEMANTIC_SEARCH bool = azureSearchUseSemanticSearch diff --git a/infra/main.bicepparam b/infra/main.bicepparam index ce0418abb..860a4520e 100644 --- a/infra/main.bicepparam +++ b/infra/main.bicepparam @@ -1,6 +1,7 @@ using './main.bicep' -var location = readEnvironmentVariable('AZURE_LOCATION', 'location') +param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'env_name') +param location = readEnvironmentVariable('AZURE_LOCATION', 'location') param principalId = readEnvironmentVariable('AZURE_PRINCIPAL_ID', 'principal_id') @@ -67,8 +68,7 @@ param computerVisionVectorizeImageModelVersion = readEnvironmentVariable('AZURE_ // We need the resourceToken to be unique for each deployment (copied from the main.bicep) var subscriptionId = readEnvironmentVariable('AZURE_SUBSCRIPTION_ID', 'subscription_id') -var resourceGroupName = readEnvironmentVariable('AZURE_RESOURCE_GROUP', 'azure_resource_group') -param resourceToken = toLower(uniqueString(subscriptionId, resourceGroupName, location)) +param resourceToken = toLower(uniqueString(subscriptionId, environmentName, location)) // Retrieve the Search Name from the Search Endpoint which will be in the format diff --git a/infra/main.json b/infra/main.json index d260c7826..e922d2c26 100644 --- a/infra/main.json +++ b/infra/main.json @@ -1,17 +1,31 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16957586838741004318" + "version": "0.27.1.19265", + "templateHash": "12333512568102107027" } }, "parameters": { + "environmentName": { + "type": "string", + "minLength": 1, + "maxLength": 20, + "metadata": { + "description": "Name of the the environment which is used to generate a short unique hash used in all resources." + } + }, "resourceToken": { "type": "string", - "defaultValue": "[toLower(uniqueString(subscription().id, resourceGroup().name, resourceGroup().location))]" + "defaultValue": "[toLower(uniqueString(subscription().id, parameters('environmentName'), parameters('location')))]" + }, + "location": { + "type": "string", + "metadata": { + "description": "Location for all resources." + } }, "hostingPlanName": { "type": "string", @@ -622,11 +636,10 @@ "queueName": "doc-processing", "clientKey": "[format('{0}{1}', uniqueString(guid(subscription().id, deployment().name)), parameters('newGuidString'))]", "eventGridSystemTopicName": "doc-processing", - "resourceGroupName": "[resourceGroup().name]", "tags": { - "azd-env-name": "[variables('resourceGroupName')]" + "azd-env-name": "[parameters('environmentName')]" }, - "location": "[resourceGroup().location]", + "rgName": "[format('rg-{0}', parameters('environmentName'))]", "keyVaultName": "[format('kv-{0}', parameters('resourceToken'))]", "azureOpenAIModelInfo": "[string(createObject('model', parameters('azureOpenAIModel'), 'modelName', parameters('azureOpenAIModelName'), 'modelVersion', parameters('azureOpenAIModelVersion')))]", "azureOpenAIEmbeddingModelInfo": "[string(createObject('model', parameters('azureOpenAIEmbeddingModel'), 'modelName', parameters('azureOpenAIEmbeddingModelName'), 'modelVersion', parameters('azureOpenAIEmbeddingModelVersion')))]", @@ -659,10 +672,18 @@ "openAiDeployments": "[concat(variables('defaultOpenAiDeployments'), if(parameters('useAdvancedImageProcessing'), createArray(createObject('name', parameters('azureOpenAIVisionModel'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIVisionModelName'), 'version', parameters('azureOpenAIVisionModelVersion')), 'sku', createObject('name', 'Standard', 'capacity', parameters('azureOpenAIVisionModelCapacity')))), createArray()))]" }, "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2021-04-01", + "name": "[variables('rgName')]", + "location": "[parameters('location')]", + "tags": "[variables('tags')]" + }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "deploy_cosmos_db", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -673,7 +694,7 @@ "value": "[parameters('azureCosmosDBAccountName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" } }, "template": { @@ -682,8 +703,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14453122839528928942" + "version": "0.27.1.19265", + "templateHash": "4859822953916033283" } }, "parameters": { @@ -815,13 +836,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac'))]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "keyvault", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -832,7 +857,7 @@ "value": "[variables('keyVaultName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[variables('tags')]" @@ -847,8 +872,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "12121357715793816510" + "version": "0.27.1.19265", + "templateHash": "10946574055690902625" }, "description": "Creates an Azure Key Vault." }, @@ -901,12 +926,16 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('azureOpenAIResourceName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -917,7 +946,7 @@ "value": "[parameters('azureOpenAIResourceName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[variables('tags')]" @@ -940,8 +969,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13123022401063321803" + "version": "0.27.1.19265", + "templateHash": "10621100095067903006" }, "description": "Creates an Azure Cognitive Services instance." }, @@ -1060,13 +1089,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[parameters('useAdvancedImageProcessing')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "computerVision", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1079,7 +1112,7 @@ "kind": { "value": "ComputerVision" }, - "location": "[if(not(equals(parameters('computerVisionLocation'), '')), createObject('value', parameters('computerVisionLocation')), createObject('value', variables('location')))]", + "location": "[if(not(equals(parameters('computerVisionLocation'), '')), createObject('value', parameters('computerVisionLocation')), createObject('value', parameters('location')))]", "tags": { "value": "[variables('tags')]" }, @@ -1095,8 +1128,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13123022401063321803" + "version": "0.27.1.19265", + "templateHash": "10621100095067903006" }, "description": "Creates an Azure Cognitive Services instance." }, @@ -1215,13 +1248,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[equals(parameters('authType'), 'rbac')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "search-index-role-openai", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1229,7 +1266,7 @@ "mode": "Incremental", "parameters": { "principalId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.identityPrincipalId.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.identityPrincipalId.value]" }, "roleDefinitionId": { "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" @@ -1244,8 +1281,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -1283,7 +1320,8 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" ] }, { @@ -1291,6 +1329,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "search-service-role-openai", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1298,7 +1337,7 @@ "mode": "Incremental", "parameters": { "principalId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.identityPrincipalId.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.identityPrincipalId.value]" }, "roleDefinitionId": { "value": "7ca78c08-252a-4471-8644-bb5ff32d4ba0" @@ -1313,8 +1352,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -1352,7 +1391,8 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" ] }, { @@ -1360,6 +1400,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "blob-data-reader-role-search", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1367,7 +1408,7 @@ "mode": "Incremental", "parameters": { "principalId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.identityPrincipalId.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.identityPrincipalId.value]" }, "roleDefinitionId": { "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" @@ -1382,8 +1423,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -1421,7 +1462,8 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]" + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]" ] }, { @@ -1429,6 +1471,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "openai-role-searchservice", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1436,7 +1479,7 @@ "mode": "Incremental", "parameters": { "principalId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.identityPrincipalId.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.identityPrincipalId.value]" }, "roleDefinitionId": { "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" @@ -1451,8 +1494,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -1490,13 +1533,15 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]" + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]" ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('speechServiceName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1507,7 +1552,7 @@ "value": "[parameters('speechServiceName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "sku": { "value": { @@ -1524,8 +1569,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13123022401063321803" + "version": "0.27.1.19265", + "templateHash": "10621100095067903006" }, "description": "Creates an Azure Cognitive Services instance." }, @@ -1644,13 +1689,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[parameters('useKeyVault')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "storekeys", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1661,29 +1710,29 @@ "value": "[variables('keyVaultName')]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { "value": "[parameters('speechServiceName')]" }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "cosmosAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName]" }, "rgName": { - "value": "[variables('resourceGroupName')]" + "value": "[variables('rgName')]" } }, "template": { @@ -1692,8 +1741,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "15528430944298201007" + "version": "0.27.1.19265", + "templateHash": "14579716731765543192" } }, "parameters": { @@ -1874,19 +1923,21 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db')]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]" ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('azureAISearchName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1897,7 +1948,7 @@ "value": "[parameters('azureAISearchName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": { @@ -1924,8 +1975,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13584246975784398226" + "version": "0.27.1.19265", + "templateHash": "109530586617035708" }, "description": "Creates an Azure AI Search instance." }, @@ -2050,12 +2101,16 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('hostingPlanName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -2066,7 +2121,7 @@ "value": "[parameters('hostingPlanName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "sku": { "value": { @@ -2089,8 +2144,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "9286637480882627742" + "version": "0.27.1.19265", + "templateHash": "3882056790487836425" }, "description": "Creates an Azure App Service plan." }, @@ -2143,13 +2198,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[equals(parameters('hostingModel'), 'code')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('websiteName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -2160,7 +2219,7 @@ "value": "[parameters('websiteName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'web'))]" @@ -2172,45 +2231,45 @@ "value": "3.11" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "healthCheckPath": { "value": "/api/health" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" - }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", - "cosmosDBKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COSMOS_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + }, + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "cosmosDBKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COSMOS_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -2218,11 +2277,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_TEMPERATURE": "[parameters('azureOpenAITemperature')]", @@ -2254,14 +2313,14 @@ "AZURE_SEARCH_URL_COLUMN": "[parameters('azureSearchUrlColumn')]", "AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION": "[parameters('azureSearchUseIntegratedVectorization')]", "AZURE_SPEECH_SERVICE_NAME": "[parameters('speechServiceName')]", - "AZURE_SPEECH_SERVICE_REGION": "[variables('location')]", + "AZURE_SPEECH_SERVICE_REGION": "[parameters('location')]", "AZURE_SPEECH_RECOGNIZER_LANGUAGES": "[parameters('recognizedLanguages')]", "USE_ADVANCED_IMAGE_PROCESSING": "[parameters('useAdvancedImageProcessing')]", "ADVANCED_IMAGE_PROCESSING_MAX_IMAGES": "[parameters('advancedImageProcessingMaxImages')]", "ORCHESTRATION_STRATEGY": "[parameters('orchestrationStrategy')]", "CONVERSATION_FLOW": "[parameters('conversationFlow')]", "LOGLEVEL": "[parameters('logLevel')]", - "AZURE_COSMOSDB_INFO": "[string(createObject('accountName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]", + "AZURE_COSMOSDB_INFO": "[string(createObject('accountName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]", "AZURE_COSMOSDB_ENABLE_FEEDBACK": true, "CHAT_HISTORY_ENABLED": "[parameters('chatHistoryEnabled')]" } @@ -2273,8 +2332,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "2593132916851063512" + "version": "0.27.1.19265", + "templateHash": "4871228348238542266" } }, "parameters": { @@ -2455,8 +2514,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -2682,8 +2741,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -2760,8 +2819,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -2829,8 +2888,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -2898,8 +2957,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -2967,8 +3026,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -3033,8 +3092,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -3107,8 +3166,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "2622922268469466870" + "version": "0.27.1.19265", + "templateHash": "12223899351427459655" }, "description": "Creates a SQL role assignment under an Azure Cosmos DB account." }, @@ -3160,18 +3219,19 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db')]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { @@ -3179,6 +3239,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[format('{0}-docker', parameters('websiteName'))]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -3189,7 +3250,7 @@ "value": "[format('{0}-docker', parameters('websiteName'))]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'web-docker'))]" @@ -3198,45 +3259,45 @@ "value": "fruoccopublic.azurecr.io/rag-webapp" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "healthCheckPath": { "value": "/api/health" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" - }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", - "cosmosDBKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COSMOS_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + }, + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "cosmosDBKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COSMOS_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -3244,11 +3305,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_TEMPERATURE": "[parameters('azureOpenAITemperature')]", @@ -3280,14 +3341,14 @@ "AZURE_SEARCH_URL_COLUMN": "[parameters('azureSearchUrlColumn')]", "AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION": "[parameters('azureSearchUseIntegratedVectorization')]", "AZURE_SPEECH_SERVICE_NAME": "[parameters('speechServiceName')]", - "AZURE_SPEECH_SERVICE_REGION": "[variables('location')]", + "AZURE_SPEECH_SERVICE_REGION": "[parameters('location')]", "AZURE_SPEECH_RECOGNIZER_LANGUAGES": "[parameters('recognizedLanguages')]", "USE_ADVANCED_IMAGE_PROCESSING": "[parameters('useAdvancedImageProcessing')]", "ADVANCED_IMAGE_PROCESSING_MAX_IMAGES": "[parameters('advancedImageProcessingMaxImages')]", "ORCHESTRATION_STRATEGY": "[parameters('orchestrationStrategy')]", "CONVERSATION_FLOW": "[parameters('conversationFlow')]", "LOGLEVEL": "[parameters('logLevel')]", - "AZURE_COSMOSDB_INFO": "[string(createObject('accountName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]", + "AZURE_COSMOSDB_INFO": "[string(createObject('accountName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]", "AZURE_COSMOSDB_ENABLE_FEEDBACK": true, "CHAT_HISTORY_ENABLED": "[parameters('chatHistoryEnabled')]" } @@ -3299,8 +3360,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "2593132916851063512" + "version": "0.27.1.19265", + "templateHash": "4871228348238542266" } }, "parameters": { @@ -3481,8 +3542,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -3708,8 +3769,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -3786,8 +3847,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -3855,8 +3916,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -3924,8 +3985,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -3993,8 +4054,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -4059,8 +4120,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -4133,8 +4194,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "2622922268469466870" + "version": "0.27.1.19265", + "templateHash": "12223899351427459655" }, "description": "Creates a SQL role assignment under an Azure Cosmos DB account." }, @@ -4186,18 +4247,19 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db')]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { @@ -4205,6 +4267,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('adminWebsiteName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -4215,7 +4278,7 @@ "value": "[parameters('adminWebsiteName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'adminweb'))]" @@ -4227,41 +4290,41 @@ "value": "3.11" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" - }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + }, + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -4269,11 +4332,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_TEMPERATURE": "[parameters('azureOpenAITemperature')]", @@ -4321,8 +4384,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "17862689402403811352" + "version": "0.27.1.19265", + "templateHash": "9122829587959554559" } }, "parameters": { @@ -4492,8 +4555,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -4719,8 +4782,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -4797,8 +4860,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -4866,8 +4929,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -4935,8 +4998,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -5004,8 +5067,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -5070,8 +5133,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -5136,17 +5199,18 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { @@ -5154,6 +5218,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[format('{0}-docker', parameters('adminWebsiteName'))]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -5164,7 +5229,7 @@ "value": "[format('{0}-docker', parameters('adminWebsiteName'))]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'adminweb-docker'))]" @@ -5173,41 +5238,41 @@ "value": "fruoccopublic.azurecr.io/rag-adminwebapp" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" - }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + }, + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -5215,11 +5280,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_TEMPERATURE": "[parameters('azureOpenAITemperature')]", @@ -5267,8 +5332,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "17862689402403811352" + "version": "0.27.1.19265", + "templateHash": "9122829587959554559" } }, "parameters": { @@ -5438,8 +5503,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -5665,8 +5730,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -5743,8 +5808,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -5812,8 +5877,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -5881,8 +5946,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -5950,8 +6015,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -6016,8 +6081,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -6082,23 +6147,25 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "monitoring", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -6109,7 +6176,7 @@ "value": "[parameters('applicationInsightsName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": { @@ -6129,8 +6196,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "2390666818608223959" + "version": "0.27.1.19265", + "templateHash": "13065021834937678877" }, "description": "Creates an Application Insights instance and a Log Analytics workspace." }, @@ -6181,8 +6248,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "19694557100387265" + "version": "0.27.1.19265", + "templateHash": "2707024492396982954" }, "description": "Creates a Log Analytics workspace." }, @@ -6262,8 +6329,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16993757720869129667" + "version": "0.27.1.19265", + "templateHash": "6684811037284796150" }, "description": "Creates an Application Insights instance based on an existing Log Analytics workspace." }, @@ -6327,8 +6394,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "12524466040979787143" + "version": "0.27.1.19265", + "templateHash": "1759216242890853910" }, "description": "Creates a dashboard for an Application Insights instance." }, @@ -7616,12 +7683,16 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "workbook", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -7632,28 +7703,28 @@ "value": "[parameters('workbookDisplayName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "hostingPlanName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, - "functionName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('functionName'))), '2022-09-01').outputs.functionName.value), createObject('value', reference(resourceId('Microsoft.Resources/deployments', parameters('functionName')), '2022-09-01').outputs.functionName.value))]", - "websiteName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName'))), '2022-09-01').outputs.FRONTEND_API_NAME.value), createObject('value', reference(resourceId('Microsoft.Resources/deployments', parameters('websiteName')), '2022-09-01').outputs.FRONTEND_API_NAME.value))]", - "adminWebsiteName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName'))), '2022-09-01').outputs.WEBSITE_ADMIN_NAME.value), createObject('value', reference(resourceId('Microsoft.Resources/deployments', parameters('adminWebsiteName')), '2022-09-01').outputs.WEBSITE_ADMIN_NAME.value))]", + "functionName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('functionName'))), '2022-09-01').outputs.functionName.value), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('functionName')), '2022-09-01').outputs.functionName.value))]", + "websiteName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName'))), '2022-09-01').outputs.FRONTEND_API_NAME.value), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('websiteName')), '2022-09-01').outputs.FRONTEND_API_NAME.value))]", + "adminWebsiteName": "[if(equals(parameters('hostingModel'), 'container'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName'))), '2022-09-01').outputs.WEBSITE_ADMIN_NAME.value), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('adminWebsiteName')), '2022-09-01').outputs.WEBSITE_ADMIN_NAME.value))]", "eventGridSystemTopicName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', variables('eventGridSystemTopicName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', variables('eventGridSystemTopicName')), '2022-09-01').outputs.name.value]" }, "logAnalyticsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.logAnalyticsWorkspaceName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.logAnalyticsWorkspaceName.value]" }, "azureOpenAIResourceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" } }, "template": { @@ -7662,8 +7733,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "15151749822990864279" + "version": "0.27.1.19265", + "templateHash": "5649433306021197168" } }, "parameters": { @@ -7745,8 +7816,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "15030863077610448627" + "version": "0.27.1.19265", + "templateHash": "2792566012892132891" } }, "parameters": { @@ -7816,18 +7887,19 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('adminWebsiteName'))]", - "[resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName')))]", - "[resourceId('Microsoft.Resources/deployments', variables('eventGridSystemTopicName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('functionName'))]", - "[resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('functionName')))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('websiteName'))]", - "[resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName')))]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('adminWebsiteName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName')))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', variables('eventGridSystemTopicName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('functionName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('functionName')))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('websiteName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName')))]" ] }, { @@ -7835,6 +7907,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('functionName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -7845,7 +7918,7 @@ "value": "[parameters('functionName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'function'))]" @@ -7857,44 +7930,44 @@ "value": "3.11" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "clientKey": { "value": "[variables('clientKey')]" }, - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -7902,11 +7975,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_EMBEDDING_MODEL_INFO": "[variables('azureOpenAIEmbeddingModelInfo')]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", @@ -7939,8 +8012,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "1242656561988928447" + "version": "0.27.1.19265", + "templateHash": "6774619842746444908" } }, "parameters": { @@ -8135,8 +8208,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "8206949151292074536" + "version": "0.27.1.19265", + "templateHash": "17012644049299978864" }, "description": "Creates an Azure Function in an existing Azure App Service plan." }, @@ -8346,8 +8419,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -8573,8 +8646,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -8650,8 +8723,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -8737,8 +8810,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -8806,8 +8879,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -8875,8 +8948,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -8944,8 +9017,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -9013,8 +9086,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -9079,8 +9152,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -9141,17 +9214,18 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { @@ -9159,6 +9233,7 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[format('{0}-docker', parameters('functionName'))]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -9169,7 +9244,7 @@ "value": "[format('{0}-docker', parameters('functionName'))]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'function-docker'))]" @@ -9178,44 +9253,44 @@ "value": "fruoccopublic.azurecr.io/rag-backend" }, "appServicePlanId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]" }, "applicationInsightsName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "storageAccountName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.name.value]" }, "formRecognizerName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.name.value]" }, "contentSafetyName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.name.value]" }, "speechServiceName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName')), '2022-09-01').outputs.name.value]" }, - "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "computerVisionName": "[if(parameters('useAdvancedImageProcessing'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "clientKey": { "value": "[variables('clientKey')]" }, - "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", - "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", - "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", - "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", - "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", - "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", - "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", + "openAIKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value), createObject('value', ''))]", + "storageAccountKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value), createObject('value', ''))]", + "formRecognizerKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value), createObject('value', ''))]", + "searchKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value), createObject('value', ''))]", + "contentSafetyKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value), createObject('value', ''))]", + "speechKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value), createObject('value', ''))]", + "computerVisionKeyName": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value), createObject('value', ''))]", "useKeyVault": { "value": "[parameters('useKeyVault')]" }, - "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", + "keyVaultName": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value), createObject('value', ''))]", "authType": { "value": "[parameters('authType')]" }, @@ -9223,11 +9298,11 @@ "value": { "AZURE_BLOB_ACCOUNT_NAME": "[parameters('storageAccountName')]", "AZURE_BLOB_CONTAINER_NAME": "[variables('blobContainerName')]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": "[parameters('computerVisionVectorizeImageApiVersion')]", "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_MODEL_VERSION": "[parameters('computerVisionVectorizeImageModelVersion')]", - "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", - "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_CONTENT_SAFETY_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]", + "AZURE_FORM_RECOGNIZER_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]", "AZURE_OPENAI_MODEL_INFO": "[variables('azureOpenAIModelInfo')]", "AZURE_OPENAI_EMBEDDING_MODEL_INFO": "[variables('azureOpenAIEmbeddingModelInfo')]", "AZURE_OPENAI_RESOURCE": "[parameters('azureOpenAIResourceName')]", @@ -9260,8 +9335,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "1242656561988928447" + "version": "0.27.1.19265", + "templateHash": "6774619842746444908" } }, "parameters": { @@ -9456,8 +9531,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "8206949151292074536" + "version": "0.27.1.19265", + "templateHash": "17012644049299978864" }, "description": "Creates an Azure Function in an existing Azure App Service plan." }, @@ -9667,8 +9742,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "7732628295698757767" + "version": "0.27.1.19265", + "templateHash": "13528682982724980465" }, "description": "Creates an Azure App Service in an existing Azure App Service plan." }, @@ -9894,8 +9969,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "16930852302813854027" + "version": "0.27.1.19265", + "templateHash": "9730065891606131364" }, "description": "Updates app settings for an Azure App Service." }, @@ -9971,8 +10046,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10058,8 +10133,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10127,8 +10202,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10196,8 +10271,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10265,8 +10340,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10334,8 +10409,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -10400,8 +10475,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "465622386717580763" + "version": "0.27.1.19265", + "templateHash": "6278079210023281106" }, "description": "Assigns an Azure Key Vault access policy." }, @@ -10462,23 +10537,25 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'computerVision')]", - "[resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('hostingPlanName'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('speechServiceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]", - "[resourceId('Microsoft.Resources/deployments', 'storekeys')]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('speechServiceName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys')]" ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('formRecognizerName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -10489,7 +10566,7 @@ "value": "[parameters('formRecognizerName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[variables('tags')]" @@ -10504,8 +10581,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13123022401063321803" + "version": "0.27.1.19265", + "templateHash": "10621100095067903006" }, "description": "Creates an Azure Cognitive Services instance." }, @@ -10624,12 +10701,16 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('contentSafetyName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -10640,7 +10721,7 @@ "value": "[parameters('contentSafetyName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "tags": { "value": "[variables('tags')]" @@ -10655,8 +10736,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "13123022401063321803" + "version": "0.27.1.19265", + "templateHash": "10621100095067903006" }, "description": "Creates an Azure Cognitive Services instance." }, @@ -10775,12 +10856,16 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[variables('eventGridSystemTopicName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -10791,10 +10876,10 @@ "value": "[variables('eventGridSystemTopicName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "storageAccountId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.id.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.id.value]" }, "queueName": { "value": "[variables('queueName')]" @@ -10809,8 +10894,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "6699069410959282929" + "version": "0.27.1.19265", + "templateHash": "7008837948540418623" } }, "parameters": { @@ -10883,13 +10968,15 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]" + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]" ] }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('storageAccountName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -10900,7 +10987,7 @@ "value": "[parameters('storageAccountName')]" }, "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "useKeyVault": { "value": "[parameters('useKeyVault')]" @@ -10940,8 +11027,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "10401188783540495741" + "version": "0.27.1.19265", + "templateHash": "11811484180274743641" }, "description": "Creates an Azure storage account." }, @@ -11135,13 +11222,17 @@ } } } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[and(equals(parameters('authType'), 'rbac'), not(equals(parameters('principalId'), '')))]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "storage-role-user", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -11164,8 +11255,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -11201,13 +11292,17 @@ } ] } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[and(equals(parameters('authType'), 'rbac'), not(equals(parameters('principalId'), '')))]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "openai-role-user", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -11230,8 +11325,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -11267,13 +11362,17 @@ } ] } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[and(equals(parameters('authType'), 'rbac'), not(equals(parameters('principalId'), '')))]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "openai-role-user-contributor", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -11296,8 +11395,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -11333,13 +11432,17 @@ } ] } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[and(equals(parameters('authType'), 'rbac'), not(equals(parameters('principalId'), '')))]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "search-role-user", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -11362,8 +11465,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "14973584850527407631" + "version": "0.27.1.19265", + "templateHash": "16440196655390446916" }, "description": "Creates a role assignment for a service principal." }, @@ -11399,13 +11502,17 @@ } ] } - } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]" + ] }, { "condition": "[equals(parameters('orchestrationStrategy'), 'prompt_flow')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[parameters('azureMachineLearningName')]", + "resourceGroup": "[variables('rgName')]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -11413,29 +11520,29 @@ "mode": "Incremental", "parameters": { "location": { - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "workspaceName": { "value": "[parameters('azureMachineLearningName')]" }, "storageAccountId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.id.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName')), '2022-09-01').outputs.id.value]" }, - "keyVaultId": "[if(parameters('useKeyVault'), createObject('value', reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.id.value), createObject('value', ''))]", + "keyVaultId": "[if(parameters('useKeyVault'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.id.value), createObject('value', ''))]", "applicationInsightsId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsId.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsId.value]" }, "azureOpenAIName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.name.value]" }, "azureAISearchName": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.name.value]" }, "azureAISearchEndpoint": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.endpoint.value]" }, "azureOpenAIEndpoint": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName')), '2022-09-01').outputs.endpoint.value]" } }, "template": { @@ -11444,8 +11551,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.23.60470", - "templateHash": "17372485166957435450" + "version": "0.27.1.19265", + "templateHash": "1703863751305099956" } }, "parameters": { @@ -11541,18 +11648,19 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'keyvault')]", - "[resourceId('Microsoft.Resources/deployments', 'monitoring')]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName'))]", - "[resourceId('Microsoft.Resources/deployments', parameters('storageAccountName'))]" + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureOpenAIResourceName'))]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('rgName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('storageAccountName'))]" ] } ], "outputs": { "APPLICATIONINSIGHTS_CONNECTION_STRING": { "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsConnectionString.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsConnectionString.value]" }, "AZURE_APP_SERVICE_HOSTING_MODEL": { "type": "string", @@ -11568,19 +11676,19 @@ }, "AZURE_BLOB_ACCOUNT_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.STORAGE_ACCOUNT_KEY_NAME.value, '')]" }, "AZURE_COMPUTER_VISION_ENDPOINT": { "type": "string", - "value": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]" + "value": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]" }, "AZURE_COMPUTER_VISION_LOCATION": { "type": "string", - "value": "[if(parameters('useAdvancedImageProcessing'), reference(resourceId('Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.location.value, '')]" + "value": "[if(parameters('useAdvancedImageProcessing'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.location.value, '')]" }, "AZURE_COMPUTER_VISION_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.COMPUTER_VISION_KEY_NAME.value, '')]" }, "AZURE_COMPUTER_VISION_VECTORIZE_IMAGE_API_VERSION": { "type": "string", @@ -11592,31 +11700,31 @@ }, "AZURE_CONTENT_SAFETY_ENDPOINT": { "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('contentSafetyName')), '2022-09-01').outputs.endpoint.value]" }, "AZURE_CONTENT_SAFETY_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.CONTENT_SAFETY_KEY_NAME.value, '')]" }, "AZURE_FORM_RECOGNIZER_ENDPOINT": { "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('formRecognizerName')), '2022-09-01').outputs.endpoint.value]" }, "AZURE_FORM_RECOGNIZER_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.FORM_RECOGNIZER_KEY_NAME.value, '')]" }, "AZURE_KEY_VAULT_ENDPOINT": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.endpoint.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.endpoint.value, '')]" }, "AZURE_KEY_VAULT_NAME": { "type": "string", - "value": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), reference(resourceId('Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value, '')]" + "value": "[if(or(parameters('useKeyVault'), equals(parameters('authType'), 'rbac')), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value, '')]" }, "AZURE_LOCATION": { "type": "string", - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "AZURE_OPENAI_MODEL_INFO": { "type": "string", @@ -11660,19 +11768,19 @@ }, "AZURE_OPENAI_API_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.OPENAI_KEY_NAME.value, '')]" }, "AZURE_RESOURCE_GROUP": { "type": "string", - "value": "[variables('resourceGroupName')]" + "value": "[variables('rgName')]" }, "AZURE_SEARCH_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SEARCH_KEY_NAME.value, '')]" }, "AZURE_SEARCH_SERVICE": { "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureAISearchName')), '2022-09-01').outputs.endpoint.value]" }, "AZURE_SEARCH_USE_SEMANTIC_SEARCH": { "type": "bool", @@ -11740,11 +11848,11 @@ }, "AZURE_SPEECH_SERVICE_REGION": { "type": "string", - "value": "[variables('location')]" + "value": "[parameters('location')]" }, "AZURE_SPEECH_SERVICE_KEY": { "type": "string", - "value": "[if(parameters('useKeyVault'), reference(resourceId('Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value, '')]" + "value": "[if(parameters('useKeyVault'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'storekeys'), '2022-09-01').outputs.SPEECH_KEY_NAME.value, '')]" }, "AZURE_SPEECH_RECOGNIZER_LANGUAGES": { "type": "string", @@ -11768,11 +11876,11 @@ }, "FRONTEND_WEBSITE_NAME": { "type": "string", - "value": "[if(equals(parameters('hostingModel'), 'code'), reference(resourceId('Microsoft.Resources/deployments', parameters('websiteName')), '2022-09-01').outputs.FRONTEND_API_URI.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName'))), '2022-09-01').outputs.FRONTEND_API_URI.value)]" + "value": "[if(equals(parameters('hostingModel'), 'code'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('websiteName')), '2022-09-01').outputs.FRONTEND_API_URI.value, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName'))), '2022-09-01').outputs.FRONTEND_API_URI.value)]" }, "ADMIN_WEBSITE_NAME": { "type": "string", - "value": "[if(equals(parameters('hostingModel'), 'code'), reference(resourceId('Microsoft.Resources/deployments', parameters('adminWebsiteName')), '2022-09-01').outputs.WEBSITE_ADMIN_URI.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName'))), '2022-09-01').outputs.WEBSITE_ADMIN_URI.value)]" + "value": "[if(equals(parameters('hostingModel'), 'code'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('adminWebsiteName')), '2022-09-01').outputs.WEBSITE_ADMIN_URI.value, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('adminWebsiteName'))), '2022-09-01').outputs.WEBSITE_ADMIN_URI.value)]" }, "LOGLEVEL": { "type": "string", @@ -11792,7 +11900,7 @@ }, "AZURE_ML_WORKSPACE_NAME": { "type": "string", - "value": "[if(equals(parameters('orchestrationStrategy'), 'prompt_flow'), reference(resourceId('Microsoft.Resources/deployments', parameters('azureMachineLearningName')), '2022-09-01').outputs.workspaceName.value, '')]" + "value": "[if(equals(parameters('orchestrationStrategy'), 'prompt_flow'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('azureMachineLearningName')), '2022-09-01').outputs.workspaceName.value, '')]" }, "RESOURCE_TOKEN": { "type": "string", @@ -11800,7 +11908,7 @@ }, "AZURE_COSMOSDB_INFO": { "type": "string", - "value": "[string(createObject('accountName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(resourceId('Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]" + "value": "[string(createObject('accountName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosAccountName, 'databaseName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosDatabaseName, 'containerName', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosOutput.value.cosmosContainerName))]" } } } \ No newline at end of file