From 2b4e2359508dbe92241ecd89bafc6e6a2424f40c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:02:14 +0000 Subject: [PATCH 1/4] Initial plan From 1176198aa76200449e5d133353e1a9d1e94732ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:11:47 +0000 Subject: [PATCH 2/4] Fix critical BCP420 scope resolution error and safe access warnings Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> --- infra/core/ai/cognitiveservices.bicep | 4 ++-- infra/core/host/container-apps.bicep | 18 ++++++++++++++---- infra/core/security/keyvault-secrets.bicep | 8 ++++---- infra/core/storage/storage-account.bicep | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/infra/core/ai/cognitiveservices.bicep b/infra/core/ai/cognitiveservices.bicep index 3588072c..86e5033f 100644 --- a/infra/core/ai/cognitiveservices.bicep +++ b/infra/core/ai/cognitiveservices.bicep @@ -44,9 +44,9 @@ resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01 name: deployment.name properties: { model: deployment.model - raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null + raiPolicyName: deployment.?raiPolicyName ?? null } - sku: contains(deployment, 'sku') ? deployment.sku : { + sku: deployment.?sku ?? { name: 'Standard' capacity: 20 } diff --git a/infra/core/host/container-apps.bicep b/infra/core/host/container-apps.bicep index 1c656e28..a3aa44c9 100644 --- a/infra/core/host/container-apps.bicep +++ b/infra/core/host/container-apps.bicep @@ -21,9 +21,19 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = { } } -module containerRegistry 'container-registry.bicep' = { +module containerRegistryInCustomRG 'container-registry.bicep' = if (!empty(containerRegistryResourceGroupName)) { + name: '${name}-container-registry' + scope: resourceGroup(containerRegistryResourceGroupName) + params: { + name: containerRegistryName + location: location + adminUserEnabled: containerRegistryAdminUserEnabled + tags: tags + } +} + +module containerRegistryInCurrentRG 'container-registry.bicep' = if (empty(containerRegistryResourceGroupName)) { name: '${name}-container-registry' - scope: !empty(containerRegistryResourceGroupName) ? resourceGroup(containerRegistryResourceGroupName) : resourceGroup() params: { name: containerRegistryName location: location @@ -36,5 +46,5 @@ output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain output environmentName string = containerAppsEnvironment.outputs.name output environmentId string = containerAppsEnvironment.outputs.id -output registryLoginServer string = containerRegistry.outputs.loginServer -output registryName string = containerRegistry.outputs.name +output registryLoginServer string = !empty(containerRegistryResourceGroupName) ? containerRegistryInCustomRG.outputs.loginServer : containerRegistryInCurrentRG.outputs.loginServer +output registryName string = !empty(containerRegistryResourceGroupName) ? containerRegistryInCustomRG.outputs.name : containerRegistryInCurrentRG.outputs.name diff --git a/infra/core/security/keyvault-secrets.bicep b/infra/core/security/keyvault-secrets.bicep index 7116bf8b..79692267 100644 --- a/infra/core/security/keyvault-secrets.bicep +++ b/infra/core/security/keyvault-secrets.bicep @@ -13,11 +13,11 @@ resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = [for se tags: tags properties: { attributes: { - enabled: contains(secret, 'enabled') ? secret.enabled : true - exp: contains(secret, 'exp') ? secret.exp : 0 - nbf: contains(secret, 'nbf') ? secret.nbf : 0 + enabled: secret.?enabled ?? true + exp: secret.?exp ?? 0 + nbf: secret.?nbf ?? 0 } - contentType: contains(secret, 'contentType') ? secret.contentType : 'string' + contentType: secret.?contentType ?? 'string' value: secret.value } }] diff --git a/infra/core/storage/storage-account.bicep b/infra/core/storage/storage-account.bicep index 6149fb2f..c27ba1c1 100644 --- a/infra/core/storage/storage-account.bicep +++ b/infra/core/storage/storage-account.bicep @@ -62,7 +62,7 @@ resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { resource container 'containers' = [for container in containers: { name: container.name properties: { - publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None' + publicAccess: container.?publicAccess ?? 'None' } }] } From 0cbacc2a920df02d4b24635f5e48e2dd762df024 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 20:39:37 +0000 Subject: [PATCH 3/4] Fix Azure policy violations in storage account configuration Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> --- infra/main.bicep | 5 +- infra/main.json | 7432 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 7436 insertions(+), 1 deletion(-) create mode 100644 infra/main.json diff --git a/infra/main.bicep b/infra/main.bicep index 79010b0d..99d29db8 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -511,6 +511,9 @@ module storage 'core/storage/storage-account.bicep' = { location: storageResourceGroupLocation tags: updatedTags publicNetworkAccess: 'Enabled' + allowBlobPublicAccess: false + allowSharedKeyAccess: false + defaultToOAuthAuthentication: true sku: { name: 'Standard_LRS' } @@ -521,7 +524,7 @@ module storage 'core/storage/storage-account.bicep' = { containers: [ { name: storageContainerName - publicAccess: 'Blob' + publicAccess: 'None' } ] } diff --git a/infra/main.json b/infra/main.json new file mode 100644 index 00000000..6dd10f40 --- /dev/null +++ b/infra/main.json @@ -0,0 +1,7432 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "15076630820646909091" + } + }, + "parameters": { + "environmentName": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "metadata": { + "description": "Name of the environment used to generate a short unique hash for resources." + } + }, + "location": { + "type": "string", + "allowedValues": [ + "centralus", + "eastus2", + "eastasia", + "westus", + "westeurope", + "westus2", + "australiaeast", + "eastus", + "francecentral", + "japaneast", + "nortcentralus", + "swedencentral", + "switzerlandnorth", + "uksouth" + ], + "metadata": { + "description": "Primary location for all resources" + } + }, + "tags": { + "type": "string", + "defaultValue": "" + }, + "openAiResourceGroupLocation": { + "type": "string", + "allowedValues": [ + "canadaeast", + "westus", + "eastus", + "eastus2", + "francecentral", + "swedencentral", + "switzerlandnorth", + "uksouth", + "japaneast", + "northcentralus", + "australiaeast" + ], + "metadata": { + "azd": { + "type": "location" + }, + "description": "Location for the OpenAI resource group" + } + }, + "azureOpenAIChatGptModelName": { + "type": "string", + "defaultValue": "gpt-4o-mini", + "allowedValues": [ + "gpt-35-turbo", + "gpt-4", + "gpt-4o", + "gpt-4o-mini", + "gpt-35-turbo-16k", + "gpt-4-16k" + ], + "metadata": { + "description": "Name of the chat GPT model. Default: gpt-35-turbo" + } + }, + "azureOpenAIChatGptModelVersion": { + "type": "string", + "defaultValue": "2024-07-18", + "allowedValues": [ + "0613", + "2024-07-18" + ], + "metadata": { + "description": "Name of the chat GPT model. Default: 0613 for gpt-35-turbo, or choose 2024-07-18 for gpt-4o-mini" + } + }, + "useApplicationInsights": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Defines if the process will deploy an Azure Application Insights resource" + } + }, + "applicationInsightsDashboardName": { + "type": "string", + "defaultValue": "" + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure Application Insights resource" + } + }, + "appServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure App Service Plan" + } + }, + "chatGptDeploymentCapacity": { + "type": "int", + "defaultValue": 8, + "metadata": { + "description": "Capacity of the chat GPT deployment. Default: 10" + } + }, + "azureChatGptDeploymentName": { + "type": "string", + "defaultValue": "chat", + "metadata": { + "description": "Name of the chat GPT deployment" + } + }, + "computerVisionServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure Cognitive Services Computer Vision service" + } + }, + "computerVisionResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the Azure Cognitive Services Computer Vision service" + } + }, + "computerVisionResourceGroupLocation": { + "type": "string", + "defaultValue": "eastus", + "metadata": { + "description": "Location of the resource group for the Azure Cognitive Services Computer Vision service" + } + }, + "computerVisionSkuName": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "SKU name for the Azure Cognitive Services Computer Vision service. Default: S1" + } + }, + "azureEmbeddingDeploymentName": { + "type": "string", + "defaultValue": "embedding", + "metadata": { + "description": "Name of the embedding deployment. Default: embedding" + } + }, + "embeddingDeploymentCapacity": { + "type": "int", + "defaultValue": 30, + "metadata": { + "description": "Capacity of the embedding deployment. Default: 30" + } + }, + "azureEmbeddingModelName": { + "type": "string", + "defaultValue": "text-embedding-ada-002", + "metadata": { + "description": "Name of the embedding model. Default: text-embedding-ada-002" + } + }, + "containerAppsEnvironmentName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the container apps environment" + } + }, + "containerRegistryName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure container registry" + } + }, + "containerRegistryResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the Azure container registry" + } + }, + "formRecognizerResourceGroupLocation": { + "type": "string", + "defaultValue": "[parameters('location')]", + "metadata": { + "description": "Location of the resource group for the Azure AI Document Intelligence service" + } + }, + "formRecognizerResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the Azure AI Document Intelligence service" + } + }, + "formRecognizerServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure AI Document Intelligence service" + } + }, + "formRecognizerSkuName": { + "type": "string", + "defaultValue": "S0", + "allowedValues": [ + "S0", + "F0" + ], + "metadata": { + "description": "SKU name for the Azure AI Document Intelligence service. Default: S0" + } + }, + "functionServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure Function App" + } + }, + "keyVaultName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure Key Vault" + } + }, + "keyVaultResourceGroupLocation": { + "type": "string", + "defaultValue": "[parameters('location')]", + "metadata": { + "description": "Location of the resource group for the Azure Key Vault" + } + }, + "keyVaultResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the Azure Key Vault" + } + }, + "logAnalyticsName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure Log Analytics workspace" + } + }, + "openAiResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the OpenAI resources" + } + }, + "openAiServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the OpenAI service" + } + }, + "openAiSkuName": { + "type": "string", + "defaultValue": "S0", + "metadata": { + "description": "SKU name for the OpenAI service. Default: S0" + } + }, + "principalId": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "ID of the principal" + } + }, + "principalType": { + "type": "string", + "defaultValue": "User", + "metadata": { + "description": "Type of the principal. Valid values: User,ServicePrincipal" + } + }, + "resourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group" + } + }, + "searchIndexName": { + "type": "string", + "defaultValue": "gptkbindex", + "metadata": { + "description": "Name of the search index. Default: gptkbindex" + } + }, + "searchServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Azure AI Search service" + } + }, + "searchServiceResourceGroupLocation": { + "type": "string", + "defaultValue": "[parameters('location')]", + "metadata": { + "description": "Location of the resource group for the Azure AI Search service" + } + }, + "searchServiceResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the Azure AI Search service" + } + }, + "searchServiceSemanticRankerLevel": { + "type": "string", + "metadata": { + "description": "Azure AI Search Semantic Ranker Level" + } + }, + "searchServiceSkuName": { + "type": "string", + "defaultValue": "standard", + "metadata": { + "description": "SKU name for the Azure AI Search service. Default: standard" + } + }, + "storageAccountName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the storage account" + } + }, + "storageContainerName": { + "type": "string", + "defaultValue": "content", + "metadata": { + "description": "Name of the storage container. Default: content" + } + }, + "storageResourceGroupLocation": { + "type": "string", + "defaultValue": "[parameters('location')]", + "metadata": { + "description": "Location of the resource group for the storage account" + } + }, + "storageResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the resource group for the storage account" + } + }, + "webAppExists": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Specifies if the web app exists" + } + }, + "webContainerAppName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the web app container" + } + }, + "webIdentityName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the web app identity" + } + }, + "webImageName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the web app image" + } + }, + "useAOAI": { + "type": "bool", + "metadata": { + "description": "Use Azure OpenAI service" + } + }, + "openAIApiKey": { + "type": "string", + "metadata": { + "description": "OpenAI API Key, leave empty to provision a new Azure OpenAI instance" + } + }, + "openAiChatGptDeployment": { + "type": "string", + "metadata": { + "description": "OpenAI Model" + } + }, + "openAiEmbeddingDeployment": { + "type": "string", + "metadata": { + "description": "OpenAI Embedding Model" + } + }, + "useVision": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Use Vision retrieval. default: false" + } + } + }, + "variables": { + "$fxv#0": { + "analysisServicesServers": "as", + "apiManagementService": "apim-", + "appConfigurationConfigurationStores": "appcs-", + "appManagedEnvironments": "cae-", + "appContainerApps": "ca-", + "authorizationPolicyDefinitions": "policy-", + "automationAutomationAccounts": "aa-", + "blueprintBlueprints": "bp-", + "blueprintBlueprintsArtifacts": "bpa-", + "cacheRedis": "redis-", + "cdnProfiles": "cdnp-", + "cdnProfilesEndpoints": "cdne-", + "cognitiveServicesAccounts": "cog-", + "cognitiveServicesFormRecognizer": "cog-fr-", + "cognitiveServicesTextAnalytics": "cog-ta-", + "cognitiveServicesComputerVision": "cog-cv-", + "computeAvailabilitySets": "avail-", + "computeCloudServices": "cld-", + "computeDiskEncryptionSets": "des", + "computeDisks": "disk", + "computeDisksOs": "osdisk", + "computeGalleries": "gal", + "computeSnapshots": "snap-", + "computeVirtualMachines": "vm", + "computeVirtualMachineScaleSets": "vmss-", + "containerInstanceContainerGroups": "ci", + "containerRegistryRegistries": "cr", + "containerServiceManagedClusters": "aks-", + "databricksWorkspaces": "dbw-", + "dataFactoryFactories": "adf-", + "dataLakeAnalyticsAccounts": "dla", + "dataLakeStoreAccounts": "dls", + "dataMigrationServices": "dms-", + "dBforMySQLServers": "mysql-", + "dBforPostgreSQLServers": "psql-", + "devicesIotHubs": "iot-", + "devicesProvisioningServices": "provs-", + "devicesProvisioningServicesCertificates": "pcert-", + "documentDBDatabaseAccounts": "cosmos-", + "eventGridDomains": "evgd-", + "eventGridDomainsTopics": "evgt-", + "eventGridEventSubscriptions": "evgs-", + "eventHubNamespaces": "evhns-", + "eventHubNamespacesEventHubs": "evh-", + "hdInsightClustersHadoop": "hadoop-", + "hdInsightClustersHbase": "hbase-", + "hdInsightClustersKafka": "kafka-", + "hdInsightClustersMl": "mls-", + "hdInsightClustersSpark": "spark-", + "hdInsightClustersStorm": "storm-", + "hybridComputeMachines": "arcs-", + "insightsActionGroups": "ag-", + "insightsComponents": "appi-", + "keyVaultVaults": "kv-", + "kubernetesConnectedClusters": "arck", + "kustoClusters": "dec", + "kustoClustersDatabases": "dedb", + "logicIntegrationAccounts": "ia-", + "logicWorkflows": "logic-", + "machineLearningServicesWorkspaces": "mlw-", + "managedIdentityUserAssignedIdentities": "id-", + "managementManagementGroups": "mg-", + "migrateAssessmentProjects": "migr-", + "networkApplicationGateways": "agw-", + "networkApplicationSecurityGroups": "asg-", + "networkAzureFirewalls": "afw-", + "networkBastionHosts": "bas-", + "networkConnections": "con-", + "networkDnsZones": "dnsz-", + "networkExpressRouteCircuits": "erc-", + "networkFirewallPolicies": "afwp-", + "networkFirewallPoliciesWebApplication": "waf", + "networkFirewallPoliciesRuleGroups": "wafrg", + "networkFrontDoors": "fd-", + "networkFrontdoorWebApplicationFirewallPolicies": "fdfp-", + "networkLoadBalancersExternal": "lbe-", + "networkLoadBalancersInternal": "lbi-", + "networkLoadBalancersInboundNatRules": "rule-", + "networkLocalNetworkGateways": "lgw-", + "networkNatGateways": "ng-", + "networkNetworkInterfaces": "nic-", + "networkNetworkSecurityGroups": "nsg-", + "networkNetworkSecurityGroupsSecurityRules": "nsgsr-", + "networkNetworkWatchers": "nw-", + "networkPrivateDnsZones": "pdnsz-", + "networkPrivateLinkServices": "pl-", + "networkPublicIPAddresses": "pip-", + "networkPublicIPPrefixes": "ippre-", + "networkRouteFilters": "rf-", + "networkRouteTables": "rt-", + "networkRouteTablesRoutes": "udr-", + "networkTrafficManagerProfiles": "traf-", + "networkVirtualNetworkGateways": "vgw-", + "networkVirtualNetworks": "vnet-", + "networkVirtualNetworksSubnets": "snet-", + "networkVirtualNetworksVirtualNetworkPeerings": "peer-", + "networkVirtualWans": "vwan-", + "networkVpnGateways": "vpng-", + "networkVpnGatewaysVpnConnections": "vcn-", + "networkVpnGatewaysVpnSites": "vst-", + "notificationHubsNamespaces": "ntfns-", + "notificationHubsNamespacesNotificationHubs": "ntf-", + "operationalInsightsWorkspaces": "log-", + "portalDashboards": "dash-", + "powerBIDedicatedCapacities": "pbi-", + "purviewAccounts": "pview-", + "recoveryServicesVaults": "rsv-", + "resourcesResourceGroups": "rg-", + "searchSearchServices": "srch-", + "serviceBusNamespaces": "sb-", + "serviceBusNamespacesQueues": "sbq-", + "serviceBusNamespacesTopics": "sbt-", + "serviceEndPointPolicies": "se-", + "serviceFabricClusters": "sf-", + "signalRServiceSignalR": "sigr", + "sqlManagedInstances": "sqlmi-", + "sqlServers": "sql-", + "sqlServersDataWarehouse": "sqldw-", + "sqlServersDatabases": "sqldb-", + "sqlServersDatabasesStretch": "sqlstrdb-", + "storageStorageAccounts": "st", + "storageStorageAccountsVm": "stvm", + "storSimpleManagers": "ssimp", + "streamAnalyticsCluster": "asa-", + "synapseWorkspaces": "syn", + "synapseWorkspacesAnalyticsWorkspaces": "synw", + "synapseWorkspacesSqlPoolsDedicated": "syndp", + "synapseWorkspacesSqlPoolsSpark": "synsp", + "timeSeriesInsightsEnvironments": "tsi-", + "webServerFarms": "plan-", + "webSitesAppService": "app-", + "webSitesAppServiceEnvironment": "ase-", + "webSitesFunctions": "func-", + "webStaticSites": "stapp-" + }, + "actualSearchServiceSemanticRankerLevel": "[if(equals(parameters('searchServiceSkuName'), 'free'), 'disabled', parameters('searchServiceSemanticRankerLevel'))]", + "abbrs": "[variables('$fxv#0')]", + "resourceToken": "[toLower(uniqueString(subscription().id, parameters('environmentName'), parameters('location')))]", + "baseTags": { + "azd-env-name": "[parameters('environmentName')]" + }, + "updatedTags": "[union(if(empty(parameters('tags')), createObject(), base64ToJson(parameters('tags'))), variables('baseTags'))]" + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2021-04-01", + "name": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "location": "[parameters('location')]", + "tags": "[variables('updatedTags')]" + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "keyvault", + "resourceGroup": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('keyVaultName'))), createObject('value', parameters('keyVaultName')), createObject('value', format('{0}{1}', variables('abbrs').keyVaultVaults, variables('resourceToken'))))]", + "location": { + "value": "[parameters('keyVaultResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "principalId": { + "value": "[parameters('principalId')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "7168247202031008623" + }, + "description": "Creates an Azure Key Vault." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "principalId": { + "type": "string", + "defaultValue": "" + } + }, + "resources": [ + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "2022-07-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "properties": { + "tenantId": "[subscription().tenantId]", + "sku": { + "family": "A", + "name": "standard" + }, + "accessPolicies": "[if(not(empty(parameters('principalId'))), createArray(createObject('objectId', parameters('principalId'), 'permissions', createObject('secrets', createArray('get', 'list')), 'tenantId', subscription().tenantId)), createArray())]" + } + } + ], + "outputs": { + "endpoint": { + "type": "string", + "value": "[reference(resourceId('Microsoft.KeyVault/vaults', parameters('name')), '2022-07-01').vaultUri]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.KeyVault/vaults', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "keyvault-secrets", + "resourceGroup": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "keyVaultName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "secrets": { + "value": "[concat(createArray(createObject('name', 'AzureSearchServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value), createObject('name', 'AzureSearchIndex', 'value', parameters('searchIndexName')), createObject('name', 'AzureStorageAccountEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob), createObject('name', 'AzureStorageContainer', 'value', parameters('storageContainerName')), createObject('name', 'UseAOAI', 'value', if(parameters('useAOAI'), 'true', 'false')), createObject('name', 'UseVision', 'value', if(parameters('useVision'), 'true', 'false'))), if(parameters('useAOAI'), createArray(createObject('name', 'AzureOpenAiServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value), createObject('name', 'AzureOpenAiChatGptDeployment', 'value', parameters('azureChatGptDeploymentName')), createObject('name', 'AzureOpenAiEmbeddingDeployment', 'value', parameters('azureEmbeddingDeploymentName'))), createArray(createObject('name', 'OpenAIAPIKey', 'value', parameters('openAIApiKey')), createObject('name', 'OpenAiChatGptDeployment', 'value', parameters('openAiChatGptDeployment')), createObject('name', 'OpenAiEmbeddingDeployment', 'value', parameters('openAiEmbeddingDeployment')))), if(parameters('useVision'), createArray(createObject('name', 'AzureComputerVisionServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value)), createArray()))]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "2040607556454067288" + } + }, + "parameters": { + "tags": { + "type": "object", + "defaultValue": {} + }, + "keyVaultName": { + "type": "string" + }, + "secrets": { + "type": "array", + "defaultValue": [] + } + }, + "resources": [ + { + "copy": { + "name": "keyVaultSecret", + "count": "[length(parameters('secrets'))]", + "mode": "serial", + "batchSize": 1 + }, + "type": "Microsoft.KeyVault/vaults/secrets", + "apiVersion": "2022-07-01", + "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('secrets')[copyIndex()].name)]", + "tags": "[parameters('tags')]", + "properties": { + "attributes": { + "enabled": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'enabled'), true())]", + "exp": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'exp'), 0)]", + "nbf": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'nbf'), 0)]" + }, + "contentType": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'contentType'), 'string')]", + "value": "[parameters('secrets')[copyIndex()].value]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "container-apps", + "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "app" + }, + "containerAppsEnvironmentName": "[if(not(empty(parameters('containerAppsEnvironmentName'))), createObject('value', parameters('containerAppsEnvironmentName')), createObject('value', format('{0}{1}', variables('abbrs').appManagedEnvironments, variables('resourceToken'))))]", + "containerRegistryName": "[if(not(empty(parameters('containerRegistryName'))), createObject('value', parameters('containerRegistryName')), createObject('value', format('{0}{1}', variables('abbrs').containerRegistryRegistries, variables('resourceToken'))))]", + "containerRegistryResourceGroupName": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), createObject('value', parameters('containerRegistryResourceGroupName')), createObject('value', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))))]", + "location": { + "value": "[parameters('location')]" + }, + "logAnalyticsWorkspaceName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.logAnalyticsWorkspaceName.value]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "4680439615851279859" + }, + "description": "Creates an Azure Container Registry and an Azure Container Apps environment." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "containerAppsEnvironmentName": { + "type": "string" + }, + "containerRegistryName": { + "type": "string" + }, + "containerRegistryResourceGroupName": { + "type": "string", + "defaultValue": "" + }, + "containerRegistryAdminUserEnabled": { + "type": "bool", + "defaultValue": false + }, + "logAnalyticsWorkspaceName": { + "type": "string" + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "" + } + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-container-apps-environment', parameters('name'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('containerAppsEnvironmentName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('tags')]" + }, + "logAnalyticsWorkspaceName": { + "value": "[parameters('logAnalyticsWorkspaceName')]" + }, + "applicationInsightsName": { + "value": "[parameters('applicationInsightsName')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13665153796666771230" + }, + "description": "Creates an Azure Container Apps environment." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the Application Insights resource" + } + }, + "daprEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Specifies if Dapr is enabled" + } + }, + "logAnalyticsWorkspaceName": { + "type": "string", + "metadata": { + "description": "Name of the Log Analytics workspace" + } + } + }, + "resources": [ + { + "type": "Microsoft.App/managedEnvironments", + "apiVersion": "2023-05-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "properties": { + "appLogsConfiguration": { + "destination": "log-analytics", + "logAnalyticsConfiguration": { + "customerId": "[reference(resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2022-10-01').customerId]", + "sharedKey": "[listKeys(resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2022-10-01').primarySharedKey]" + } + }, + "daprAIInstrumentationKey": "[if(and(parameters('daprEnabled'), not(empty(parameters('applicationInsightsName')))), reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').InstrumentationKey, '')]" + } + } + ], + "outputs": { + "defaultDomain": { + "type": "string", + "value": "[reference(resourceId('Microsoft.App/managedEnvironments', parameters('name')), '2023-05-01').defaultDomain]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.App/managedEnvironments', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + } + }, + { + "condition": "[not(empty(parameters('containerRegistryResourceGroupName')))]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-container-registry', parameters('name'))]", + "resourceGroup": "[parameters('containerRegistryResourceGroupName')]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('containerRegistryName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "adminUserEnabled": { + "value": "[parameters('containerRegistryAdminUserEnabled')]" + }, + "tags": { + "value": "[parameters('tags')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "9654395135941658248" + }, + "description": "Creates an Azure Container Registry." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "adminUserEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether admin user is enabled" + } + }, + "anonymousPullEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether anonymous pull is enabled" + } + }, + "azureADAuthenticationAsArmPolicy": { + "type": "object", + "defaultValue": { + "status": "enabled" + }, + "metadata": { + "description": "Azure ad authentication as arm policy settings" + } + }, + "dataEndpointEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether data endpoint is enabled" + } + }, + "encryption": { + "type": "object", + "defaultValue": { + "status": "disabled" + }, + "metadata": { + "description": "Encryption settings" + } + }, + "exportPolicy": { + "type": "object", + "defaultValue": { + "status": "enabled" + }, + "metadata": { + "description": "Export policy settings" + } + }, + "metadataSearch": { + "type": "string", + "defaultValue": "Disabled", + "metadata": { + "description": "Metadata search settings" + } + }, + "networkRuleBypassOptions": { + "type": "string", + "defaultValue": "AzureServices", + "metadata": { + "description": "Options for bypassing network rules" + } + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "metadata": { + "description": "Public network access setting" + } + }, + "quarantinePolicy": { + "type": "object", + "defaultValue": { + "status": "disabled" + }, + "metadata": { + "description": "Quarantine policy settings" + } + }, + "retentionPolicy": { + "type": "object", + "defaultValue": { + "days": 7, + "status": "disabled" + }, + "metadata": { + "description": "Retention policy settings" + } + }, + "scopeMaps": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "Scope maps setting" + } + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "Basic" + }, + "metadata": { + "description": "SKU settings" + } + }, + "softDeletePolicy": { + "type": "object", + "defaultValue": { + "retentionDays": 7, + "status": "disabled" + }, + "metadata": { + "description": "Soft delete policy settings" + } + }, + "trustPolicy": { + "type": "object", + "defaultValue": { + "type": "Notary", + "status": "disabled" + }, + "metadata": { + "description": "Trust policy settings" + } + }, + "zoneRedundancy": { + "type": "string", + "defaultValue": "Disabled", + "metadata": { + "description": "Zone redundancy setting" + } + }, + "workspaceId": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The log analytics workspace ID used for logging and monitoring" + } + } + }, + "resources": [ + { + "copy": { + "name": "containerRegistry::scopeMap", + "count": "[length(parameters('scopeMaps'))]" + }, + "type": "Microsoft.ContainerRegistry/registries/scopeMaps", + "apiVersion": "2023-11-01-preview", + "name": "[format('{0}/{1}', parameters('name'), parameters('scopeMaps')[copyIndex()].name)]", + "properties": "[parameters('scopeMaps')[copyIndex()].properties]", + "dependsOn": [ + "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + ] + }, + { + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-11-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "sku": "[parameters('sku')]", + "properties": { + "adminUserEnabled": "[parameters('adminUserEnabled')]", + "anonymousPullEnabled": "[parameters('anonymousPullEnabled')]", + "dataEndpointEnabled": "[parameters('dataEndpointEnabled')]", + "encryption": "[parameters('encryption')]", + "metadataSearch": "[parameters('metadataSearch')]", + "networkRuleBypassOptions": "[parameters('networkRuleBypassOptions')]", + "policies": { + "quarantinePolicy": "[parameters('quarantinePolicy')]", + "trustPolicy": "[parameters('trustPolicy')]", + "retentionPolicy": "[parameters('retentionPolicy')]", + "exportPolicy": "[parameters('exportPolicy')]", + "azureADAuthenticationAsArmPolicy": "[parameters('azureADAuthenticationAsArmPolicy')]", + "softDeletePolicy": "[parameters('softDeletePolicy')]" + }, + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "zoneRedundancy": "[parameters('zoneRedundancy')]" + } + }, + { + "condition": "[not(empty(parameters('workspaceId')))]", + "type": "Microsoft.Insights/diagnosticSettings", + "apiVersion": "2021-05-01-preview", + "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('name'))]", + "name": "registry-diagnostics", + "properties": { + "workspaceId": "[parameters('workspaceId')]", + "logs": [ + { + "category": "ContainerRegistryRepositoryEvents", + "enabled": true + }, + { + "category": "ContainerRegistryLoginEvents", + "enabled": true + } + ], + "metrics": [ + { + "category": "AllMetrics", + "enabled": true, + "timeGrain": "PT1M" + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + ] + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + }, + "loginServer": { + "type": "string", + "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2023-11-01-preview').loginServer]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + } + }, + { + "condition": "[empty(parameters('containerRegistryResourceGroupName'))]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-container-registry', parameters('name'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('containerRegistryName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "adminUserEnabled": { + "value": "[parameters('containerRegistryAdminUserEnabled')]" + }, + "tags": { + "value": "[parameters('tags')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "9654395135941658248" + }, + "description": "Creates an Azure Container Registry." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "adminUserEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether admin user is enabled" + } + }, + "anonymousPullEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether anonymous pull is enabled" + } + }, + "azureADAuthenticationAsArmPolicy": { + "type": "object", + "defaultValue": { + "status": "enabled" + }, + "metadata": { + "description": "Azure ad authentication as arm policy settings" + } + }, + "dataEndpointEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Indicates whether data endpoint is enabled" + } + }, + "encryption": { + "type": "object", + "defaultValue": { + "status": "disabled" + }, + "metadata": { + "description": "Encryption settings" + } + }, + "exportPolicy": { + "type": "object", + "defaultValue": { + "status": "enabled" + }, + "metadata": { + "description": "Export policy settings" + } + }, + "metadataSearch": { + "type": "string", + "defaultValue": "Disabled", + "metadata": { + "description": "Metadata search settings" + } + }, + "networkRuleBypassOptions": { + "type": "string", + "defaultValue": "AzureServices", + "metadata": { + "description": "Options for bypassing network rules" + } + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "metadata": { + "description": "Public network access setting" + } + }, + "quarantinePolicy": { + "type": "object", + "defaultValue": { + "status": "disabled" + }, + "metadata": { + "description": "Quarantine policy settings" + } + }, + "retentionPolicy": { + "type": "object", + "defaultValue": { + "days": 7, + "status": "disabled" + }, + "metadata": { + "description": "Retention policy settings" + } + }, + "scopeMaps": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "Scope maps setting" + } + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "Basic" + }, + "metadata": { + "description": "SKU settings" + } + }, + "softDeletePolicy": { + "type": "object", + "defaultValue": { + "retentionDays": 7, + "status": "disabled" + }, + "metadata": { + "description": "Soft delete policy settings" + } + }, + "trustPolicy": { + "type": "object", + "defaultValue": { + "type": "Notary", + "status": "disabled" + }, + "metadata": { + "description": "Trust policy settings" + } + }, + "zoneRedundancy": { + "type": "string", + "defaultValue": "Disabled", + "metadata": { + "description": "Zone redundancy setting" + } + }, + "workspaceId": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The log analytics workspace ID used for logging and monitoring" + } + } + }, + "resources": [ + { + "copy": { + "name": "containerRegistry::scopeMap", + "count": "[length(parameters('scopeMaps'))]" + }, + "type": "Microsoft.ContainerRegistry/registries/scopeMaps", + "apiVersion": "2023-11-01-preview", + "name": "[format('{0}/{1}', parameters('name'), parameters('scopeMaps')[copyIndex()].name)]", + "properties": "[parameters('scopeMaps')[copyIndex()].properties]", + "dependsOn": [ + "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + ] + }, + { + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-11-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "sku": "[parameters('sku')]", + "properties": { + "adminUserEnabled": "[parameters('adminUserEnabled')]", + "anonymousPullEnabled": "[parameters('anonymousPullEnabled')]", + "dataEndpointEnabled": "[parameters('dataEndpointEnabled')]", + "encryption": "[parameters('encryption')]", + "metadataSearch": "[parameters('metadataSearch')]", + "networkRuleBypassOptions": "[parameters('networkRuleBypassOptions')]", + "policies": { + "quarantinePolicy": "[parameters('quarantinePolicy')]", + "trustPolicy": "[parameters('trustPolicy')]", + "retentionPolicy": "[parameters('retentionPolicy')]", + "exportPolicy": "[parameters('exportPolicy')]", + "azureADAuthenticationAsArmPolicy": "[parameters('azureADAuthenticationAsArmPolicy')]", + "softDeletePolicy": "[parameters('softDeletePolicy')]" + }, + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "zoneRedundancy": "[parameters('zoneRedundancy')]" + } + }, + { + "condition": "[not(empty(parameters('workspaceId')))]", + "type": "Microsoft.Insights/diagnosticSettings", + "apiVersion": "2021-05-01-preview", + "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('name'))]", + "name": "registry-diagnostics", + "properties": { + "workspaceId": "[parameters('workspaceId')]", + "logs": [ + { + "category": "ContainerRegistryRepositoryEvents", + "enabled": true + }, + { + "category": "ContainerRegistryLoginEvents", + "enabled": true + } + ], + "metrics": [ + { + "category": "AllMetrics", + "enabled": true, + "timeGrain": "PT1M" + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + ] + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" + }, + "loginServer": { + "type": "string", + "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2023-11-01-preview').loginServer]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + } + } + ], + "outputs": { + "defaultDomain": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.defaultDomain.value]" + }, + "environmentName": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.name.value]" + }, + "environmentId": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.id.value]" + }, + "registryLoginServer": { + "type": "string", + "value": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('containerRegistryResourceGroupName')), 'Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.loginServer.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.loginServer.value)]" + }, + "registryName": { + "type": "string", + "value": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('containerRegistryResourceGroupName')), 'Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.name.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.name.value)]" + } + } + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "web", + "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('webContainerAppName'))), createObject('value', parameters('webContainerAppName')), createObject('value', format('{0}web-{1}', variables('abbrs').appContainerApps, variables('resourceToken'))))]", + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "imageName": { + "value": "[parameters('webImageName')]" + }, + "identityName": "[if(not(empty(parameters('webIdentityName'))), createObject('value', parameters('webIdentityName')), createObject('value', format('{0}web-{1}', variables('abbrs').managedIdentityUserAssignedIdentities, variables('resourceToken'))))]", + "applicationInsightsName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + }, + "containerAppsEnvironmentName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.environmentName.value]" + }, + "containerRegistryName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" + }, + "exists": { + "value": "[parameters('webAppExists')]" + }, + "keyVaultName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" + }, + "keyVaultResourceGroupName": { + "value": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + }, + "storageBlobEndpoint": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]" + }, + "storageContainerName": { + "value": "[parameters('storageContainerName')]" + }, + "searchServiceEndpoint": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]" + }, + "searchIndexName": { + "value": "[parameters('searchIndexName')]" + }, + "formRecognizerEndpoint": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]" + }, + "computerVisionEndpoint": "[if(parameters('useVision'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value), createObject('value', ''))]", + "useVision": { + "value": "[parameters('useVision')]" + }, + "openAiApiKey": "[if(parameters('useAOAI'), createObject('value', ''), createObject('value', parameters('openAIApiKey')))]", + "openAiEndpoint": "[if(parameters('useAOAI'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value), createObject('value', ''))]", + "openAiChatGptDeployment": "[if(parameters('useAOAI'), createObject('value', parameters('azureChatGptDeploymentName')), createObject('value', ''))]", + "openAiEmbeddingDeployment": "[if(parameters('useAOAI'), createObject('value', parameters('azureEmbeddingDeploymentName')), createObject('value', ''))]", + "serviceBinds": { + "value": [] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "8754897799961399" + } + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "identityName": { + "type": "string", + "metadata": { + "description": "The name of the identity" + } + }, + "applicationInsightsName": { + "type": "string", + "metadata": { + "description": "The name of the Application Insights" + } + }, + "containerAppsEnvironmentName": { + "type": "string", + "metadata": { + "description": "The name of the container apps environment" + } + }, + "containerRegistryName": { + "type": "string", + "metadata": { + "description": "The name of the container registry" + } + }, + "serviceName": { + "type": "string", + "defaultValue": "web", + "metadata": { + "description": "The name of the service" + } + }, + "imageName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the image" + } + }, + "exists": { + "type": "bool", + "metadata": { + "description": "Specifies if the resource exists" + } + }, + "keyVaultName": { + "type": "string", + "metadata": { + "description": "The name of the Key Vault" + } + }, + "keyVaultResourceGroupName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The name of the Key Vault resource group" + } + }, + "storageBlobEndpoint": { + "type": "string", + "metadata": { + "description": "The storage blob endpoint" + } + }, + "storageContainerName": { + "type": "string", + "metadata": { + "description": "The name of the storage container" + } + }, + "searchServiceEndpoint": { + "type": "string", + "metadata": { + "description": "The search service endpoint" + } + }, + "searchIndexName": { + "type": "string", + "metadata": { + "description": "The search index name" + } + }, + "formRecognizerEndpoint": { + "type": "string", + "metadata": { + "description": "The Azure AI Document Intelligence endpoint" + } + }, + "computerVisionEndpoint": { + "type": "string", + "metadata": { + "description": "The Computer Vision endpoint" + } + }, + "openAiEndpoint": { + "type": "string", + "metadata": { + "description": "The OpenAI endpoint" + } + }, + "openAiChatGptDeployment": { + "type": "string", + "metadata": { + "description": "The OpenAI ChatGPT deployment name" + } + }, + "openAiEmbeddingDeployment": { + "type": "string", + "metadata": { + "description": "The OpenAI Embedding deployment name" + } + }, + "useVision": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "use gpt-4v" + } + }, + "openAiApiKey": { + "type": "string", + "metadata": { + "description": "The OpenAI API key" + } + }, + "serviceBinds": { + "type": "array", + "metadata": { + "description": "An array of service binds" + } + } + }, + "resources": [ + { + "type": "Microsoft.ManagedIdentity/userAssignedIdentities", + "apiVersion": "2023-01-31", + "name": "[parameters('identityName')]", + "location": "[parameters('location')]" + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "web-keyvault-access", + "resourceGroup": "[parameters('keyVaultResourceGroupName')]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId]" + }, + "keyVaultName": { + "value": "[parameters('keyVaultName')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13097350302282890335" + }, + "description": "Assigns an Azure Key Vault access policy." + }, + "parameters": { + "name": { + "type": "string", + "defaultValue": "add" + }, + "keyVaultName": { + "type": "string" + }, + "permissions": { + "type": "object", + "defaultValue": { + "secrets": [ + "get", + "list" + ] + } + }, + "principalId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.KeyVault/vaults/accessPolicies", + "apiVersion": "2022-07-01", + "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('name'))]", + "properties": { + "accessPolicies": [ + { + "objectId": "[parameters('principalId')]", + "tenantId": "[subscription().tenantId]", + "permissions": "[parameters('permissions')]" + } + ] + } + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-container-app', parameters('serviceName'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[union(parameters('tags'), createObject('azd-service-name', parameters('serviceName')))]" + }, + "identityName": { + "value": "[parameters('identityName')]" + }, + "imageName": { + "value": "[parameters('imageName')]" + }, + "exists": { + "value": "[parameters('exists')]" + }, + "serviceBinds": { + "value": "[parameters('serviceBinds')]" + }, + "containerAppsEnvironmentName": { + "value": "[parameters('containerAppsEnvironmentName')]" + }, + "containerRegistryName": { + "value": "[parameters('containerRegistryName')]" + }, + "env": { + "value": [ + { + "name": "AZURE_CLIENT_ID", + "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').clientId]" + }, + { + "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", + "value": "[if(not(empty(parameters('applicationInsightsName'))), reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').ConnectionString, '')]" + }, + { + "name": "AZURE_KEY_VAULT_ENDPOINT", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('keyVaultResourceGroupName')), 'Microsoft.KeyVault/vaults', parameters('keyVaultName')), '2022-07-01').vaultUri]" + }, + { + "name": "AZURE_STORAGE_BLOB_ENDPOINT", + "value": "[parameters('storageBlobEndpoint')]" + }, + { + "name": "AZURE_STORAGE_CONTAINER", + "value": "[parameters('storageContainerName')]" + }, + { + "name": "AZURE_SEARCH_SERVICE_ENDPOINT", + "value": "[parameters('searchServiceEndpoint')]" + }, + { + "name": "AZURE_SEARCH_INDEX", + "value": "[parameters('searchIndexName')]" + }, + { + "name": "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT", + "value": "[parameters('formRecognizerEndpoint')]" + }, + { + "name": "AZURE_OPENAI_ENDPOINT", + "value": "[parameters('openAiEndpoint')]" + }, + { + "name": "AZURE_OPENAI_CHATGPT_DEPLOYMENT", + "value": "[parameters('openAiChatGptDeployment')]" + }, + { + "name": "AZURE_OPENAI_EMBEDDING_DEPLOYMENT", + "value": "[parameters('openAiEmbeddingDeployment')]" + }, + { + "name": "AZURE_COMPUTER_VISION_ENDPOINT", + "value": "[parameters('computerVisionEndpoint')]" + }, + { + "name": "USE_VISION", + "value": "[if(parameters('useVision'), 'true', 'false')]" + }, + { + "name": "OPENAI_API_KEY", + "value": "[parameters('openAiApiKey')]" + } + ] + }, + "targetPort": { + "value": 8080 + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "2376048055783657332" + }, + "description": "Creates or updates an existing Azure Container App." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "containerAppsEnvironmentName": { + "type": "string", + "metadata": { + "description": "The environment name for the container apps" + } + }, + "containerCpuCoreCount": { + "type": "string", + "defaultValue": "0.5", + "metadata": { + "description": "The number of CPU cores allocated to a single container instance, e.g., 0.5" + } + }, + "containerMaxReplicas": { + "type": "int", + "defaultValue": 10, + "minValue": 1, + "metadata": { + "description": "The maximum number of replicas to run. Must be at least 1." + } + }, + "containerMemory": { + "type": "string", + "defaultValue": "1.0Gi", + "metadata": { + "description": "The amount of memory allocated to a single container instance, e.g., 1Gi" + } + }, + "containerMinReplicas": { + "type": "int", + "defaultValue": 1, + "minValue": 1, + "metadata": { + "description": "The minimum number of replicas to run. Must be at least 1." + } + }, + "containerName": { + "type": "string", + "defaultValue": "main", + "metadata": { + "description": "The name of the container" + } + }, + "containerRegistryName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the container registry" + } + }, + "containerRegistryHostSuffix": { + "type": "string", + "defaultValue": "azurecr.io", + "metadata": { + "description": "Hostname suffix for container registry. Set when deploying to sovereign clouds" + } + }, + "daprAppProtocol": { + "type": "string", + "defaultValue": "http", + "allowedValues": [ + "http", + "grpc" + ], + "metadata": { + "description": "The protocol used by Dapr to connect to the app, e.g., HTTP or gRPC" + } + }, + "daprEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Enable or disable Dapr for the container app" + } + }, + "daprAppId": { + "type": "string", + "defaultValue": "[parameters('containerName')]", + "metadata": { + "description": "The Dapr app ID" + } + }, + "exists": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Specifies if the resource already exists" + } + }, + "ingressEnabled": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Specifies if Ingress is enabled for the container app" + } + }, + "identityType": { + "type": "string", + "defaultValue": "None", + "allowedValues": [ + "None", + "SystemAssigned", + "UserAssigned" + ], + "metadata": { + "description": "The type of identity for the resource" + } + }, + "identityName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the user-assigned identity" + } + }, + "imageName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the container image" + } + }, + "secrets": { + "type": "secureObject", + "defaultValue": {}, + "metadata": { + "description": "The secrets required for the container" + } + }, + "env": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "The environment variables for the container" + } + }, + "external": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Specifies if the resource ingress is exposed externally" + } + }, + "serviceBinds": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "The service binds associated with the container" + } + }, + "targetPort": { + "type": "int", + "defaultValue": 80, + "metadata": { + "description": "The target port for the container" + } + } + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-update', deployment().name)]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('tags')]" + }, + "identityType": { + "value": "[parameters('identityType')]" + }, + "identityName": { + "value": "[parameters('identityName')]" + }, + "ingressEnabled": { + "value": "[parameters('ingressEnabled')]" + }, + "containerName": { + "value": "[parameters('containerName')]" + }, + "containerAppsEnvironmentName": { + "value": "[parameters('containerAppsEnvironmentName')]" + }, + "containerRegistryName": { + "value": "[parameters('containerRegistryName')]" + }, + "containerRegistryHostSuffix": { + "value": "[parameters('containerRegistryHostSuffix')]" + }, + "containerCpuCoreCount": { + "value": "[parameters('containerCpuCoreCount')]" + }, + "containerMemory": { + "value": "[parameters('containerMemory')]" + }, + "containerMinReplicas": { + "value": "[parameters('containerMinReplicas')]" + }, + "containerMaxReplicas": { + "value": "[parameters('containerMaxReplicas')]" + }, + "daprEnabled": { + "value": "[parameters('daprEnabled')]" + }, + "daprAppId": { + "value": "[parameters('daprAppId')]" + }, + "daprAppProtocol": { + "value": "[parameters('daprAppProtocol')]" + }, + "secrets": { + "value": "[parameters('secrets')]" + }, + "external": { + "value": "[parameters('external')]" + }, + "env": { + "value": "[parameters('env')]" + }, + "imageName": "[if(not(empty(parameters('imageName'))), createObject('value', parameters('imageName')), if(parameters('exists'), createObject('value', reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview').template.containers[0].image), createObject('value', '')))]", + "targetPort": { + "value": "[parameters('targetPort')]" + }, + "serviceBinds": { + "value": "[parameters('serviceBinds')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "14245224743665868744" + }, + "description": "Creates a container app in an Azure Container App environment." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "allowedOrigins": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "Allowed origins" + } + }, + "containerAppsEnvironmentName": { + "type": "string", + "metadata": { + "description": "Name of the environment for container apps" + } + }, + "containerCpuCoreCount": { + "type": "string", + "defaultValue": "0.5", + "metadata": { + "description": "CPU cores allocated to a single container instance, e.g., 0.5" + } + }, + "containerMaxReplicas": { + "type": "int", + "defaultValue": 10, + "minValue": 1, + "metadata": { + "description": "The maximum number of replicas to run. Must be at least 1." + } + }, + "containerMemory": { + "type": "string", + "defaultValue": "1.0Gi", + "metadata": { + "description": "Memory allocated to a single container instance, e.g., 1Gi" + } + }, + "containerMinReplicas": { + "type": "int", + "defaultValue": 1, + "metadata": { + "description": "The minimum number of replicas to run. Must be at least 1." + } + }, + "containerName": { + "type": "string", + "defaultValue": "main", + "metadata": { + "description": "The name of the container" + } + }, + "containerRegistryName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the container registry" + } + }, + "containerRegistryHostSuffix": { + "type": "string", + "defaultValue": "azurecr.io", + "metadata": { + "description": "Hostname suffix for container registry. Set when deploying to sovereign clouds" + } + }, + "daprAppProtocol": { + "type": "string", + "defaultValue": "http", + "allowedValues": [ + "http", + "grpc" + ], + "metadata": { + "description": "The protocol used by Dapr to connect to the app, e.g., http or grpc" + } + }, + "daprAppId": { + "type": "string", + "defaultValue": "[parameters('containerName')]", + "metadata": { + "description": "The Dapr app ID" + } + }, + "daprEnabled": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Enable Dapr" + } + }, + "env": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "The environment variables for the container" + } + }, + "external": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Specifies if the resource ingress is exposed externally" + } + }, + "identityName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the user-assigned identity" + } + }, + "identityType": { + "type": "string", + "defaultValue": "None", + "allowedValues": [ + "None", + "SystemAssigned", + "UserAssigned" + ], + "metadata": { + "description": "The type of identity for the resource" + } + }, + "imageName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the container image" + } + }, + "ingressEnabled": { + "type": "bool", + "defaultValue": true, + "metadata": { + "description": "Specifies if Ingress is enabled for the container app" + } + }, + "revisionMode": { + "type": "string", + "defaultValue": "Single" + }, + "secrets": { + "type": "secureObject", + "defaultValue": {}, + "metadata": { + "description": "The secrets required for the container" + } + }, + "serviceBinds": { + "type": "array", + "defaultValue": [], + "metadata": { + "description": "The service binds associated with the container" + } + }, + "serviceType": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the container apps add-on to use. e.g. redis" + } + }, + "targetPort": { + "type": "int", + "defaultValue": 80, + "metadata": { + "description": "The target port for the container" + } + } + }, + "variables": { + "usePrivateRegistry": "[and(not(empty(parameters('identityName'))), not(empty(parameters('containerRegistryName'))))]", + "normalizedIdentityType": "[if(not(empty(parameters('identityName'))), 'UserAssigned', parameters('identityType'))]" + }, + "resources": [ + { + "type": "Microsoft.App/containerApps", + "apiVersion": "2023-05-02-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "identity": { + "type": "[variables('normalizedIdentityType')]", + "userAssignedIdentities": "[if(and(not(empty(parameters('identityName'))), equals(variables('normalizedIdentityType'), 'UserAssigned')), createObject(format('{0}', resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))), createObject()), null())]" + }, + "properties": { + "managedEnvironmentId": "[resourceId('Microsoft.App/managedEnvironments', parameters('containerAppsEnvironmentName'))]", + "configuration": { + "copy": [ + { + "name": "secrets", + "count": "[length(items(parameters('secrets')))]", + "input": { + "name": "[items(parameters('secrets'))[copyIndex('secrets')].key]", + "value": "[items(parameters('secrets'))[copyIndex('secrets')].value]" + } + } + ], + "activeRevisionsMode": "[parameters('revisionMode')]", + "ingress": "[if(parameters('ingressEnabled'), createObject('external', parameters('external'), 'targetPort', parameters('targetPort'), 'transport', 'auto', 'corsPolicy', createObject('allowedOrigins', union(createArray('https://portal.azure.com', 'https://ms.portal.azure.com'), parameters('allowedOrigins')))), null())]", + "dapr": "[if(parameters('daprEnabled'), createObject('enabled', true(), 'appId', parameters('daprAppId'), 'appProtocol', parameters('daprAppProtocol'), 'appPort', if(parameters('ingressEnabled'), parameters('targetPort'), 0)), createObject('enabled', false()))]", + "service": "[if(not(empty(parameters('serviceType'))), createObject('type', parameters('serviceType')), null())]", + "registries": "[if(variables('usePrivateRegistry'), createArray(createObject('server', format('{0}.{1}', parameters('containerRegistryName'), parameters('containerRegistryHostSuffix')), 'identity', resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')))), createArray())]" + }, + "template": { + "serviceBinds": "[if(not(empty(parameters('serviceBinds'))), parameters('serviceBinds'), null())]", + "containers": [ + { + "image": "[if(not(empty(parameters('imageName'))), parameters('imageName'), 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest')]", + "name": "[parameters('containerName')]", + "env": "[parameters('env')]", + "resources": { + "cpu": "[json(parameters('containerCpuCoreCount'))]", + "memory": "[parameters('containerMemory')]" + } + } + ], + "scale": { + "minReplicas": "[parameters('containerMinReplicas')]", + "maxReplicas": "[parameters('containerMaxReplicas')]" + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', format('{0}-registry-access', deployment().name))]" + ] + }, + { + "condition": "[variables('usePrivateRegistry')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-registry-access', deployment().name)]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "containerRegistryName": { + "value": "[parameters('containerRegistryName')]" + }, + "principalId": "[if(variables('usePrivateRegistry'), createObject('value', reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId), createObject('value', ''))]" + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "17670809923773573174" + }, + "description": "Assigns ACR Pull permissions to access an Azure Container Registry." + }, + "parameters": { + "containerRegistryName": { + "type": "string" + }, + "principalId": { + "type": "string" + } + }, + "variables": { + "acrPullRole": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')]" + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('containerRegistryName'))]", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), variables('acrPullRole'))]", + "properties": { + "roleDefinitionId": "[variables('acrPullRole')]", + "principalType": "ServicePrincipal", + "principalId": "[parameters('principalId')]" + } + } + ] + } + } + } + ], + "outputs": { + "defaultDomain": { + "type": "string", + "value": "[reference(resourceId('Microsoft.App/managedEnvironments', parameters('containerAppsEnvironmentName')), '2023-05-01').defaultDomain]" + }, + "identityPrincipalId": { + "type": "string", + "value": "[if(equals(variables('normalizedIdentityType'), 'None'), '', if(empty(parameters('identityName')), reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview', 'full').identity.principalId, reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId))]" + }, + "imageName": { + "type": "string", + "value": "[parameters('imageName')]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + }, + "serviceBind": { + "type": "object", + "value": "[if(not(empty(parameters('serviceType'))), createObject('serviceId', resourceId('Microsoft.App/containerApps', parameters('name')), 'name', parameters('name')), createObject())]" + }, + "uri": { + "type": "string", + "value": "[if(parameters('ingressEnabled'), format('https://{0}', reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview').configuration.ingress.fqdn), '')]" + } + } + } + } + } + ], + "outputs": { + "defaultDomain": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.defaultDomain.value]" + }, + "imageName": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.imageName.value]" + }, + "name": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.name.value]" + }, + "uri": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.uri.value]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('keyVaultResourceGroupName')), 'Microsoft.Resources/deployments', 'web-keyvault-access')]" + ] + } + ], + "outputs": { + "SERVICE_WEB_IDENTITY_NAME": { + "type": "string", + "value": "[parameters('identityName')]" + }, + "SERVICE_WEB_IDENTITY_PRINCIPAL_ID": { + "type": "string", + "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId]" + }, + "SERVICE_WEB_IMAGE_NAME": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.imageName.value]" + }, + "SERVICE_WEB_NAME": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.name.value]" + }, + "SERVICE_WEB_URI": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.uri.value]" + } + } + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "appserviceplan", + "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('appServicePlanName'))), createObject('value', parameters('appServicePlanName')), createObject('value', format('{0}{1}', variables('abbrs').webServerFarms, variables('resourceToken'))))]", + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "sku": { + "value": { + "name": "Y1", + "tier": "Dynamic" + } + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "8289034454652170240" + }, + "description": "Creates an Azure App Service plan." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "kind": { + "type": "string", + "defaultValue": "" + }, + "reserved": { + "type": "bool", + "defaultValue": true + }, + "sku": { + "type": "object" + } + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2022-03-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "sku": "[parameters('sku')]", + "kind": "[parameters('kind')]", + "properties": { + "reserved": "[parameters('reserved')]" + } + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.Web/serverfarms', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "function", + "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('functionServiceName'))), createObject('value', parameters('functionServiceName')), createObject('value', format('{0}function-{1}', variables('abbrs').webSitesFunctions, variables('resourceToken'))))]", + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "applicationInsightsName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + }, + "appServicePlanId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'appserviceplan'), '2022-09-01').outputs.id.value]" + }, + "keyVaultName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" + }, + "storageAccountName": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.name.value]" + }, + "allowedOrigins": { + "value": [ + "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_URI.value]" + ] + }, + "appSettings": { + "value": { + "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]", + "AZURE_SEARCH_SERVICE_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]", + "AZURE_SEARCH_INDEX": "[parameters('searchIndexName')]", + "AZURE_SEARCH_SEMANTIC_RANKER": "[variables('actualSearchServiceSemanticRankerLevel')]", + "AZURE_STORAGE_BLOB_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]", + "AZURE_OPENAI_EMBEDDING_DEPLOYMENT": "[if(parameters('useAOAI'), parameters('azureEmbeddingDeploymentName'), '')]", + "OPENAI_EMBEDDING_DEPLOYMENT": "[if(parameters('useAOAI'), '', parameters('openAiEmbeddingDeployment'))]", + "AZURE_OPENAI_ENDPOINT": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value, '')]", + "USE_VISION": "[string(parameters('useVision'))]", + "USE_AOAI": "[string(parameters('useAOAI'))]", + "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", + "OPENAI_API_KEY": "[if(parameters('useAOAI'), '', parameters('openAIApiKey'))]" + } + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13325449824862561000" + } + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "allowedOrigins": { + "type": "array", + "defaultValue": [] + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "" + }, + "appServicePlanId": { + "type": "string" + }, + "appSettings": { + "type": "secureObject", + "defaultValue": {} + }, + "keyVaultName": { + "type": "string" + }, + "serviceName": { + "type": "string", + "defaultValue": "function" + }, + "storageAccountName": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-function', parameters('serviceName'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[union(parameters('tags'), createObject('azd-service-name', parameters('serviceName')))]" + }, + "allowedOrigins": { + "value": "[parameters('allowedOrigins')]" + }, + "alwaysOn": { + "value": false + }, + "appSettings": { + "value": "[parameters('appSettings')]" + }, + "applicationInsightsName": { + "value": "[parameters('applicationInsightsName')]" + }, + "appServicePlanId": { + "value": "[parameters('appServicePlanId')]" + }, + "keyVaultName": { + "value": "[parameters('keyVaultName')]" + }, + "runtimeName": { + "value": "dotnet-isolated" + }, + "runtimeVersion": { + "value": "8.0" + }, + "storageAccountName": { + "value": "[parameters('storageAccountName')]" + }, + "scmDoBuildDuringDeployment": { + "value": false + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "5436002279462752259" + }, + "description": "Creates an Azure Function in an existing Azure App Service plan." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "" + }, + "appServicePlanId": { + "type": "string" + }, + "keyVaultName": { + "type": "string", + "defaultValue": "" + }, + "managedIdentity": { + "type": "bool", + "defaultValue": "[not(empty(parameters('keyVaultName')))]" + }, + "storageAccountName": { + "type": "string" + }, + "runtimeName": { + "type": "string", + "allowedValues": [ + "dotnet", + "dotnetcore", + "dotnet-isolated", + "node", + "python", + "java", + "powershell", + "custom" + ] + }, + "runtimeNameAndVersion": { + "type": "string", + "defaultValue": "[format('{0}|{1}', parameters('runtimeName'), parameters('runtimeVersion'))]" + }, + "runtimeVersion": { + "type": "string" + }, + "extensionVersion": { + "type": "string", + "defaultValue": "~4", + "allowedValues": [ + "~4", + "~3", + "~2", + "~1" + ] + }, + "kind": { + "type": "string", + "defaultValue": "functionapp,linux" + }, + "allowedOrigins": { + "type": "array", + "defaultValue": [] + }, + "alwaysOn": { + "type": "bool", + "defaultValue": true + }, + "appCommandLine": { + "type": "string", + "defaultValue": "" + }, + "appSettings": { + "type": "secureObject", + "defaultValue": {} + }, + "clientAffinityEnabled": { + "type": "bool", + "defaultValue": false + }, + "enableOryxBuild": { + "type": "bool", + "defaultValue": "[contains(parameters('kind'), 'linux')]" + }, + "functionAppScaleLimit": { + "type": "int", + "defaultValue": -1 + }, + "linuxFxVersion": { + "type": "string", + "defaultValue": "[parameters('runtimeNameAndVersion')]" + }, + "minimumElasticInstanceCount": { + "type": "int", + "defaultValue": -1 + }, + "numberOfWorkers": { + "type": "int", + "defaultValue": -1 + }, + "scmDoBuildDuringDeployment": { + "type": "bool", + "defaultValue": true + }, + "use32BitWorkerProcess": { + "type": "bool", + "defaultValue": false + }, + "healthCheckPath": { + "type": "string", + "defaultValue": "" + } + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-functions', parameters('name'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('tags')]" + }, + "allowedOrigins": { + "value": "[parameters('allowedOrigins')]" + }, + "alwaysOn": { + "value": "[parameters('alwaysOn')]" + }, + "appCommandLine": { + "value": "[parameters('appCommandLine')]" + }, + "applicationInsightsName": { + "value": "[parameters('applicationInsightsName')]" + }, + "appServicePlanId": { + "value": "[parameters('appServicePlanId')]" + }, + "appSettings": { + "value": "[union(parameters('appSettings'), createObject('AzureWebJobsStorage', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2021-09-01').keys[0].value, environment().suffixes.storage), 'FUNCTIONS_EXTENSION_VERSION', parameters('extensionVersion'), 'FUNCTIONS_WORKER_RUNTIME', parameters('runtimeName')))]" + }, + "clientAffinityEnabled": { + "value": "[parameters('clientAffinityEnabled')]" + }, + "enableOryxBuild": { + "value": "[parameters('enableOryxBuild')]" + }, + "functionAppScaleLimit": { + "value": "[parameters('functionAppScaleLimit')]" + }, + "healthCheckPath": { + "value": "[parameters('healthCheckPath')]" + }, + "keyVaultName": { + "value": "[parameters('keyVaultName')]" + }, + "kind": { + "value": "[parameters('kind')]" + }, + "linuxFxVersion": { + "value": "[parameters('linuxFxVersion')]" + }, + "managedIdentity": { + "value": "[parameters('managedIdentity')]" + }, + "minimumElasticInstanceCount": { + "value": "[parameters('minimumElasticInstanceCount')]" + }, + "numberOfWorkers": { + "value": "[parameters('numberOfWorkers')]" + }, + "runtimeName": { + "value": "[parameters('runtimeName')]" + }, + "runtimeVersion": { + "value": "[parameters('runtimeVersion')]" + }, + "runtimeNameAndVersion": { + "value": "[parameters('runtimeNameAndVersion')]" + }, + "scmDoBuildDuringDeployment": { + "value": "[parameters('scmDoBuildDuringDeployment')]" + }, + "use32BitWorkerProcess": { + "value": "[parameters('use32BitWorkerProcess')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "15018783407009142091" + }, + "description": "Creates an Azure App Service in an existing Azure App Service plan." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "" + }, + "appServicePlanId": { + "type": "string" + }, + "keyVaultName": { + "type": "string", + "defaultValue": "" + }, + "managedIdentity": { + "type": "bool", + "defaultValue": "[not(empty(parameters('keyVaultName')))]" + }, + "runtimeName": { + "type": "string", + "allowedValues": [ + "dotnet", + "dotnetcore", + "dotnet-isolated", + "node", + "python", + "java", + "powershell", + "custom" + ] + }, + "runtimeNameAndVersion": { + "type": "string", + "defaultValue": "[format('{0}|{1}', parameters('runtimeName'), parameters('runtimeVersion'))]" + }, + "runtimeVersion": { + "type": "string" + }, + "kind": { + "type": "string", + "defaultValue": "app,linux" + }, + "allowedOrigins": { + "type": "array", + "defaultValue": [] + }, + "alwaysOn": { + "type": "bool", + "defaultValue": true + }, + "appCommandLine": { + "type": "string", + "defaultValue": "" + }, + "appSettings": { + "type": "secureObject", + "defaultValue": {} + }, + "clientAffinityEnabled": { + "type": "bool", + "defaultValue": false + }, + "enableOryxBuild": { + "type": "bool", + "defaultValue": "[contains(parameters('kind'), 'linux')]" + }, + "functionAppScaleLimit": { + "type": "int", + "defaultValue": -1 + }, + "linuxFxVersion": { + "type": "string", + "defaultValue": "[parameters('runtimeNameAndVersion')]" + }, + "minimumElasticInstanceCount": { + "type": "int", + "defaultValue": -1 + }, + "numberOfWorkers": { + "type": "int", + "defaultValue": -1 + }, + "scmDoBuildDuringDeployment": { + "type": "bool", + "defaultValue": false + }, + "use32BitWorkerProcess": { + "type": "bool", + "defaultValue": false + }, + "ftpsState": { + "type": "string", + "defaultValue": "FtpsOnly" + }, + "healthCheckPath": { + "type": "string", + "defaultValue": "" + } + }, + "resources": [ + { + "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies", + "apiVersion": "2022-03-01", + "name": "[format('{0}/{1}', parameters('name'), 'ftp')]", + "properties": { + "allow": false + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('name'))]" + ] + }, + { + "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies", + "apiVersion": "2022-03-01", + "name": "[format('{0}/{1}', parameters('name'), 'scm')]", + "properties": { + "allow": false + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('name'))]" + ] + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2022-03-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "[parameters('kind')]", + "properties": { + "serverFarmId": "[parameters('appServicePlanId')]", + "siteConfig": { + "linuxFxVersion": "[parameters('linuxFxVersion')]", + "alwaysOn": "[parameters('alwaysOn')]", + "ftpsState": "[parameters('ftpsState')]", + "minTlsVersion": "1.2", + "appCommandLine": "[parameters('appCommandLine')]", + "numberOfWorkers": "[if(not(equals(parameters('numberOfWorkers'), -1)), parameters('numberOfWorkers'), null())]", + "minimumElasticInstanceCount": "[if(not(equals(parameters('minimumElasticInstanceCount'), -1)), parameters('minimumElasticInstanceCount'), null())]", + "use32BitWorkerProcess": "[parameters('use32BitWorkerProcess')]", + "functionAppScaleLimit": "[if(not(equals(parameters('functionAppScaleLimit'), -1)), parameters('functionAppScaleLimit'), null())]", + "healthCheckPath": "[parameters('healthCheckPath')]", + "cors": { + "allowedOrigins": "[union(createArray('https://portal.azure.com', 'https://ms.portal.azure.com'), parameters('allowedOrigins'))]" + } + }, + "clientAffinityEnabled": "[parameters('clientAffinityEnabled')]", + "httpsOnly": true + }, + "identity": { + "type": "[if(parameters('managedIdentity'), 'SystemAssigned', 'None')]" + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2022-03-01", + "name": "[format('{0}/{1}', parameters('name'), 'logs')]", + "properties": { + "applicationLogs": { + "fileSystem": { + "level": "Verbose" + } + }, + "detailedErrorMessages": { + "enabled": true + }, + "failedRequestsTracing": { + "enabled": true + }, + "httpLogs": { + "fileSystem": { + "enabled": true, + "retentionInDays": 1, + "retentionInMb": 35 + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('name'))]", + "[resourceId('Microsoft.Resources/deployments', format('{0}-appSettings', parameters('name')))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "[format('{0}-appSettings', parameters('name'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('name')]" + }, + "appSettings": { + "value": "[union(parameters('appSettings'), createObject('SCM_DO_BUILD_DURING_DEPLOYMENT', string(parameters('scmDoBuildDuringDeployment')), 'ENABLE_ORYX_BUILD', string(parameters('enableOryxBuild'))), if(and(equals(parameters('runtimeName'), 'python'), equals(parameters('appCommandLine'), '')), createObject('PYTHON_ENABLE_GUNICORN_MULTIWORKERS', 'true'), createObject()), if(not(empty(parameters('applicationInsightsName'))), createObject('APPLICATIONINSIGHTS_CONNECTION_STRING', reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').ConnectionString), createObject()), if(not(empty(parameters('keyVaultName'))), createObject('AZURE_KEY_VAULT_ENDPOINT', reference(resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName')), '2022-07-01').vaultUri), createObject()))]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "8872422051335608470" + }, + "description": "Updates app settings for an Azure App Service." + }, + "parameters": { + "name": { + "type": "string", + "metadata": { + "description": "The name of the app service resource within the current resource group scope" + } + }, + "appSettings": { + "type": "secureObject", + "metadata": { + "description": "The app settings to be applied to the app service" + } + } + }, + "resources": [ + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2022-03-01", + "name": "[format('{0}/{1}', parameters('name'), 'appsettings')]", + "properties": "[parameters('appSettings')]" + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('name'))]" + ] + } + ], + "outputs": { + "identityPrincipalId": { + "type": "string", + "value": "[if(parameters('managedIdentity'), reference(resourceId('Microsoft.Web/sites', parameters('name')), '2022-03-01', 'full').identity.principalId, '')]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + }, + "uri": { + "type": "string", + "value": "[format('https://{0}', reference(resourceId('Microsoft.Web/sites', parameters('name')), '2022-03-01').defaultHostName)]" + } + } + } + } + } + ], + "outputs": { + "identityPrincipalId": { + "type": "string", + "value": "[if(parameters('managedIdentity'), reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.identityPrincipalId.value, '')]" + }, + "name": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.name.value]" + }, + "uri": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.uri.value]" + } + } + } + } + } + ], + "outputs": { + "SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.identityPrincipalId.value]" + }, + "SERVICE_FUNCTION_NAME": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.name.value]" + }, + "SERVICE_FUNCTION_URI": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.uri.value]" + } + } + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'appserviceplan')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "monitoring", + "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "includeApplicationInsights": { + "value": true + }, + "logAnalyticsName": "[if(not(empty(parameters('logAnalyticsName'))), createObject('value', parameters('logAnalyticsName')), createObject('value', format('{0}{1}', variables('abbrs').operationalInsightsWorkspaces, variables('resourceToken'))))]", + "applicationInsightsName": "[if(not(empty(parameters('applicationInsightsName'))), createObject('value', parameters('applicationInsightsName')), createObject('value', format('{0}{1}', variables('abbrs').insightsComponents, variables('resourceToken'))))]", + "applicationInsightsDashboardName": "[if(not(empty(parameters('applicationInsightsDashboardName'))), createObject('value', parameters('applicationInsightsDashboardName')), createObject('value', format('{0}{1}', variables('abbrs').portalDashboards, variables('resourceToken'))))]" + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "9649583309334040372" + }, + "description": "Creates an Application Insights instance and a Log Analytics workspace." + }, + "parameters": { + "logAnalyticsName": { + "type": "string" + }, + "includeApplicationInsights": { + "type": "bool", + "defaultValue": false + }, + "applicationInsightsName": { + "type": "string" + }, + "applicationInsightsDashboardName": { + "type": "string", + "defaultValue": "" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + } + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "loganalytics", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('logAnalyticsName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('tags')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "14042274885298020376" + }, + "description": "Creates a Log Analytics workspace." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + } + }, + "resources": [ + { + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2021-12-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "properties": { + "retentionInDays": 30, + "features": { + "searchVersion": 1 + }, + "sku": { + "name": "PerGB2018" + } + } + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + } + }, + { + "condition": "[parameters('includeApplicationInsights')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "applicationinsights", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('applicationInsightsName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('tags')]" + }, + "dashboardName": { + "value": "[parameters('applicationInsightsDashboardName')]" + }, + "logAnalyticsWorkspaceId": { + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.id.value]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "14163752244503191857" + }, + "description": "Creates an Application Insights instance based on an existing Log Analytics workspace." + }, + "parameters": { + "name": { + "type": "string" + }, + "dashboardName": { + "type": "string", + "defaultValue": "" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "logAnalyticsWorkspaceId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "web", + "properties": { + "Application_Type": "web", + "WorkspaceResourceId": "[parameters('logAnalyticsWorkspaceId')]" + } + }, + { + "condition": "[not(empty(parameters('dashboardName')))]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "application-insights-dashboard", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": { + "value": "[parameters('dashboardName')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "applicationInsightsName": { + "value": "[parameters('name')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "4772814496944658769" + }, + "description": "Creates a dashboard for an Application Insights instance." + }, + "parameters": { + "name": { + "type": "string" + }, + "applicationInsightsName": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + } + }, + "resources": [ + { + "type": "Microsoft.Portal/dashboards", + "apiVersion": "2020-09-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "properties": { + "lenses": [ + { + "order": 0, + "parts": [ + { + "position": { + "x": 0, + "y": 0, + "colSpan": 2, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "id", + "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + { + "name": "Version", + "value": "1.0" + } + ], + "type": "Extension/AppInsightsExtension/PartType/AspNetOverviewPinnedPart", + "asset": { + "idInputName": "id", + "type": "ApplicationInsights" + }, + "defaultMenuItemId": "overview" + } + }, + { + "position": { + "x": 2, + "y": 0, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "Version", + "value": "1.0" + } + ], + "type": "Extension/AppInsightsExtension/PartType/ProactiveDetectionAsyncPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }, + "defaultMenuItemId": "ProactiveDetection" + } + }, + { + "position": { + "x": 3, + "y": 0, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "ResourceId", + "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + } + ], + "type": "Extension/AppInsightsExtension/PartType/QuickPulseButtonSmallPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + } + } + }, + { + "position": { + "x": 4, + "y": 0, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "TimeContext", + "value": { + "durationMs": 86400000, + "endTime": null, + "createdTime": "2018-05-04T01:20:33.345Z", + "isInitialTime": true, + "grain": 1, + "useDashboardTimeRange": false + } + }, + { + "name": "Version", + "value": "1.0" + } + ], + "type": "Extension/AppInsightsExtension/PartType/AvailabilityNavButtonPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + } + } + }, + { + "position": { + "x": 5, + "y": 0, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "TimeContext", + "value": { + "durationMs": 86400000, + "endTime": null, + "createdTime": "2018-05-08T18:47:35.237Z", + "isInitialTime": true, + "grain": 1, + "useDashboardTimeRange": false + } + }, + { + "name": "ConfigurationId", + "value": "78ce933e-e864-4b05-a27b-71fd55a6afad" + } + ], + "type": "Extension/AppInsightsExtension/PartType/AppMapButtonPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + } + } + }, + { + "position": { + "x": 0, + "y": 1, + "colSpan": 3, + "rowSpan": 1 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": { + "content": { + "settings": { + "content": "# Usage", + "title": "", + "subtitle": "" + } + } + } + } + }, + { + "position": { + "x": 3, + "y": 1, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "TimeContext", + "value": { + "durationMs": 86400000, + "endTime": null, + "createdTime": "2018-05-04T01:22:35.782Z", + "isInitialTime": true, + "grain": 1, + "useDashboardTimeRange": false + } + } + ], + "type": "Extension/AppInsightsExtension/PartType/UsageUsersOverviewPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + } + } + }, + { + "position": { + "x": 4, + "y": 1, + "colSpan": 3, + "rowSpan": 1 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": { + "content": { + "settings": { + "content": "# Reliability", + "title": "", + "subtitle": "" + } + } + } + } + }, + { + "position": { + "x": 7, + "y": 1, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ResourceId", + "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + { + "name": "DataModel", + "value": { + "version": "1.0.0", + "timeContext": { + "durationMs": 86400000, + "createdTime": "2018-05-04T23:42:40.072Z", + "isInitialTime": false, + "grain": 1, + "useDashboardTimeRange": false + } + }, + "isOptional": true + }, + { + "name": "ConfigurationId", + "value": "8a02f7bf-ac0f-40e1-afe9-f0e72cfee77f", + "isOptional": true + } + ], + "type": "Extension/AppInsightsExtension/PartType/CuratedBladeFailuresPinnedPart", + "isAdapter": true, + "asset": { + "idInputName": "ResourceId", + "type": "ApplicationInsights" + }, + "defaultMenuItemId": "failures" + } + }, + { + "position": { + "x": 8, + "y": 1, + "colSpan": 3, + "rowSpan": 1 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": { + "content": { + "settings": { + "content": "# Responsiveness\r\n", + "title": "", + "subtitle": "" + } + } + } + } + }, + { + "position": { + "x": 11, + "y": 1, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ResourceId", + "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + { + "name": "DataModel", + "value": { + "version": "1.0.0", + "timeContext": { + "durationMs": 86400000, + "createdTime": "2018-05-04T23:43:37.804Z", + "isInitialTime": false, + "grain": 1, + "useDashboardTimeRange": false + } + }, + "isOptional": true + }, + { + "name": "ConfigurationId", + "value": "2a8ede4f-2bee-4b9c-aed9-2db0e8a01865", + "isOptional": true + } + ], + "type": "Extension/AppInsightsExtension/PartType/CuratedBladePerformancePinnedPart", + "isAdapter": true, + "asset": { + "idInputName": "ResourceId", + "type": "ApplicationInsights" + }, + "defaultMenuItemId": "performance" + } + }, + { + "position": { + "x": 12, + "y": 1, + "colSpan": 3, + "rowSpan": 1 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": { + "content": { + "settings": { + "content": "# Browser", + "title": "", + "subtitle": "" + } + } + } + } + }, + { + "position": { + "x": 15, + "y": 1, + "colSpan": 1, + "rowSpan": 1 + }, + "metadata": { + "inputs": [ + { + "name": "ComponentId", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "MetricsExplorerJsonDefinitionId", + "value": "BrowserPerformanceTimelineMetrics" + }, + { + "name": "TimeContext", + "value": { + "durationMs": 86400000, + "createdTime": "2018-05-08T12:16:27.534Z", + "isInitialTime": false, + "grain": 1, + "useDashboardTimeRange": false + } + }, + { + "name": "CurrentFilter", + "value": { + "eventTypes": [ + 4, + 1, + 3, + 5, + 2, + 6, + 13 + ], + "typeFacets": {}, + "isPermissive": false + } + }, + { + "name": "id", + "value": { + "Name": "[parameters('applicationInsightsName')]", + "SubscriptionId": "[subscription().subscriptionId]", + "ResourceGroup": "[resourceGroup().name]" + } + }, + { + "name": "Version", + "value": "1.0" + } + ], + "type": "Extension/AppInsightsExtension/PartType/MetricsExplorerBladePinnedPart", + "asset": { + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }, + "defaultMenuItemId": "browser" + } + }, + { + "position": { + "x": 0, + "y": 2, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "sessions/count", + "aggregationType": 5, + "namespace": "microsoft.insights/components/kusto", + "metricVisualization": { + "displayName": "Sessions", + "color": "#47BDF5" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "users/count", + "aggregationType": 5, + "namespace": "microsoft.insights/components/kusto", + "metricVisualization": { + "displayName": "Users", + "color": "#7E58FF" + } + } + ], + "title": "Unique sessions and users", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + }, + "openBladeOnClick": { + "openBlade": true, + "destinationBlade": { + "extensionName": "HubsExtension", + "bladeName": "ResourceMenuBlade", + "parameters": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", + "menuid": "segmentationUsers" + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 4, + "y": 2, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "requests/failed", + "aggregationType": 7, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Failed requests", + "color": "#EC008C" + } + } + ], + "title": "Failed requests", + "visualization": { + "chartType": 3, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + }, + "openBladeOnClick": { + "openBlade": true, + "destinationBlade": { + "extensionName": "HubsExtension", + "bladeName": "ResourceMenuBlade", + "parameters": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", + "menuid": "failures" + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 8, + "y": 2, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "requests/duration", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Server response time", + "color": "#00BCF2" + } + } + ], + "title": "Server response time", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + }, + "openBladeOnClick": { + "openBlade": true, + "destinationBlade": { + "extensionName": "HubsExtension", + "bladeName": "ResourceMenuBlade", + "parameters": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", + "menuid": "performance" + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 12, + "y": 2, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "browserTimings/networkDuration", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Page load network connect time", + "color": "#7E58FF" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "browserTimings/processingDuration", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Client processing time", + "color": "#44F1C8" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "browserTimings/sendDuration", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Send request time", + "color": "#EB9371" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "browserTimings/receiveDuration", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Receiving response time", + "color": "#0672F1" + } + } + ], + "title": "Average page load time breakdown", + "visualization": { + "chartType": 3, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 0, + "y": 5, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "availabilityResults/availabilityPercentage", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Availability", + "color": "#47BDF5" + } + } + ], + "title": "Average availability", + "visualization": { + "chartType": 3, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + }, + "openBladeOnClick": { + "openBlade": true, + "destinationBlade": { + "extensionName": "HubsExtension", + "bladeName": "ResourceMenuBlade", + "parameters": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", + "menuid": "availability" + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 4, + "y": 5, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "exceptions/server", + "aggregationType": 7, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Server exceptions", + "color": "#47BDF5" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "dependencies/failed", + "aggregationType": 7, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Dependency failures", + "color": "#7E58FF" + } + } + ], + "title": "Server exceptions and Dependency failures", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 8, + "y": 5, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "performanceCounters/processorCpuPercentage", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Processor time", + "color": "#47BDF5" + } + }, + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "performanceCounters/processCpuPercentage", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Process CPU", + "color": "#7E58FF" + } + } + ], + "title": "Average processor and process CPU utilization", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 12, + "y": 5, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "exceptions/browser", + "aggregationType": 7, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Browser exceptions", + "color": "#47BDF5" + } + } + ], + "title": "Browser exceptions", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 0, + "y": 8, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "availabilityResults/count", + "aggregationType": 7, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Availability test results count", + "color": "#47BDF5" + } + } + ], + "title": "Availability test results count", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 4, + "y": 8, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "performanceCounters/processIOBytesPerSecond", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Process IO rate", + "color": "#47BDF5" + } + } + ], + "title": "Average process I/O rate", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + }, + { + "position": { + "x": 8, + "y": 8, + "colSpan": 4, + "rowSpan": 3 + }, + "metadata": { + "inputs": [ + { + "name": "options", + "value": { + "chart": { + "metrics": [ + { + "resourceMetadata": { + "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" + }, + "name": "performanceCounters/memoryAvailableBytes", + "aggregationType": 4, + "namespace": "microsoft.insights/components", + "metricVisualization": { + "displayName": "Available memory", + "color": "#47BDF5" + } + } + ], + "title": "Average available memory", + "visualization": { + "chartType": 2, + "legendVisualization": { + "isVisible": true, + "position": 2, + "hideSubtitle": false + }, + "axisVisualization": { + "x": { + "isVisible": true, + "axisType": 2 + }, + "y": { + "isVisible": true, + "axisType": 1 + } + } + } + } + } + }, + { + "name": "sharedTimeRange", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/MonitorChartPart", + "settings": {} + } + } + ] + } + ] + } + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Insights/components', parameters('name'))]" + ] + } + ], + "outputs": { + "connectionString": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Insights/components', parameters('name')), '2020-02-02').ConnectionString]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.Insights/components', parameters('name'))]" + }, + "instrumentationKey": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Insights/components', parameters('name')), '2020-02-02').InstrumentationKey]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', 'loganalytics')]" + ] + } + ], + "outputs": { + "applicationInsightsConnectionString": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.connectionString.value]" + }, + "applicationInsightsId": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.id.value]" + }, + "applicationInsightsInstrumentationKey": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.instrumentationKey.value]" + }, + "applicationInsightsName": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.name.value]" + }, + "logAnalyticsWorkspaceId": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.id.value]" + }, + "logAnalyticsWorkspaceName": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.name.value]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useAOAI')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "openai", + "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('openAiServiceName'))), createObject('value', parameters('openAiServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesAccounts, variables('resourceToken'))))]", + "location": { + "value": "[parameters('openAiResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "sku": { + "value": { + "name": "[parameters('openAiSkuName')]" + } + }, + "deployments": { + "value": "[concat(createArray(createObject('name', parameters('azureEmbeddingDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureEmbeddingModelName'), 'version', '2'), 'sku', createObject('name', 'Standard', 'capacity', parameters('embeddingDeploymentCapacity')))), if(parameters('useVision'), createArray(createObject('name', parameters('azureChatGptDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIChatGptModelName'), 'version', '2024-05-13'), 'sku', createObject('name', 'Standard', 'capacity', parameters('chatGptDeploymentCapacity')))), createArray(createObject('name', parameters('azureChatGptDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIChatGptModelName'), 'version', parameters('azureOpenAIChatGptModelVersion')), 'sku', createObject('name', 'Standard', 'capacity', parameters('chatGptDeploymentCapacity'))))))]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13725164836340477772" + }, + "description": "Creates an Azure Cognitive Services instance." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "customSubDomainName": { + "type": "string", + "defaultValue": "[parameters('name')]", + "metadata": { + "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." + } + }, + "deployments": { + "type": "array", + "defaultValue": [] + }, + "kind": { + "type": "string", + "defaultValue": "OpenAI" + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "allowedValues": [ + "Enabled", + "Disabled" + ] + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "S0" + } + }, + "allowedIpRules": { + "type": "array", + "defaultValue": [] + }, + "networkAcls": { + "type": "object", + "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" + } + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2023-05-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "[parameters('kind')]", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "customSubDomainName": "[parameters('customSubDomainName')]", + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "networkAcls": "[parameters('networkAcls')]", + "disableLocalAuth": true + }, + "sku": "[parameters('sku')]" + }, + { + "copy": { + "name": "deployment", + "count": "[length(parameters('deployments'))]", + "mode": "serial", + "batchSize": 1 + }, + "type": "Microsoft.CognitiveServices/accounts/deployments", + "apiVersion": "2023-05-01", + "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", + "properties": { + "model": "[parameters('deployments')[copyIndex()].model]", + "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" + }, + "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + ] + } + ], + "outputs": { + "endpoint": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" + }, + "endpoints": { + "type": "object", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useVision')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "computerVision", + "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('computerVisionServiceName'))), createObject('value', parameters('computerVisionServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesComputerVision, variables('resourceToken'))))]", + "kind": { + "value": "ComputerVision" + }, + "location": { + "value": "[parameters('computerVisionResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "sku": { + "value": { + "name": "[parameters('computerVisionSkuName')]" + } + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13725164836340477772" + }, + "description": "Creates an Azure Cognitive Services instance." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "customSubDomainName": { + "type": "string", + "defaultValue": "[parameters('name')]", + "metadata": { + "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." + } + }, + "deployments": { + "type": "array", + "defaultValue": [] + }, + "kind": { + "type": "string", + "defaultValue": "OpenAI" + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "allowedValues": [ + "Enabled", + "Disabled" + ] + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "S0" + } + }, + "allowedIpRules": { + "type": "array", + "defaultValue": [] + }, + "networkAcls": { + "type": "object", + "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" + } + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2023-05-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "[parameters('kind')]", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "customSubDomainName": "[parameters('customSubDomainName')]", + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "networkAcls": "[parameters('networkAcls')]", + "disableLocalAuth": true + }, + "sku": "[parameters('sku')]" + }, + { + "copy": { + "name": "deployment", + "count": "[length(parameters('deployments'))]", + "mode": "serial", + "batchSize": 1 + }, + "type": "Microsoft.CognitiveServices/accounts/deployments", + "apiVersion": "2023-05-01", + "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", + "properties": { + "model": "[parameters('deployments')[copyIndex()].model]", + "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" + }, + "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + ] + } + ], + "outputs": { + "endpoint": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" + }, + "endpoints": { + "type": "object", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "formrecognizer", + "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('formRecognizerServiceName'))), createObject('value', parameters('formRecognizerServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesFormRecognizer, variables('resourceToken'))))]", + "kind": { + "value": "FormRecognizer" + }, + "location": { + "value": "[parameters('formRecognizerResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "sku": { + "value": { + "name": "[parameters('formRecognizerSkuName')]" + } + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13725164836340477772" + }, + "description": "Creates an Azure Cognitive Services instance." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "customSubDomainName": { + "type": "string", + "defaultValue": "[parameters('name')]", + "metadata": { + "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." + } + }, + "deployments": { + "type": "array", + "defaultValue": [] + }, + "kind": { + "type": "string", + "defaultValue": "OpenAI" + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "allowedValues": [ + "Enabled", + "Disabled" + ] + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "S0" + } + }, + "allowedIpRules": { + "type": "array", + "defaultValue": [] + }, + "networkAcls": { + "type": "object", + "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" + } + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2023-05-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "[parameters('kind')]", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "customSubDomainName": "[parameters('customSubDomainName')]", + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "networkAcls": "[parameters('networkAcls')]", + "disableLocalAuth": true + }, + "sku": "[parameters('sku')]" + }, + { + "copy": { + "name": "deployment", + "count": "[length(parameters('deployments'))]", + "mode": "serial", + "batchSize": 1 + }, + "type": "Microsoft.CognitiveServices/accounts/deployments", + "apiVersion": "2023-05-01", + "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", + "properties": { + "model": "[parameters('deployments')[copyIndex()].model]", + "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" + }, + "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + ] + } + ], + "outputs": { + "endpoint": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" + }, + "endpoints": { + "type": "object", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" + }, + "id": { + "type": "string", + "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-service", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('searchServiceName'))), createObject('value', parameters('searchServiceName')), createObject('value', format('gptkb-{0}', variables('resourceToken'))))]", + "location": { + "value": "[parameters('searchServiceResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "authOptions": { + "value": { + "aadOrApiKey": { + "aadAuthFailureMode": "http401WithBearerChallenge" + } + } + }, + "sku": { + "value": { + "name": "[parameters('searchServiceSkuName')]" + } + }, + "semanticSearch": { + "value": "[variables('actualSearchServiceSemanticRankerLevel')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "17661970536534412467" + }, + "description": "Creates an Azure AI Search instance." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "standard" + } + }, + "authOptions": { + "type": "object", + "defaultValue": {} + }, + "disableLocalAuth": { + "type": "bool", + "defaultValue": false + }, + "disabledDataExfiltrationOptions": { + "type": "array", + "defaultValue": [] + }, + "encryptionWithCmk": { + "type": "object", + "defaultValue": { + "enforcement": "Unspecified" + } + }, + "hostingMode": { + "type": "string", + "defaultValue": "default", + "allowedValues": [ + "default", + "highDensity" + ] + }, + "networkRuleSet": { + "type": "object", + "defaultValue": { + "bypass": "None", + "ipRules": [] + } + }, + "partitionCount": { + "type": "int", + "defaultValue": 1 + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "enabled", + "allowedValues": [ + "enabled", + "disabled" + ] + }, + "replicaCount": { + "type": "int", + "defaultValue": 1 + }, + "semanticSearch": { + "type": "string", + "defaultValue": "disabled", + "allowedValues": [ + "disabled", + "free", + "standard" + ] + } + }, + "variables": { + "searchIdentityProvider": "[if(equals(parameters('sku').name, 'free'), null(), createObject('type', 'SystemAssigned'))]" + }, + "resources": [ + { + "type": "Microsoft.Search/searchServices", + "apiVersion": "2021-04-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "identity": "[variables('searchIdentityProvider')]", + "properties": { + "authOptions": "[if(parameters('disableLocalAuth'), null(), parameters('authOptions'))]", + "disableLocalAuth": "[parameters('disableLocalAuth')]", + "disabledDataExfiltrationOptions": "[parameters('disabledDataExfiltrationOptions')]", + "encryptionWithCmk": "[parameters('encryptionWithCmk')]", + "hostingMode": "[parameters('hostingMode')]", + "networkRuleSet": "[parameters('networkRuleSet')]", + "partitionCount": "[parameters('partitionCount')]", + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "replicaCount": "[parameters('replicaCount')]", + "semanticSearch": "[parameters('semanticSearch')]" + }, + "sku": "[parameters('sku')]" + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.Search/searchServices', parameters('name'))]" + }, + "endpoint": { + "type": "string", + "value": "[format('https://{0}.search.windows.net/', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + }, + "principalId": { + "type": "string", + "value": "[if(not(empty(variables('searchIdentityProvider'))), reference(resourceId('Microsoft.Search/searchServices', parameters('name')), '2021-04-01-preview', 'full').identity.principalId, '')]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "name": "[if(not(empty(parameters('storageAccountName'))), createObject('value', parameters('storageAccountName')), createObject('value', format('{0}{1}', variables('abbrs').storageStorageAccounts, variables('resourceToken'))))]", + "location": { + "value": "[parameters('storageResourceGroupLocation')]" + }, + "tags": { + "value": "[variables('updatedTags')]" + }, + "publicNetworkAccess": { + "value": "Enabled" + }, + "allowBlobPublicAccess": { + "value": false + }, + "allowSharedKeyAccess": { + "value": false + }, + "defaultToOAuthAuthentication": { + "value": true + }, + "sku": { + "value": { + "name": "Standard_LRS" + } + }, + "deleteRetentionPolicy": { + "value": { + "enabled": true, + "days": 2 + } + }, + "containers": { + "value": [ + { + "name": "[parameters('storageContainerName')]", + "publicAccess": "None" + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "13643245339099960210" + }, + "description": "Creates an Azure storage account." + }, + "parameters": { + "name": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "accessTier": { + "type": "string", + "defaultValue": "Hot", + "allowedValues": [ + "Cool", + "Hot", + "Premium" + ] + }, + "allowBlobPublicAccess": { + "type": "bool", + "defaultValue": true + }, + "allowCrossTenantReplication": { + "type": "bool", + "defaultValue": true + }, + "allowSharedKeyAccess": { + "type": "bool", + "defaultValue": true + }, + "containers": { + "type": "array", + "defaultValue": [] + }, + "corsRules": { + "type": "array", + "defaultValue": [] + }, + "defaultToOAuthAuthentication": { + "type": "bool", + "defaultValue": false + }, + "deleteRetentionPolicy": { + "type": "object", + "defaultValue": {} + }, + "dnsEndpointType": { + "type": "string", + "defaultValue": "Standard", + "allowedValues": [ + "AzureDnsZone", + "Standard" + ] + }, + "files": { + "type": "array", + "defaultValue": [] + }, + "kind": { + "type": "string", + "defaultValue": "StorageV2" + }, + "minimumTlsVersion": { + "type": "string", + "defaultValue": "TLS1_2" + }, + "queues": { + "type": "array", + "defaultValue": [] + }, + "shareDeleteRetentionPolicy": { + "type": "object", + "defaultValue": {} + }, + "supportsHttpsTrafficOnly": { + "type": "bool", + "defaultValue": true + }, + "tables": { + "type": "array", + "defaultValue": [] + }, + "networkAcls": { + "type": "object", + "defaultValue": { + "bypass": "AzureServices", + "defaultAction": "Allow" + } + }, + "publicNetworkAccess": { + "type": "string", + "defaultValue": "Enabled", + "allowedValues": [ + "Enabled", + "Disabled" + ] + }, + "sku": { + "type": "object", + "defaultValue": { + "name": "Standard_LRS" + } + } + }, + "resources": [ + { + "copy": { + "name": "storage::blobServices::container", + "count": "[length(parameters('containers'))]" + }, + "condition": "[not(empty(parameters('containers')))]", + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}/{2}', parameters('name'), 'default', parameters('containers')[copyIndex()].name)]", + "properties": { + "publicAccess": "[coalesce(tryGet(parameters('containers')[copyIndex()], 'publicAccess'), 'None')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('name'), 'default')]" + ] + }, + { + "copy": { + "name": "storage::queueServices::queue", + "count": "[length(parameters('queues'))]" + }, + "condition": "[not(empty(parameters('queues')))]", + "type": "Microsoft.Storage/storageAccounts/queueServices/queues", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}/{2}', parameters('name'), 'default', parameters('queues')[copyIndex()].name)]", + "properties": { + "metadata": {} + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts/queueServices', parameters('name'), 'default')]" + ] + }, + { + "condition": "[not(empty(parameters('containers')))]", + "type": "Microsoft.Storage/storageAccounts/blobServices", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}', parameters('name'), 'default')]", + "properties": { + "cors": { + "corsRules": "[parameters('corsRules')]" + }, + "deleteRetentionPolicy": "[parameters('deleteRetentionPolicy')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" + ] + }, + { + "condition": "[not(empty(parameters('files')))]", + "type": "Microsoft.Storage/storageAccounts/fileServices", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}', parameters('name'), 'default')]", + "properties": { + "cors": { + "corsRules": "[parameters('corsRules')]" + }, + "shareDeleteRetentionPolicy": "[parameters('shareDeleteRetentionPolicy')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" + ] + }, + { + "condition": "[not(empty(parameters('queues')))]", + "type": "Microsoft.Storage/storageAccounts/queueServices", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}', parameters('name'), 'default')]", + "properties": {}, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" + ] + }, + { + "condition": "[not(empty(parameters('tables')))]", + "type": "Microsoft.Storage/storageAccounts/tableServices", + "apiVersion": "2023-01-01", + "name": "[format('{0}/{1}', parameters('name'), 'default')]", + "properties": {}, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" + ] + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2023-01-01", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "kind": "[parameters('kind')]", + "sku": "[parameters('sku')]", + "properties": { + "accessTier": "[parameters('accessTier')]", + "allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]", + "allowCrossTenantReplication": "[parameters('allowCrossTenantReplication')]", + "allowSharedKeyAccess": "[parameters('allowSharedKeyAccess')]", + "defaultToOAuthAuthentication": "[parameters('defaultToOAuthAuthentication')]", + "dnsEndpointType": "[parameters('dnsEndpointType')]", + "minimumTlsVersion": "[parameters('minimumTlsVersion')]", + "networkAcls": "[parameters('networkAcls')]", + "publicNetworkAccess": "[parameters('publicNetworkAccess')]", + "supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]" + } + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" + }, + "name": { + "type": "string", + "value": "[parameters('name')]" + }, + "primaryEndpoints": { + "type": "object", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '2023-01-01').primaryEndpoints]" + } + } + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useAOAI')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "openai-role-user", + "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "formrecognizer-role-user", + "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "a97b65f3-24c7-4388-baec-2e87135dc908" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-role-user", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-contribrole-user", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-role-user", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-contrib-role-user", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "8ebe5a00-799e-43f5-93ac-243d3dce84a7" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-svccontrib-role-user", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "7ca78c08-252a-4471-8644-bb5ff32d4ba0" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useVision')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "vision-role-user", + "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[parameters('principalId')]" + }, + "roleDefinitionId": { + "value": "a97b65f3-24c7-4388-baec-2e87135dc908" + }, + "principalType": { + "value": "[parameters('principalType')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useAOAI')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "openai-role-function", + "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "formrecognizer-role-function", + "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "a97b65f3-24c7-4388-baec-2e87135dc908" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-role-function", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-contribrole-function", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-role-function", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-contrib-role-function", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "8ebe5a00-799e-43f5-93ac-243d3dce84a7" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-svccontrib-role-function", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "7ca78c08-252a-4471-8644-bb5ff32d4ba0" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useVision')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "vision-role-function", + "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "a97b65f3-24c7-4388-baec-2e87135dc908" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + ] + }, + { + "condition": "[parameters('useAOAI')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "openai-role-backend", + "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-role-backend", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "storage-contribrole-backend", + "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "search-role-backend", + "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + }, + { + "condition": "[parameters('useVision')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "vision-role-backend", + "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "principalId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" + }, + "roleDefinitionId": { + "value": "a97b65f3-24c7-4388-baec-2e87135dc908" + }, + "principalType": { + "value": "ServicePrincipal" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.36.1.42791", + "templateHash": "1525080529756490231" + }, + "description": "Creates a role assignment for a service principal." + }, + "parameters": { + "principalId": { + "type": "string" + }, + "principalType": { + "type": "string", + "defaultValue": "ServicePrincipal", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ] + }, + "roleDefinitionId": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", + "properties": { + "principalId": "[parameters('principalId')]", + "principalType": "[parameters('principalType')]", + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" + } + } + ] + } + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" + ] + } + ], + "outputs": { + "APPLICATIONINSIGHTS_CONNECTION_STRING": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsConnectionString.value]" + }, + "APPLICATIONINSIGHTS_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" + }, + "AZURE_USE_APPLICATION_INSIGHTS": { + "type": "bool", + "value": "[parameters('useApplicationInsights')]" + }, + "AZURE_CONTAINER_ENVIRONMENT_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.environmentName.value]" + }, + "AZURE_CONTAINER_REGISTRY_ENDPOINT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryLoginServer.value]" + }, + "AZURE_CONTAINER_REGISTRY_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" + }, + "AZURE_CONTAINER_REGISTRY_RESOURCE_GROUP": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" + }, + "AZURE_FORMRECOGNIZER_RESOURCE_GROUP": { + "type": "string", + "value": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + }, + "AZURE_FORMRECOGNIZER_SERVICE": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.name.value]" + }, + "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]" + }, + "AZURE_COMPUTERVISION_RESOURCE_GROUP": { + "type": "string", + "value": "[if(parameters('useVision'), if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), '')]" + }, + "AZURE_COMPUTERVISION_SERVICE": { + "type": "string", + "value": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value, '')]" + }, + "AZURE_COMPUTERVISION_SERVICE_ENDPOINT": { + "type": "string", + "value": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]" + }, + "AZURE_KEY_VAULT_ENDPOINT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.endpoint.value]" + }, + "AZURE_KEY_VAULT_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" + }, + "AZURE_KEY_VAULT_RESOURCE_GROUP": { + "type": "string", + "value": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + }, + "AZURE_LOCATION": { + "type": "string", + "value": "[parameters('location')]" + }, + "AZURE_OPENAI_RESOURCE_LOCATION": { + "type": "string", + "value": "[parameters('openAiResourceGroupLocation')]" + }, + "AZURE_OPENAI_CHATGPT_DEPLOYMENT": { + "type": "string", + "value": "[parameters('azureChatGptDeploymentName')]" + }, + "AZURE_OPENAI_EMBEDDING_DEPLOYMENT": { + "type": "string", + "value": "[parameters('azureEmbeddingDeploymentName')]" + }, + "AZURE_OPENAI_ENDPOINT": { + "type": "string", + "value": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value, '')]" + }, + "AZURE_OPENAI_RESOURCE_GROUP": { + "type": "string", + "value": "[if(parameters('useAOAI'), if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), '')]" + }, + "AZURE_OPENAI_SERVICE": { + "type": "string", + "value": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.name.value, '')]" + }, + "AZURE_RESOURCE_GROUP": { + "type": "string", + "value": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]" + }, + "AZURE_SEARCH_INDEX": { + "type": "string", + "value": "[parameters('searchIndexName')]" + }, + "AZURE_SEARCH_SERVICE": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.name.value]" + }, + "AZURE_SEARCH_SERVICE_ENDPOINT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]" + }, + "AZURE_SEARCH_SERVICE_RESOURCE_GROUP": { + "type": "string", + "value": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + }, + "AZURE_SEARCH_SERVICE_SKU": { + "type": "string", + "value": "[parameters('searchServiceSkuName')]" + }, + "AZURE_STORAGE_ACCOUNT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.name.value]" + }, + "AZURE_STORAGE_BLOB_ENDPOINT": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]" + }, + "AZURE_STORAGE_CONTAINER": { + "type": "string", + "value": "[parameters('storageContainerName')]" + }, + "AZURE_STORAGE_RESOURCE_GROUP": { + "type": "string", + "value": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" + }, + "AZURE_TENANT_ID": { + "type": "string", + "value": "[tenant().tenantId]" + }, + "SERVICE_WEB_IDENTITY_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_NAME.value]" + }, + "SERVICE_WEB_NAME": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_NAME.value]" + }, + "SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID": { + "type": "string", + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" + }, + "USE_AOAI": { + "type": "bool", + "value": "[parameters('useAOAI')]" + }, + "USE_VISION": { + "type": "bool", + "value": "[parameters('useVision')]" + }, + "OPENAI_EMBEDDING_DEPLOYMENT": { + "type": "string", + "value": "[parameters('openAiEmbeddingDeployment')]" + }, + "AZURE_OPENAI_CHATGPT_MODEL_VERSION": { + "type": "string", + "value": "[parameters('azureOpenAIChatGptModelVersion')]" + }, + "AZURE_OPENAI_CHATGPT_MODEL_NAME": { + "type": "string", + "value": "[parameters('azureOpenAIChatGptModelName')]" + } + } +} \ No newline at end of file From 7080a1edb281acea9395aa713462f355abbe708b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:13:59 +0000 Subject: [PATCH 4/4] Remove compiled Bicep output file and update gitignore Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> --- .gitignore | 5 + infra/main.json | 7432 ----------------------------------------------- 2 files changed, 5 insertions(+), 7432 deletions(-) delete mode 100644 infra/main.json diff --git a/.gitignore b/.gitignore index 7f9f6e57..89a2fa7e 100644 --- a/.gitignore +++ b/.gitignore @@ -483,3 +483,8 @@ env/ venv/ myvenv/ ENV/ + +# Bicep compiled outputs +infra/**/*.json +!infra/main.parameters.json +!infra/abbreviations.json diff --git a/infra/main.json b/infra/main.json deleted file mode 100644 index 6dd10f40..00000000 --- a/infra/main.json +++ /dev/null @@ -1,7432 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "15076630820646909091" - } - }, - "parameters": { - "environmentName": { - "type": "string", - "minLength": 1, - "maxLength": 64, - "metadata": { - "description": "Name of the environment used to generate a short unique hash for resources." - } - }, - "location": { - "type": "string", - "allowedValues": [ - "centralus", - "eastus2", - "eastasia", - "westus", - "westeurope", - "westus2", - "australiaeast", - "eastus", - "francecentral", - "japaneast", - "nortcentralus", - "swedencentral", - "switzerlandnorth", - "uksouth" - ], - "metadata": { - "description": "Primary location for all resources" - } - }, - "tags": { - "type": "string", - "defaultValue": "" - }, - "openAiResourceGroupLocation": { - "type": "string", - "allowedValues": [ - "canadaeast", - "westus", - "eastus", - "eastus2", - "francecentral", - "swedencentral", - "switzerlandnorth", - "uksouth", - "japaneast", - "northcentralus", - "australiaeast" - ], - "metadata": { - "azd": { - "type": "location" - }, - "description": "Location for the OpenAI resource group" - } - }, - "azureOpenAIChatGptModelName": { - "type": "string", - "defaultValue": "gpt-4o-mini", - "allowedValues": [ - "gpt-35-turbo", - "gpt-4", - "gpt-4o", - "gpt-4o-mini", - "gpt-35-turbo-16k", - "gpt-4-16k" - ], - "metadata": { - "description": "Name of the chat GPT model. Default: gpt-35-turbo" - } - }, - "azureOpenAIChatGptModelVersion": { - "type": "string", - "defaultValue": "2024-07-18", - "allowedValues": [ - "0613", - "2024-07-18" - ], - "metadata": { - "description": "Name of the chat GPT model. Default: 0613 for gpt-35-turbo, or choose 2024-07-18 for gpt-4o-mini" - } - }, - "useApplicationInsights": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Defines if the process will deploy an Azure Application Insights resource" - } - }, - "applicationInsightsDashboardName": { - "type": "string", - "defaultValue": "" - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure Application Insights resource" - } - }, - "appServicePlanName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure App Service Plan" - } - }, - "chatGptDeploymentCapacity": { - "type": "int", - "defaultValue": 8, - "metadata": { - "description": "Capacity of the chat GPT deployment. Default: 10" - } - }, - "azureChatGptDeploymentName": { - "type": "string", - "defaultValue": "chat", - "metadata": { - "description": "Name of the chat GPT deployment" - } - }, - "computerVisionServiceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure Cognitive Services Computer Vision service" - } - }, - "computerVisionResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the Azure Cognitive Services Computer Vision service" - } - }, - "computerVisionResourceGroupLocation": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "Location of the resource group for the Azure Cognitive Services Computer Vision service" - } - }, - "computerVisionSkuName": { - "type": "string", - "defaultValue": "S1", - "metadata": { - "description": "SKU name for the Azure Cognitive Services Computer Vision service. Default: S1" - } - }, - "azureEmbeddingDeploymentName": { - "type": "string", - "defaultValue": "embedding", - "metadata": { - "description": "Name of the embedding deployment. Default: embedding" - } - }, - "embeddingDeploymentCapacity": { - "type": "int", - "defaultValue": 30, - "metadata": { - "description": "Capacity of the embedding deployment. Default: 30" - } - }, - "azureEmbeddingModelName": { - "type": "string", - "defaultValue": "text-embedding-ada-002", - "metadata": { - "description": "Name of the embedding model. Default: text-embedding-ada-002" - } - }, - "containerAppsEnvironmentName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the container apps environment" - } - }, - "containerRegistryName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure container registry" - } - }, - "containerRegistryResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the Azure container registry" - } - }, - "formRecognizerResourceGroupLocation": { - "type": "string", - "defaultValue": "[parameters('location')]", - "metadata": { - "description": "Location of the resource group for the Azure AI Document Intelligence service" - } - }, - "formRecognizerResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the Azure AI Document Intelligence service" - } - }, - "formRecognizerServiceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure AI Document Intelligence service" - } - }, - "formRecognizerSkuName": { - "type": "string", - "defaultValue": "S0", - "allowedValues": [ - "S0", - "F0" - ], - "metadata": { - "description": "SKU name for the Azure AI Document Intelligence service. Default: S0" - } - }, - "functionServiceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure Function App" - } - }, - "keyVaultName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure Key Vault" - } - }, - "keyVaultResourceGroupLocation": { - "type": "string", - "defaultValue": "[parameters('location')]", - "metadata": { - "description": "Location of the resource group for the Azure Key Vault" - } - }, - "keyVaultResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the Azure Key Vault" - } - }, - "logAnalyticsName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure Log Analytics workspace" - } - }, - "openAiResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the OpenAI resources" - } - }, - "openAiServiceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the OpenAI service" - } - }, - "openAiSkuName": { - "type": "string", - "defaultValue": "S0", - "metadata": { - "description": "SKU name for the OpenAI service. Default: S0" - } - }, - "principalId": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "ID of the principal" - } - }, - "principalType": { - "type": "string", - "defaultValue": "User", - "metadata": { - "description": "Type of the principal. Valid values: User,ServicePrincipal" - } - }, - "resourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group" - } - }, - "searchIndexName": { - "type": "string", - "defaultValue": "gptkbindex", - "metadata": { - "description": "Name of the search index. Default: gptkbindex" - } - }, - "searchServiceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Azure AI Search service" - } - }, - "searchServiceResourceGroupLocation": { - "type": "string", - "defaultValue": "[parameters('location')]", - "metadata": { - "description": "Location of the resource group for the Azure AI Search service" - } - }, - "searchServiceResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the Azure AI Search service" - } - }, - "searchServiceSemanticRankerLevel": { - "type": "string", - "metadata": { - "description": "Azure AI Search Semantic Ranker Level" - } - }, - "searchServiceSkuName": { - "type": "string", - "defaultValue": "standard", - "metadata": { - "description": "SKU name for the Azure AI Search service. Default: standard" - } - }, - "storageAccountName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the storage account" - } - }, - "storageContainerName": { - "type": "string", - "defaultValue": "content", - "metadata": { - "description": "Name of the storage container. Default: content" - } - }, - "storageResourceGroupLocation": { - "type": "string", - "defaultValue": "[parameters('location')]", - "metadata": { - "description": "Location of the resource group for the storage account" - } - }, - "storageResourceGroupName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the resource group for the storage account" - } - }, - "webAppExists": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Specifies if the web app exists" - } - }, - "webContainerAppName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the web app container" - } - }, - "webIdentityName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the web app identity" - } - }, - "webImageName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the web app image" - } - }, - "useAOAI": { - "type": "bool", - "metadata": { - "description": "Use Azure OpenAI service" - } - }, - "openAIApiKey": { - "type": "string", - "metadata": { - "description": "OpenAI API Key, leave empty to provision a new Azure OpenAI instance" - } - }, - "openAiChatGptDeployment": { - "type": "string", - "metadata": { - "description": "OpenAI Model" - } - }, - "openAiEmbeddingDeployment": { - "type": "string", - "metadata": { - "description": "OpenAI Embedding Model" - } - }, - "useVision": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Use Vision retrieval. default: false" - } - } - }, - "variables": { - "$fxv#0": { - "analysisServicesServers": "as", - "apiManagementService": "apim-", - "appConfigurationConfigurationStores": "appcs-", - "appManagedEnvironments": "cae-", - "appContainerApps": "ca-", - "authorizationPolicyDefinitions": "policy-", - "automationAutomationAccounts": "aa-", - "blueprintBlueprints": "bp-", - "blueprintBlueprintsArtifacts": "bpa-", - "cacheRedis": "redis-", - "cdnProfiles": "cdnp-", - "cdnProfilesEndpoints": "cdne-", - "cognitiveServicesAccounts": "cog-", - "cognitiveServicesFormRecognizer": "cog-fr-", - "cognitiveServicesTextAnalytics": "cog-ta-", - "cognitiveServicesComputerVision": "cog-cv-", - "computeAvailabilitySets": "avail-", - "computeCloudServices": "cld-", - "computeDiskEncryptionSets": "des", - "computeDisks": "disk", - "computeDisksOs": "osdisk", - "computeGalleries": "gal", - "computeSnapshots": "snap-", - "computeVirtualMachines": "vm", - "computeVirtualMachineScaleSets": "vmss-", - "containerInstanceContainerGroups": "ci", - "containerRegistryRegistries": "cr", - "containerServiceManagedClusters": "aks-", - "databricksWorkspaces": "dbw-", - "dataFactoryFactories": "adf-", - "dataLakeAnalyticsAccounts": "dla", - "dataLakeStoreAccounts": "dls", - "dataMigrationServices": "dms-", - "dBforMySQLServers": "mysql-", - "dBforPostgreSQLServers": "psql-", - "devicesIotHubs": "iot-", - "devicesProvisioningServices": "provs-", - "devicesProvisioningServicesCertificates": "pcert-", - "documentDBDatabaseAccounts": "cosmos-", - "eventGridDomains": "evgd-", - "eventGridDomainsTopics": "evgt-", - "eventGridEventSubscriptions": "evgs-", - "eventHubNamespaces": "evhns-", - "eventHubNamespacesEventHubs": "evh-", - "hdInsightClustersHadoop": "hadoop-", - "hdInsightClustersHbase": "hbase-", - "hdInsightClustersKafka": "kafka-", - "hdInsightClustersMl": "mls-", - "hdInsightClustersSpark": "spark-", - "hdInsightClustersStorm": "storm-", - "hybridComputeMachines": "arcs-", - "insightsActionGroups": "ag-", - "insightsComponents": "appi-", - "keyVaultVaults": "kv-", - "kubernetesConnectedClusters": "arck", - "kustoClusters": "dec", - "kustoClustersDatabases": "dedb", - "logicIntegrationAccounts": "ia-", - "logicWorkflows": "logic-", - "machineLearningServicesWorkspaces": "mlw-", - "managedIdentityUserAssignedIdentities": "id-", - "managementManagementGroups": "mg-", - "migrateAssessmentProjects": "migr-", - "networkApplicationGateways": "agw-", - "networkApplicationSecurityGroups": "asg-", - "networkAzureFirewalls": "afw-", - "networkBastionHosts": "bas-", - "networkConnections": "con-", - "networkDnsZones": "dnsz-", - "networkExpressRouteCircuits": "erc-", - "networkFirewallPolicies": "afwp-", - "networkFirewallPoliciesWebApplication": "waf", - "networkFirewallPoliciesRuleGroups": "wafrg", - "networkFrontDoors": "fd-", - "networkFrontdoorWebApplicationFirewallPolicies": "fdfp-", - "networkLoadBalancersExternal": "lbe-", - "networkLoadBalancersInternal": "lbi-", - "networkLoadBalancersInboundNatRules": "rule-", - "networkLocalNetworkGateways": "lgw-", - "networkNatGateways": "ng-", - "networkNetworkInterfaces": "nic-", - "networkNetworkSecurityGroups": "nsg-", - "networkNetworkSecurityGroupsSecurityRules": "nsgsr-", - "networkNetworkWatchers": "nw-", - "networkPrivateDnsZones": "pdnsz-", - "networkPrivateLinkServices": "pl-", - "networkPublicIPAddresses": "pip-", - "networkPublicIPPrefixes": "ippre-", - "networkRouteFilters": "rf-", - "networkRouteTables": "rt-", - "networkRouteTablesRoutes": "udr-", - "networkTrafficManagerProfiles": "traf-", - "networkVirtualNetworkGateways": "vgw-", - "networkVirtualNetworks": "vnet-", - "networkVirtualNetworksSubnets": "snet-", - "networkVirtualNetworksVirtualNetworkPeerings": "peer-", - "networkVirtualWans": "vwan-", - "networkVpnGateways": "vpng-", - "networkVpnGatewaysVpnConnections": "vcn-", - "networkVpnGatewaysVpnSites": "vst-", - "notificationHubsNamespaces": "ntfns-", - "notificationHubsNamespacesNotificationHubs": "ntf-", - "operationalInsightsWorkspaces": "log-", - "portalDashboards": "dash-", - "powerBIDedicatedCapacities": "pbi-", - "purviewAccounts": "pview-", - "recoveryServicesVaults": "rsv-", - "resourcesResourceGroups": "rg-", - "searchSearchServices": "srch-", - "serviceBusNamespaces": "sb-", - "serviceBusNamespacesQueues": "sbq-", - "serviceBusNamespacesTopics": "sbt-", - "serviceEndPointPolicies": "se-", - "serviceFabricClusters": "sf-", - "signalRServiceSignalR": "sigr", - "sqlManagedInstances": "sqlmi-", - "sqlServers": "sql-", - "sqlServersDataWarehouse": "sqldw-", - "sqlServersDatabases": "sqldb-", - "sqlServersDatabasesStretch": "sqlstrdb-", - "storageStorageAccounts": "st", - "storageStorageAccountsVm": "stvm", - "storSimpleManagers": "ssimp", - "streamAnalyticsCluster": "asa-", - "synapseWorkspaces": "syn", - "synapseWorkspacesAnalyticsWorkspaces": "synw", - "synapseWorkspacesSqlPoolsDedicated": "syndp", - "synapseWorkspacesSqlPoolsSpark": "synsp", - "timeSeriesInsightsEnvironments": "tsi-", - "webServerFarms": "plan-", - "webSitesAppService": "app-", - "webSitesAppServiceEnvironment": "ase-", - "webSitesFunctions": "func-", - "webStaticSites": "stapp-" - }, - "actualSearchServiceSemanticRankerLevel": "[if(equals(parameters('searchServiceSkuName'), 'free'), 'disabled', parameters('searchServiceSemanticRankerLevel'))]", - "abbrs": "[variables('$fxv#0')]", - "resourceToken": "[toLower(uniqueString(subscription().id, parameters('environmentName'), parameters('location')))]", - "baseTags": { - "azd-env-name": "[parameters('environmentName')]" - }, - "updatedTags": "[union(if(empty(parameters('tags')), createObject(), base64ToJson(parameters('tags'))), variables('baseTags'))]" - }, - "resources": [ - { - "type": "Microsoft.Resources/resourceGroups", - "apiVersion": "2021-04-01", - "name": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "location": "[parameters('location')]", - "tags": "[variables('updatedTags')]" - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "keyvault", - "resourceGroup": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('keyVaultName'))), createObject('value', parameters('keyVaultName')), createObject('value', format('{0}{1}', variables('abbrs').keyVaultVaults, variables('resourceToken'))))]", - "location": { - "value": "[parameters('keyVaultResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "principalId": { - "value": "[parameters('principalId')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "7168247202031008623" - }, - "description": "Creates an Azure Key Vault." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "principalId": { - "type": "string", - "defaultValue": "" - } - }, - "resources": [ - { - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2022-07-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "properties": { - "tenantId": "[subscription().tenantId]", - "sku": { - "family": "A", - "name": "standard" - }, - "accessPolicies": "[if(not(empty(parameters('principalId'))), createArray(createObject('objectId', parameters('principalId'), 'permissions', createObject('secrets', createArray('get', 'list')), 'tenantId', subscription().tenantId)), createArray())]" - } - } - ], - "outputs": { - "endpoint": { - "type": "string", - "value": "[reference(resourceId('Microsoft.KeyVault/vaults', parameters('name')), '2022-07-01').vaultUri]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.KeyVault/vaults', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "keyvault-secrets", - "resourceGroup": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "keyVaultName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "secrets": { - "value": "[concat(createArray(createObject('name', 'AzureSearchServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value), createObject('name', 'AzureSearchIndex', 'value', parameters('searchIndexName')), createObject('name', 'AzureStorageAccountEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob), createObject('name', 'AzureStorageContainer', 'value', parameters('storageContainerName')), createObject('name', 'UseAOAI', 'value', if(parameters('useAOAI'), 'true', 'false')), createObject('name', 'UseVision', 'value', if(parameters('useVision'), 'true', 'false'))), if(parameters('useAOAI'), createArray(createObject('name', 'AzureOpenAiServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value), createObject('name', 'AzureOpenAiChatGptDeployment', 'value', parameters('azureChatGptDeploymentName')), createObject('name', 'AzureOpenAiEmbeddingDeployment', 'value', parameters('azureEmbeddingDeploymentName'))), createArray(createObject('name', 'OpenAIAPIKey', 'value', parameters('openAIApiKey')), createObject('name', 'OpenAiChatGptDeployment', 'value', parameters('openAiChatGptDeployment')), createObject('name', 'OpenAiEmbeddingDeployment', 'value', parameters('openAiEmbeddingDeployment')))), if(parameters('useVision'), createArray(createObject('name', 'AzureComputerVisionServiceEndpoint', 'value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value)), createArray()))]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "2040607556454067288" - } - }, - "parameters": { - "tags": { - "type": "object", - "defaultValue": {} - }, - "keyVaultName": { - "type": "string" - }, - "secrets": { - "type": "array", - "defaultValue": [] - } - }, - "resources": [ - { - "copy": { - "name": "keyVaultSecret", - "count": "[length(parameters('secrets'))]", - "mode": "serial", - "batchSize": 1 - }, - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2022-07-01", - "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('secrets')[copyIndex()].name)]", - "tags": "[parameters('tags')]", - "properties": { - "attributes": { - "enabled": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'enabled'), true())]", - "exp": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'exp'), 0)]", - "nbf": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'nbf'), 0)]" - }, - "contentType": "[coalesce(tryGet(parameters('secrets')[copyIndex()], 'contentType'), 'string')]", - "value": "[parameters('secrets')[copyIndex()].value]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "container-apps", - "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "app" - }, - "containerAppsEnvironmentName": "[if(not(empty(parameters('containerAppsEnvironmentName'))), createObject('value', parameters('containerAppsEnvironmentName')), createObject('value', format('{0}{1}', variables('abbrs').appManagedEnvironments, variables('resourceToken'))))]", - "containerRegistryName": "[if(not(empty(parameters('containerRegistryName'))), createObject('value', parameters('containerRegistryName')), createObject('value', format('{0}{1}', variables('abbrs').containerRegistryRegistries, variables('resourceToken'))))]", - "containerRegistryResourceGroupName": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), createObject('value', parameters('containerRegistryResourceGroupName')), createObject('value', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))))]", - "location": { - "value": "[parameters('location')]" - }, - "logAnalyticsWorkspaceName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.logAnalyticsWorkspaceName.value]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "4680439615851279859" - }, - "description": "Creates an Azure Container Registry and an Azure Container Apps environment." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "containerAppsEnvironmentName": { - "type": "string" - }, - "containerRegistryName": { - "type": "string" - }, - "containerRegistryResourceGroupName": { - "type": "string", - "defaultValue": "" - }, - "containerRegistryAdminUserEnabled": { - "type": "bool", - "defaultValue": false - }, - "logAnalyticsWorkspaceName": { - "type": "string" - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "" - } - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-container-apps-environment', parameters('name'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('containerAppsEnvironmentName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[parameters('tags')]" - }, - "logAnalyticsWorkspaceName": { - "value": "[parameters('logAnalyticsWorkspaceName')]" - }, - "applicationInsightsName": { - "value": "[parameters('applicationInsightsName')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13665153796666771230" - }, - "description": "Creates an Azure Container Apps environment." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "Name of the Application Insights resource" - } - }, - "daprEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Specifies if Dapr is enabled" - } - }, - "logAnalyticsWorkspaceName": { - "type": "string", - "metadata": { - "description": "Name of the Log Analytics workspace" - } - } - }, - "resources": [ - { - "type": "Microsoft.App/managedEnvironments", - "apiVersion": "2023-05-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "properties": { - "appLogsConfiguration": { - "destination": "log-analytics", - "logAnalyticsConfiguration": { - "customerId": "[reference(resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2022-10-01').customerId]", - "sharedKey": "[listKeys(resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2022-10-01').primarySharedKey]" - } - }, - "daprAIInstrumentationKey": "[if(and(parameters('daprEnabled'), not(empty(parameters('applicationInsightsName')))), reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').InstrumentationKey, '')]" - } - } - ], - "outputs": { - "defaultDomain": { - "type": "string", - "value": "[reference(resourceId('Microsoft.App/managedEnvironments', parameters('name')), '2023-05-01').defaultDomain]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.App/managedEnvironments', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - } - }, - { - "condition": "[not(empty(parameters('containerRegistryResourceGroupName')))]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-container-registry', parameters('name'))]", - "resourceGroup": "[parameters('containerRegistryResourceGroupName')]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('containerRegistryName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "adminUserEnabled": { - "value": "[parameters('containerRegistryAdminUserEnabled')]" - }, - "tags": { - "value": "[parameters('tags')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "9654395135941658248" - }, - "description": "Creates an Azure Container Registry." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "adminUserEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether admin user is enabled" - } - }, - "anonymousPullEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether anonymous pull is enabled" - } - }, - "azureADAuthenticationAsArmPolicy": { - "type": "object", - "defaultValue": { - "status": "enabled" - }, - "metadata": { - "description": "Azure ad authentication as arm policy settings" - } - }, - "dataEndpointEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether data endpoint is enabled" - } - }, - "encryption": { - "type": "object", - "defaultValue": { - "status": "disabled" - }, - "metadata": { - "description": "Encryption settings" - } - }, - "exportPolicy": { - "type": "object", - "defaultValue": { - "status": "enabled" - }, - "metadata": { - "description": "Export policy settings" - } - }, - "metadataSearch": { - "type": "string", - "defaultValue": "Disabled", - "metadata": { - "description": "Metadata search settings" - } - }, - "networkRuleBypassOptions": { - "type": "string", - "defaultValue": "AzureServices", - "metadata": { - "description": "Options for bypassing network rules" - } - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "metadata": { - "description": "Public network access setting" - } - }, - "quarantinePolicy": { - "type": "object", - "defaultValue": { - "status": "disabled" - }, - "metadata": { - "description": "Quarantine policy settings" - } - }, - "retentionPolicy": { - "type": "object", - "defaultValue": { - "days": 7, - "status": "disabled" - }, - "metadata": { - "description": "Retention policy settings" - } - }, - "scopeMaps": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "Scope maps setting" - } - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "Basic" - }, - "metadata": { - "description": "SKU settings" - } - }, - "softDeletePolicy": { - "type": "object", - "defaultValue": { - "retentionDays": 7, - "status": "disabled" - }, - "metadata": { - "description": "Soft delete policy settings" - } - }, - "trustPolicy": { - "type": "object", - "defaultValue": { - "type": "Notary", - "status": "disabled" - }, - "metadata": { - "description": "Trust policy settings" - } - }, - "zoneRedundancy": { - "type": "string", - "defaultValue": "Disabled", - "metadata": { - "description": "Zone redundancy setting" - } - }, - "workspaceId": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The log analytics workspace ID used for logging and monitoring" - } - } - }, - "resources": [ - { - "copy": { - "name": "containerRegistry::scopeMap", - "count": "[length(parameters('scopeMaps'))]" - }, - "type": "Microsoft.ContainerRegistry/registries/scopeMaps", - "apiVersion": "2023-11-01-preview", - "name": "[format('{0}/{1}', parameters('name'), parameters('scopeMaps')[copyIndex()].name)]", - "properties": "[parameters('scopeMaps')[copyIndex()].properties]", - "dependsOn": [ - "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - ] - }, - { - "type": "Microsoft.ContainerRegistry/registries", - "apiVersion": "2023-11-01-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "sku": "[parameters('sku')]", - "properties": { - "adminUserEnabled": "[parameters('adminUserEnabled')]", - "anonymousPullEnabled": "[parameters('anonymousPullEnabled')]", - "dataEndpointEnabled": "[parameters('dataEndpointEnabled')]", - "encryption": "[parameters('encryption')]", - "metadataSearch": "[parameters('metadataSearch')]", - "networkRuleBypassOptions": "[parameters('networkRuleBypassOptions')]", - "policies": { - "quarantinePolicy": "[parameters('quarantinePolicy')]", - "trustPolicy": "[parameters('trustPolicy')]", - "retentionPolicy": "[parameters('retentionPolicy')]", - "exportPolicy": "[parameters('exportPolicy')]", - "azureADAuthenticationAsArmPolicy": "[parameters('azureADAuthenticationAsArmPolicy')]", - "softDeletePolicy": "[parameters('softDeletePolicy')]" - }, - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "zoneRedundancy": "[parameters('zoneRedundancy')]" - } - }, - { - "condition": "[not(empty(parameters('workspaceId')))]", - "type": "Microsoft.Insights/diagnosticSettings", - "apiVersion": "2021-05-01-preview", - "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('name'))]", - "name": "registry-diagnostics", - "properties": { - "workspaceId": "[parameters('workspaceId')]", - "logs": [ - { - "category": "ContainerRegistryRepositoryEvents", - "enabled": true - }, - { - "category": "ContainerRegistryLoginEvents", - "enabled": true - } - ], - "metrics": [ - { - "category": "AllMetrics", - "enabled": true, - "timeGrain": "PT1M" - } - ] - }, - "dependsOn": [ - "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - ] - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - }, - "loginServer": { - "type": "string", - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2023-11-01-preview').loginServer]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - } - }, - { - "condition": "[empty(parameters('containerRegistryResourceGroupName'))]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-container-registry', parameters('name'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('containerRegistryName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "adminUserEnabled": { - "value": "[parameters('containerRegistryAdminUserEnabled')]" - }, - "tags": { - "value": "[parameters('tags')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "9654395135941658248" - }, - "description": "Creates an Azure Container Registry." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "adminUserEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether admin user is enabled" - } - }, - "anonymousPullEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether anonymous pull is enabled" - } - }, - "azureADAuthenticationAsArmPolicy": { - "type": "object", - "defaultValue": { - "status": "enabled" - }, - "metadata": { - "description": "Azure ad authentication as arm policy settings" - } - }, - "dataEndpointEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Indicates whether data endpoint is enabled" - } - }, - "encryption": { - "type": "object", - "defaultValue": { - "status": "disabled" - }, - "metadata": { - "description": "Encryption settings" - } - }, - "exportPolicy": { - "type": "object", - "defaultValue": { - "status": "enabled" - }, - "metadata": { - "description": "Export policy settings" - } - }, - "metadataSearch": { - "type": "string", - "defaultValue": "Disabled", - "metadata": { - "description": "Metadata search settings" - } - }, - "networkRuleBypassOptions": { - "type": "string", - "defaultValue": "AzureServices", - "metadata": { - "description": "Options for bypassing network rules" - } - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "metadata": { - "description": "Public network access setting" - } - }, - "quarantinePolicy": { - "type": "object", - "defaultValue": { - "status": "disabled" - }, - "metadata": { - "description": "Quarantine policy settings" - } - }, - "retentionPolicy": { - "type": "object", - "defaultValue": { - "days": 7, - "status": "disabled" - }, - "metadata": { - "description": "Retention policy settings" - } - }, - "scopeMaps": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "Scope maps setting" - } - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "Basic" - }, - "metadata": { - "description": "SKU settings" - } - }, - "softDeletePolicy": { - "type": "object", - "defaultValue": { - "retentionDays": 7, - "status": "disabled" - }, - "metadata": { - "description": "Soft delete policy settings" - } - }, - "trustPolicy": { - "type": "object", - "defaultValue": { - "type": "Notary", - "status": "disabled" - }, - "metadata": { - "description": "Trust policy settings" - } - }, - "zoneRedundancy": { - "type": "string", - "defaultValue": "Disabled", - "metadata": { - "description": "Zone redundancy setting" - } - }, - "workspaceId": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The log analytics workspace ID used for logging and monitoring" - } - } - }, - "resources": [ - { - "copy": { - "name": "containerRegistry::scopeMap", - "count": "[length(parameters('scopeMaps'))]" - }, - "type": "Microsoft.ContainerRegistry/registries/scopeMaps", - "apiVersion": "2023-11-01-preview", - "name": "[format('{0}/{1}', parameters('name'), parameters('scopeMaps')[copyIndex()].name)]", - "properties": "[parameters('scopeMaps')[copyIndex()].properties]", - "dependsOn": [ - "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - ] - }, - { - "type": "Microsoft.ContainerRegistry/registries", - "apiVersion": "2023-11-01-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "sku": "[parameters('sku')]", - "properties": { - "adminUserEnabled": "[parameters('adminUserEnabled')]", - "anonymousPullEnabled": "[parameters('anonymousPullEnabled')]", - "dataEndpointEnabled": "[parameters('dataEndpointEnabled')]", - "encryption": "[parameters('encryption')]", - "metadataSearch": "[parameters('metadataSearch')]", - "networkRuleBypassOptions": "[parameters('networkRuleBypassOptions')]", - "policies": { - "quarantinePolicy": "[parameters('quarantinePolicy')]", - "trustPolicy": "[parameters('trustPolicy')]", - "retentionPolicy": "[parameters('retentionPolicy')]", - "exportPolicy": "[parameters('exportPolicy')]", - "azureADAuthenticationAsArmPolicy": "[parameters('azureADAuthenticationAsArmPolicy')]", - "softDeletePolicy": "[parameters('softDeletePolicy')]" - }, - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "zoneRedundancy": "[parameters('zoneRedundancy')]" - } - }, - { - "condition": "[not(empty(parameters('workspaceId')))]", - "type": "Microsoft.Insights/diagnosticSettings", - "apiVersion": "2021-05-01-preview", - "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('name'))]", - "name": "registry-diagnostics", - "properties": { - "workspaceId": "[parameters('workspaceId')]", - "logs": [ - { - "category": "ContainerRegistryRepositoryEvents", - "enabled": true - }, - { - "category": "ContainerRegistryLoginEvents", - "enabled": true - } - ], - "metrics": [ - { - "category": "AllMetrics", - "enabled": true, - "timeGrain": "PT1M" - } - ] - }, - "dependsOn": [ - "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - ] - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]" - }, - "loginServer": { - "type": "string", - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2023-11-01-preview').loginServer]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - } - } - ], - "outputs": { - "defaultDomain": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.defaultDomain.value]" - }, - "environmentName": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.name.value]" - }, - "environmentId": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-apps-environment', parameters('name'))), '2022-09-01').outputs.id.value]" - }, - "registryLoginServer": { - "type": "string", - "value": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('containerRegistryResourceGroupName')), 'Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.loginServer.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.loginServer.value)]" - }, - "registryName": { - "type": "string", - "value": "[if(not(empty(parameters('containerRegistryResourceGroupName'))), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('containerRegistryResourceGroupName')), 'Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.name.value, reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-registry', parameters('name'))), '2022-09-01').outputs.name.value)]" - } - } - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "web", - "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('webContainerAppName'))), createObject('value', parameters('webContainerAppName')), createObject('value', format('{0}web-{1}', variables('abbrs').appContainerApps, variables('resourceToken'))))]", - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "imageName": { - "value": "[parameters('webImageName')]" - }, - "identityName": "[if(not(empty(parameters('webIdentityName'))), createObject('value', parameters('webIdentityName')), createObject('value', format('{0}web-{1}', variables('abbrs').managedIdentityUserAssignedIdentities, variables('resourceToken'))))]", - "applicationInsightsName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" - }, - "containerAppsEnvironmentName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.environmentName.value]" - }, - "containerRegistryName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" - }, - "exists": { - "value": "[parameters('webAppExists')]" - }, - "keyVaultName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" - }, - "keyVaultResourceGroupName": { - "value": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - }, - "storageBlobEndpoint": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]" - }, - "storageContainerName": { - "value": "[parameters('storageContainerName')]" - }, - "searchServiceEndpoint": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]" - }, - "searchIndexName": { - "value": "[parameters('searchIndexName')]" - }, - "formRecognizerEndpoint": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]" - }, - "computerVisionEndpoint": "[if(parameters('useVision'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value), createObject('value', ''))]", - "useVision": { - "value": "[parameters('useVision')]" - }, - "openAiApiKey": "[if(parameters('useAOAI'), createObject('value', ''), createObject('value', parameters('openAIApiKey')))]", - "openAiEndpoint": "[if(parameters('useAOAI'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value), createObject('value', ''))]", - "openAiChatGptDeployment": "[if(parameters('useAOAI'), createObject('value', parameters('azureChatGptDeploymentName')), createObject('value', ''))]", - "openAiEmbeddingDeployment": "[if(parameters('useAOAI'), createObject('value', parameters('azureEmbeddingDeploymentName')), createObject('value', ''))]", - "serviceBinds": { - "value": [] - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "8754897799961399" - } - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "identityName": { - "type": "string", - "metadata": { - "description": "The name of the identity" - } - }, - "applicationInsightsName": { - "type": "string", - "metadata": { - "description": "The name of the Application Insights" - } - }, - "containerAppsEnvironmentName": { - "type": "string", - "metadata": { - "description": "The name of the container apps environment" - } - }, - "containerRegistryName": { - "type": "string", - "metadata": { - "description": "The name of the container registry" - } - }, - "serviceName": { - "type": "string", - "defaultValue": "web", - "metadata": { - "description": "The name of the service" - } - }, - "imageName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the image" - } - }, - "exists": { - "type": "bool", - "metadata": { - "description": "Specifies if the resource exists" - } - }, - "keyVaultName": { - "type": "string", - "metadata": { - "description": "The name of the Key Vault" - } - }, - "keyVaultResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "The name of the Key Vault resource group" - } - }, - "storageBlobEndpoint": { - "type": "string", - "metadata": { - "description": "The storage blob endpoint" - } - }, - "storageContainerName": { - "type": "string", - "metadata": { - "description": "The name of the storage container" - } - }, - "searchServiceEndpoint": { - "type": "string", - "metadata": { - "description": "The search service endpoint" - } - }, - "searchIndexName": { - "type": "string", - "metadata": { - "description": "The search index name" - } - }, - "formRecognizerEndpoint": { - "type": "string", - "metadata": { - "description": "The Azure AI Document Intelligence endpoint" - } - }, - "computerVisionEndpoint": { - "type": "string", - "metadata": { - "description": "The Computer Vision endpoint" - } - }, - "openAiEndpoint": { - "type": "string", - "metadata": { - "description": "The OpenAI endpoint" - } - }, - "openAiChatGptDeployment": { - "type": "string", - "metadata": { - "description": "The OpenAI ChatGPT deployment name" - } - }, - "openAiEmbeddingDeployment": { - "type": "string", - "metadata": { - "description": "The OpenAI Embedding deployment name" - } - }, - "useVision": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "use gpt-4v" - } - }, - "openAiApiKey": { - "type": "string", - "metadata": { - "description": "The OpenAI API key" - } - }, - "serviceBinds": { - "type": "array", - "metadata": { - "description": "An array of service binds" - } - } - }, - "resources": [ - { - "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - "apiVersion": "2023-01-31", - "name": "[parameters('identityName')]", - "location": "[parameters('location')]" - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "web-keyvault-access", - "resourceGroup": "[parameters('keyVaultResourceGroupName')]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId]" - }, - "keyVaultName": { - "value": "[parameters('keyVaultName')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13097350302282890335" - }, - "description": "Assigns an Azure Key Vault access policy." - }, - "parameters": { - "name": { - "type": "string", - "defaultValue": "add" - }, - "keyVaultName": { - "type": "string" - }, - "permissions": { - "type": "object", - "defaultValue": { - "secrets": [ - "get", - "list" - ] - } - }, - "principalId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.KeyVault/vaults/accessPolicies", - "apiVersion": "2022-07-01", - "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('name'))]", - "properties": { - "accessPolicies": [ - { - "objectId": "[parameters('principalId')]", - "tenantId": "[subscription().tenantId]", - "permissions": "[parameters('permissions')]" - } - ] - } - } - ] - } - }, - "dependsOn": [ - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-container-app', parameters('serviceName'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('name')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[union(parameters('tags'), createObject('azd-service-name', parameters('serviceName')))]" - }, - "identityName": { - "value": "[parameters('identityName')]" - }, - "imageName": { - "value": "[parameters('imageName')]" - }, - "exists": { - "value": "[parameters('exists')]" - }, - "serviceBinds": { - "value": "[parameters('serviceBinds')]" - }, - "containerAppsEnvironmentName": { - "value": "[parameters('containerAppsEnvironmentName')]" - }, - "containerRegistryName": { - "value": "[parameters('containerRegistryName')]" - }, - "env": { - "value": [ - { - "name": "AZURE_CLIENT_ID", - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').clientId]" - }, - { - "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", - "value": "[if(not(empty(parameters('applicationInsightsName'))), reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').ConnectionString, '')]" - }, - { - "name": "AZURE_KEY_VAULT_ENDPOINT", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('keyVaultResourceGroupName')), 'Microsoft.KeyVault/vaults', parameters('keyVaultName')), '2022-07-01').vaultUri]" - }, - { - "name": "AZURE_STORAGE_BLOB_ENDPOINT", - "value": "[parameters('storageBlobEndpoint')]" - }, - { - "name": "AZURE_STORAGE_CONTAINER", - "value": "[parameters('storageContainerName')]" - }, - { - "name": "AZURE_SEARCH_SERVICE_ENDPOINT", - "value": "[parameters('searchServiceEndpoint')]" - }, - { - "name": "AZURE_SEARCH_INDEX", - "value": "[parameters('searchIndexName')]" - }, - { - "name": "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT", - "value": "[parameters('formRecognizerEndpoint')]" - }, - { - "name": "AZURE_OPENAI_ENDPOINT", - "value": "[parameters('openAiEndpoint')]" - }, - { - "name": "AZURE_OPENAI_CHATGPT_DEPLOYMENT", - "value": "[parameters('openAiChatGptDeployment')]" - }, - { - "name": "AZURE_OPENAI_EMBEDDING_DEPLOYMENT", - "value": "[parameters('openAiEmbeddingDeployment')]" - }, - { - "name": "AZURE_COMPUTER_VISION_ENDPOINT", - "value": "[parameters('computerVisionEndpoint')]" - }, - { - "name": "USE_VISION", - "value": "[if(parameters('useVision'), 'true', 'false')]" - }, - { - "name": "OPENAI_API_KEY", - "value": "[parameters('openAiApiKey')]" - } - ] - }, - "targetPort": { - "value": 8080 - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "2376048055783657332" - }, - "description": "Creates or updates an existing Azure Container App." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "containerAppsEnvironmentName": { - "type": "string", - "metadata": { - "description": "The environment name for the container apps" - } - }, - "containerCpuCoreCount": { - "type": "string", - "defaultValue": "0.5", - "metadata": { - "description": "The number of CPU cores allocated to a single container instance, e.g., 0.5" - } - }, - "containerMaxReplicas": { - "type": "int", - "defaultValue": 10, - "minValue": 1, - "metadata": { - "description": "The maximum number of replicas to run. Must be at least 1." - } - }, - "containerMemory": { - "type": "string", - "defaultValue": "1.0Gi", - "metadata": { - "description": "The amount of memory allocated to a single container instance, e.g., 1Gi" - } - }, - "containerMinReplicas": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "metadata": { - "description": "The minimum number of replicas to run. Must be at least 1." - } - }, - "containerName": { - "type": "string", - "defaultValue": "main", - "metadata": { - "description": "The name of the container" - } - }, - "containerRegistryName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the container registry" - } - }, - "containerRegistryHostSuffix": { - "type": "string", - "defaultValue": "azurecr.io", - "metadata": { - "description": "Hostname suffix for container registry. Set when deploying to sovereign clouds" - } - }, - "daprAppProtocol": { - "type": "string", - "defaultValue": "http", - "allowedValues": [ - "http", - "grpc" - ], - "metadata": { - "description": "The protocol used by Dapr to connect to the app, e.g., HTTP or gRPC" - } - }, - "daprEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Enable or disable Dapr for the container app" - } - }, - "daprAppId": { - "type": "string", - "defaultValue": "[parameters('containerName')]", - "metadata": { - "description": "The Dapr app ID" - } - }, - "exists": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Specifies if the resource already exists" - } - }, - "ingressEnabled": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Specifies if Ingress is enabled for the container app" - } - }, - "identityType": { - "type": "string", - "defaultValue": "None", - "allowedValues": [ - "None", - "SystemAssigned", - "UserAssigned" - ], - "metadata": { - "description": "The type of identity for the resource" - } - }, - "identityName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the user-assigned identity" - } - }, - "imageName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the container image" - } - }, - "secrets": { - "type": "secureObject", - "defaultValue": {}, - "metadata": { - "description": "The secrets required for the container" - } - }, - "env": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "The environment variables for the container" - } - }, - "external": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Specifies if the resource ingress is exposed externally" - } - }, - "serviceBinds": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "The service binds associated with the container" - } - }, - "targetPort": { - "type": "int", - "defaultValue": 80, - "metadata": { - "description": "The target port for the container" - } - } - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-update', deployment().name)]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('name')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[parameters('tags')]" - }, - "identityType": { - "value": "[parameters('identityType')]" - }, - "identityName": { - "value": "[parameters('identityName')]" - }, - "ingressEnabled": { - "value": "[parameters('ingressEnabled')]" - }, - "containerName": { - "value": "[parameters('containerName')]" - }, - "containerAppsEnvironmentName": { - "value": "[parameters('containerAppsEnvironmentName')]" - }, - "containerRegistryName": { - "value": "[parameters('containerRegistryName')]" - }, - "containerRegistryHostSuffix": { - "value": "[parameters('containerRegistryHostSuffix')]" - }, - "containerCpuCoreCount": { - "value": "[parameters('containerCpuCoreCount')]" - }, - "containerMemory": { - "value": "[parameters('containerMemory')]" - }, - "containerMinReplicas": { - "value": "[parameters('containerMinReplicas')]" - }, - "containerMaxReplicas": { - "value": "[parameters('containerMaxReplicas')]" - }, - "daprEnabled": { - "value": "[parameters('daprEnabled')]" - }, - "daprAppId": { - "value": "[parameters('daprAppId')]" - }, - "daprAppProtocol": { - "value": "[parameters('daprAppProtocol')]" - }, - "secrets": { - "value": "[parameters('secrets')]" - }, - "external": { - "value": "[parameters('external')]" - }, - "env": { - "value": "[parameters('env')]" - }, - "imageName": "[if(not(empty(parameters('imageName'))), createObject('value', parameters('imageName')), if(parameters('exists'), createObject('value', reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview').template.containers[0].image), createObject('value', '')))]", - "targetPort": { - "value": "[parameters('targetPort')]" - }, - "serviceBinds": { - "value": "[parameters('serviceBinds')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "14245224743665868744" - }, - "description": "Creates a container app in an Azure Container App environment." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "allowedOrigins": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "Allowed origins" - } - }, - "containerAppsEnvironmentName": { - "type": "string", - "metadata": { - "description": "Name of the environment for container apps" - } - }, - "containerCpuCoreCount": { - "type": "string", - "defaultValue": "0.5", - "metadata": { - "description": "CPU cores allocated to a single container instance, e.g., 0.5" - } - }, - "containerMaxReplicas": { - "type": "int", - "defaultValue": 10, - "minValue": 1, - "metadata": { - "description": "The maximum number of replicas to run. Must be at least 1." - } - }, - "containerMemory": { - "type": "string", - "defaultValue": "1.0Gi", - "metadata": { - "description": "Memory allocated to a single container instance, e.g., 1Gi" - } - }, - "containerMinReplicas": { - "type": "int", - "defaultValue": 1, - "metadata": { - "description": "The minimum number of replicas to run. Must be at least 1." - } - }, - "containerName": { - "type": "string", - "defaultValue": "main", - "metadata": { - "description": "The name of the container" - } - }, - "containerRegistryName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the container registry" - } - }, - "containerRegistryHostSuffix": { - "type": "string", - "defaultValue": "azurecr.io", - "metadata": { - "description": "Hostname suffix for container registry. Set when deploying to sovereign clouds" - } - }, - "daprAppProtocol": { - "type": "string", - "defaultValue": "http", - "allowedValues": [ - "http", - "grpc" - ], - "metadata": { - "description": "The protocol used by Dapr to connect to the app, e.g., http or grpc" - } - }, - "daprAppId": { - "type": "string", - "defaultValue": "[parameters('containerName')]", - "metadata": { - "description": "The Dapr app ID" - } - }, - "daprEnabled": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Enable Dapr" - } - }, - "env": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "The environment variables for the container" - } - }, - "external": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Specifies if the resource ingress is exposed externally" - } - }, - "identityName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the user-assigned identity" - } - }, - "identityType": { - "type": "string", - "defaultValue": "None", - "allowedValues": [ - "None", - "SystemAssigned", - "UserAssigned" - ], - "metadata": { - "description": "The type of identity for the resource" - } - }, - "imageName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the container image" - } - }, - "ingressEnabled": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Specifies if Ingress is enabled for the container app" - } - }, - "revisionMode": { - "type": "string", - "defaultValue": "Single" - }, - "secrets": { - "type": "secureObject", - "defaultValue": {}, - "metadata": { - "description": "The secrets required for the container" - } - }, - "serviceBinds": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "The service binds associated with the container" - } - }, - "serviceType": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "The name of the container apps add-on to use. e.g. redis" - } - }, - "targetPort": { - "type": "int", - "defaultValue": 80, - "metadata": { - "description": "The target port for the container" - } - } - }, - "variables": { - "usePrivateRegistry": "[and(not(empty(parameters('identityName'))), not(empty(parameters('containerRegistryName'))))]", - "normalizedIdentityType": "[if(not(empty(parameters('identityName'))), 'UserAssigned', parameters('identityType'))]" - }, - "resources": [ - { - "type": "Microsoft.App/containerApps", - "apiVersion": "2023-05-02-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "identity": { - "type": "[variables('normalizedIdentityType')]", - "userAssignedIdentities": "[if(and(not(empty(parameters('identityName'))), equals(variables('normalizedIdentityType'), 'UserAssigned')), createObject(format('{0}', resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))), createObject()), null())]" - }, - "properties": { - "managedEnvironmentId": "[resourceId('Microsoft.App/managedEnvironments', parameters('containerAppsEnvironmentName'))]", - "configuration": { - "copy": [ - { - "name": "secrets", - "count": "[length(items(parameters('secrets')))]", - "input": { - "name": "[items(parameters('secrets'))[copyIndex('secrets')].key]", - "value": "[items(parameters('secrets'))[copyIndex('secrets')].value]" - } - } - ], - "activeRevisionsMode": "[parameters('revisionMode')]", - "ingress": "[if(parameters('ingressEnabled'), createObject('external', parameters('external'), 'targetPort', parameters('targetPort'), 'transport', 'auto', 'corsPolicy', createObject('allowedOrigins', union(createArray('https://portal.azure.com', 'https://ms.portal.azure.com'), parameters('allowedOrigins')))), null())]", - "dapr": "[if(parameters('daprEnabled'), createObject('enabled', true(), 'appId', parameters('daprAppId'), 'appProtocol', parameters('daprAppProtocol'), 'appPort', if(parameters('ingressEnabled'), parameters('targetPort'), 0)), createObject('enabled', false()))]", - "service": "[if(not(empty(parameters('serviceType'))), createObject('type', parameters('serviceType')), null())]", - "registries": "[if(variables('usePrivateRegistry'), createArray(createObject('server', format('{0}.{1}', parameters('containerRegistryName'), parameters('containerRegistryHostSuffix')), 'identity', resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')))), createArray())]" - }, - "template": { - "serviceBinds": "[if(not(empty(parameters('serviceBinds'))), parameters('serviceBinds'), null())]", - "containers": [ - { - "image": "[if(not(empty(parameters('imageName'))), parameters('imageName'), 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest')]", - "name": "[parameters('containerName')]", - "env": "[parameters('env')]", - "resources": { - "cpu": "[json(parameters('containerCpuCoreCount'))]", - "memory": "[parameters('containerMemory')]" - } - } - ], - "scale": { - "minReplicas": "[parameters('containerMinReplicas')]", - "maxReplicas": "[parameters('containerMaxReplicas')]" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', format('{0}-registry-access', deployment().name))]" - ] - }, - { - "condition": "[variables('usePrivateRegistry')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-registry-access', deployment().name)]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "containerRegistryName": { - "value": "[parameters('containerRegistryName')]" - }, - "principalId": "[if(variables('usePrivateRegistry'), createObject('value', reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId), createObject('value', ''))]" - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "17670809923773573174" - }, - "description": "Assigns ACR Pull permissions to access an Azure Container Registry." - }, - "parameters": { - "containerRegistryName": { - "type": "string" - }, - "principalId": { - "type": "string" - } - }, - "variables": { - "acrPullRole": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')]" - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('containerRegistryName'))]", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), variables('acrPullRole'))]", - "properties": { - "roleDefinitionId": "[variables('acrPullRole')]", - "principalType": "ServicePrincipal", - "principalId": "[parameters('principalId')]" - } - } - ] - } - } - } - ], - "outputs": { - "defaultDomain": { - "type": "string", - "value": "[reference(resourceId('Microsoft.App/managedEnvironments', parameters('containerAppsEnvironmentName')), '2023-05-01').defaultDomain]" - }, - "identityPrincipalId": { - "type": "string", - "value": "[if(equals(variables('normalizedIdentityType'), 'None'), '', if(empty(parameters('identityName')), reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview', 'full').identity.principalId, reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId))]" - }, - "imageName": { - "type": "string", - "value": "[parameters('imageName')]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - }, - "serviceBind": { - "type": "object", - "value": "[if(not(empty(parameters('serviceType'))), createObject('serviceId', resourceId('Microsoft.App/containerApps', parameters('name')), 'name', parameters('name')), createObject())]" - }, - "uri": { - "type": "string", - "value": "[if(parameters('ingressEnabled'), format('https://{0}', reference(resourceId('Microsoft.App/containerApps', parameters('name')), '2023-05-02-preview').configuration.ingress.fqdn), '')]" - } - } - } - } - } - ], - "outputs": { - "defaultDomain": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.defaultDomain.value]" - }, - "imageName": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.imageName.value]" - }, - "name": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.name.value]" - }, - "uri": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-update', deployment().name)), '2022-09-01').outputs.uri.value]" - } - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName'))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('keyVaultResourceGroupName')), 'Microsoft.Resources/deployments', 'web-keyvault-access')]" - ] - } - ], - "outputs": { - "SERVICE_WEB_IDENTITY_NAME": { - "type": "string", - "value": "[parameters('identityName')]" - }, - "SERVICE_WEB_IDENTITY_PRINCIPAL_ID": { - "type": "string", - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('identityName')), '2023-01-31').principalId]" - }, - "SERVICE_WEB_IMAGE_NAME": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.imageName.value]" - }, - "SERVICE_WEB_NAME": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.name.value]" - }, - "SERVICE_WEB_URI": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-container-app', parameters('serviceName'))), '2022-09-01').outputs.uri.value]" - } - } - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "appserviceplan", - "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('appServicePlanName'))), createObject('value', parameters('appServicePlanName')), createObject('value', format('{0}{1}', variables('abbrs').webServerFarms, variables('resourceToken'))))]", - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "sku": { - "value": { - "name": "Y1", - "tier": "Dynamic" - } - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "8289034454652170240" - }, - "description": "Creates an Azure App Service plan." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "kind": { - "type": "string", - "defaultValue": "" - }, - "reserved": { - "type": "bool", - "defaultValue": true - }, - "sku": { - "type": "object" - } - }, - "resources": [ - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2022-03-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "sku": "[parameters('sku')]", - "kind": "[parameters('kind')]", - "properties": { - "reserved": "[parameters('reserved')]" - } - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.Web/serverfarms', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "function", - "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('functionServiceName'))), createObject('value', parameters('functionServiceName')), createObject('value', format('{0}function-{1}', variables('abbrs').webSitesFunctions, variables('resourceToken'))))]", - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "applicationInsightsName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" - }, - "appServicePlanId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'appserviceplan'), '2022-09-01').outputs.id.value]" - }, - "keyVaultName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" - }, - "storageAccountName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.name.value]" - }, - "allowedOrigins": { - "value": [ - "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_URI.value]" - ] - }, - "appSettings": { - "value": { - "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]", - "AZURE_SEARCH_SERVICE_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]", - "AZURE_SEARCH_INDEX": "[parameters('searchIndexName')]", - "AZURE_SEARCH_SEMANTIC_RANKER": "[variables('actualSearchServiceSemanticRankerLevel')]", - "AZURE_STORAGE_BLOB_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]", - "AZURE_OPENAI_EMBEDDING_DEPLOYMENT": "[if(parameters('useAOAI'), parameters('azureEmbeddingDeploymentName'), '')]", - "OPENAI_EMBEDDING_DEPLOYMENT": "[if(parameters('useAOAI'), '', parameters('openAiEmbeddingDeployment'))]", - "AZURE_OPENAI_ENDPOINT": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value, '')]", - "USE_VISION": "[string(parameters('useVision'))]", - "USE_AOAI": "[string(parameters('useAOAI'))]", - "AZURE_COMPUTER_VISION_ENDPOINT": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]", - "OPENAI_API_KEY": "[if(parameters('useAOAI'), '', parameters('openAIApiKey'))]" - } - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13325449824862561000" - } - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "allowedOrigins": { - "type": "array", - "defaultValue": [] - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "" - }, - "appServicePlanId": { - "type": "string" - }, - "appSettings": { - "type": "secureObject", - "defaultValue": {} - }, - "keyVaultName": { - "type": "string" - }, - "serviceName": { - "type": "string", - "defaultValue": "function" - }, - "storageAccountName": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-function', parameters('serviceName'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('name')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[union(parameters('tags'), createObject('azd-service-name', parameters('serviceName')))]" - }, - "allowedOrigins": { - "value": "[parameters('allowedOrigins')]" - }, - "alwaysOn": { - "value": false - }, - "appSettings": { - "value": "[parameters('appSettings')]" - }, - "applicationInsightsName": { - "value": "[parameters('applicationInsightsName')]" - }, - "appServicePlanId": { - "value": "[parameters('appServicePlanId')]" - }, - "keyVaultName": { - "value": "[parameters('keyVaultName')]" - }, - "runtimeName": { - "value": "dotnet-isolated" - }, - "runtimeVersion": { - "value": "8.0" - }, - "storageAccountName": { - "value": "[parameters('storageAccountName')]" - }, - "scmDoBuildDuringDeployment": { - "value": false - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "5436002279462752259" - }, - "description": "Creates an Azure Function in an existing Azure App Service plan." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "" - }, - "appServicePlanId": { - "type": "string" - }, - "keyVaultName": { - "type": "string", - "defaultValue": "" - }, - "managedIdentity": { - "type": "bool", - "defaultValue": "[not(empty(parameters('keyVaultName')))]" - }, - "storageAccountName": { - "type": "string" - }, - "runtimeName": { - "type": "string", - "allowedValues": [ - "dotnet", - "dotnetcore", - "dotnet-isolated", - "node", - "python", - "java", - "powershell", - "custom" - ] - }, - "runtimeNameAndVersion": { - "type": "string", - "defaultValue": "[format('{0}|{1}', parameters('runtimeName'), parameters('runtimeVersion'))]" - }, - "runtimeVersion": { - "type": "string" - }, - "extensionVersion": { - "type": "string", - "defaultValue": "~4", - "allowedValues": [ - "~4", - "~3", - "~2", - "~1" - ] - }, - "kind": { - "type": "string", - "defaultValue": "functionapp,linux" - }, - "allowedOrigins": { - "type": "array", - "defaultValue": [] - }, - "alwaysOn": { - "type": "bool", - "defaultValue": true - }, - "appCommandLine": { - "type": "string", - "defaultValue": "" - }, - "appSettings": { - "type": "secureObject", - "defaultValue": {} - }, - "clientAffinityEnabled": { - "type": "bool", - "defaultValue": false - }, - "enableOryxBuild": { - "type": "bool", - "defaultValue": "[contains(parameters('kind'), 'linux')]" - }, - "functionAppScaleLimit": { - "type": "int", - "defaultValue": -1 - }, - "linuxFxVersion": { - "type": "string", - "defaultValue": "[parameters('runtimeNameAndVersion')]" - }, - "minimumElasticInstanceCount": { - "type": "int", - "defaultValue": -1 - }, - "numberOfWorkers": { - "type": "int", - "defaultValue": -1 - }, - "scmDoBuildDuringDeployment": { - "type": "bool", - "defaultValue": true - }, - "use32BitWorkerProcess": { - "type": "bool", - "defaultValue": false - }, - "healthCheckPath": { - "type": "string", - "defaultValue": "" - } - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-functions', parameters('name'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('name')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[parameters('tags')]" - }, - "allowedOrigins": { - "value": "[parameters('allowedOrigins')]" - }, - "alwaysOn": { - "value": "[parameters('alwaysOn')]" - }, - "appCommandLine": { - "value": "[parameters('appCommandLine')]" - }, - "applicationInsightsName": { - "value": "[parameters('applicationInsightsName')]" - }, - "appServicePlanId": { - "value": "[parameters('appServicePlanId')]" - }, - "appSettings": { - "value": "[union(parameters('appSettings'), createObject('AzureWebJobsStorage', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2021-09-01').keys[0].value, environment().suffixes.storage), 'FUNCTIONS_EXTENSION_VERSION', parameters('extensionVersion'), 'FUNCTIONS_WORKER_RUNTIME', parameters('runtimeName')))]" - }, - "clientAffinityEnabled": { - "value": "[parameters('clientAffinityEnabled')]" - }, - "enableOryxBuild": { - "value": "[parameters('enableOryxBuild')]" - }, - "functionAppScaleLimit": { - "value": "[parameters('functionAppScaleLimit')]" - }, - "healthCheckPath": { - "value": "[parameters('healthCheckPath')]" - }, - "keyVaultName": { - "value": "[parameters('keyVaultName')]" - }, - "kind": { - "value": "[parameters('kind')]" - }, - "linuxFxVersion": { - "value": "[parameters('linuxFxVersion')]" - }, - "managedIdentity": { - "value": "[parameters('managedIdentity')]" - }, - "minimumElasticInstanceCount": { - "value": "[parameters('minimumElasticInstanceCount')]" - }, - "numberOfWorkers": { - "value": "[parameters('numberOfWorkers')]" - }, - "runtimeName": { - "value": "[parameters('runtimeName')]" - }, - "runtimeVersion": { - "value": "[parameters('runtimeVersion')]" - }, - "runtimeNameAndVersion": { - "value": "[parameters('runtimeNameAndVersion')]" - }, - "scmDoBuildDuringDeployment": { - "value": "[parameters('scmDoBuildDuringDeployment')]" - }, - "use32BitWorkerProcess": { - "value": "[parameters('use32BitWorkerProcess')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "15018783407009142091" - }, - "description": "Creates an Azure App Service in an existing Azure App Service plan." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "applicationInsightsName": { - "type": "string", - "defaultValue": "" - }, - "appServicePlanId": { - "type": "string" - }, - "keyVaultName": { - "type": "string", - "defaultValue": "" - }, - "managedIdentity": { - "type": "bool", - "defaultValue": "[not(empty(parameters('keyVaultName')))]" - }, - "runtimeName": { - "type": "string", - "allowedValues": [ - "dotnet", - "dotnetcore", - "dotnet-isolated", - "node", - "python", - "java", - "powershell", - "custom" - ] - }, - "runtimeNameAndVersion": { - "type": "string", - "defaultValue": "[format('{0}|{1}', parameters('runtimeName'), parameters('runtimeVersion'))]" - }, - "runtimeVersion": { - "type": "string" - }, - "kind": { - "type": "string", - "defaultValue": "app,linux" - }, - "allowedOrigins": { - "type": "array", - "defaultValue": [] - }, - "alwaysOn": { - "type": "bool", - "defaultValue": true - }, - "appCommandLine": { - "type": "string", - "defaultValue": "" - }, - "appSettings": { - "type": "secureObject", - "defaultValue": {} - }, - "clientAffinityEnabled": { - "type": "bool", - "defaultValue": false - }, - "enableOryxBuild": { - "type": "bool", - "defaultValue": "[contains(parameters('kind'), 'linux')]" - }, - "functionAppScaleLimit": { - "type": "int", - "defaultValue": -1 - }, - "linuxFxVersion": { - "type": "string", - "defaultValue": "[parameters('runtimeNameAndVersion')]" - }, - "minimumElasticInstanceCount": { - "type": "int", - "defaultValue": -1 - }, - "numberOfWorkers": { - "type": "int", - "defaultValue": -1 - }, - "scmDoBuildDuringDeployment": { - "type": "bool", - "defaultValue": false - }, - "use32BitWorkerProcess": { - "type": "bool", - "defaultValue": false - }, - "ftpsState": { - "type": "string", - "defaultValue": "FtpsOnly" - }, - "healthCheckPath": { - "type": "string", - "defaultValue": "" - } - }, - "resources": [ - { - "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies", - "apiVersion": "2022-03-01", - "name": "[format('{0}/{1}', parameters('name'), 'ftp')]", - "properties": { - "allow": false - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', parameters('name'))]" - ] - }, - { - "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies", - "apiVersion": "2022-03-01", - "name": "[format('{0}/{1}', parameters('name'), 'scm')]", - "properties": { - "allow": false - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', parameters('name'))]" - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2022-03-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "[parameters('kind')]", - "properties": { - "serverFarmId": "[parameters('appServicePlanId')]", - "siteConfig": { - "linuxFxVersion": "[parameters('linuxFxVersion')]", - "alwaysOn": "[parameters('alwaysOn')]", - "ftpsState": "[parameters('ftpsState')]", - "minTlsVersion": "1.2", - "appCommandLine": "[parameters('appCommandLine')]", - "numberOfWorkers": "[if(not(equals(parameters('numberOfWorkers'), -1)), parameters('numberOfWorkers'), null())]", - "minimumElasticInstanceCount": "[if(not(equals(parameters('minimumElasticInstanceCount'), -1)), parameters('minimumElasticInstanceCount'), null())]", - "use32BitWorkerProcess": "[parameters('use32BitWorkerProcess')]", - "functionAppScaleLimit": "[if(not(equals(parameters('functionAppScaleLimit'), -1)), parameters('functionAppScaleLimit'), null())]", - "healthCheckPath": "[parameters('healthCheckPath')]", - "cors": { - "allowedOrigins": "[union(createArray('https://portal.azure.com', 'https://ms.portal.azure.com'), parameters('allowedOrigins'))]" - } - }, - "clientAffinityEnabled": "[parameters('clientAffinityEnabled')]", - "httpsOnly": true - }, - "identity": { - "type": "[if(parameters('managedIdentity'), 'SystemAssigned', 'None')]" - } - }, - { - "type": "Microsoft.Web/sites/config", - "apiVersion": "2022-03-01", - "name": "[format('{0}/{1}', parameters('name'), 'logs')]", - "properties": { - "applicationLogs": { - "fileSystem": { - "level": "Verbose" - } - }, - "detailedErrorMessages": { - "enabled": true - }, - "failedRequestsTracing": { - "enabled": true - }, - "httpLogs": { - "fileSystem": { - "enabled": true, - "retentionInDays": 1, - "retentionInMb": 35 - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', parameters('name'))]", - "[resourceId('Microsoft.Resources/deployments', format('{0}-appSettings', parameters('name')))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[format('{0}-appSettings', parameters('name'))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('name')]" - }, - "appSettings": { - "value": "[union(parameters('appSettings'), createObject('SCM_DO_BUILD_DURING_DEPLOYMENT', string(parameters('scmDoBuildDuringDeployment')), 'ENABLE_ORYX_BUILD', string(parameters('enableOryxBuild'))), if(and(equals(parameters('runtimeName'), 'python'), equals(parameters('appCommandLine'), '')), createObject('PYTHON_ENABLE_GUNICORN_MULTIWORKERS', 'true'), createObject()), if(not(empty(parameters('applicationInsightsName'))), createObject('APPLICATIONINSIGHTS_CONNECTION_STRING', reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2020-02-02').ConnectionString), createObject()), if(not(empty(parameters('keyVaultName'))), createObject('AZURE_KEY_VAULT_ENDPOINT', reference(resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName')), '2022-07-01').vaultUri), createObject()))]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "8872422051335608470" - }, - "description": "Updates app settings for an Azure App Service." - }, - "parameters": { - "name": { - "type": "string", - "metadata": { - "description": "The name of the app service resource within the current resource group scope" - } - }, - "appSettings": { - "type": "secureObject", - "metadata": { - "description": "The app settings to be applied to the app service" - } - } - }, - "resources": [ - { - "type": "Microsoft.Web/sites/config", - "apiVersion": "2022-03-01", - "name": "[format('{0}/{1}', parameters('name'), 'appsettings')]", - "properties": "[parameters('appSettings')]" - } - ] - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', parameters('name'))]" - ] - } - ], - "outputs": { - "identityPrincipalId": { - "type": "string", - "value": "[if(parameters('managedIdentity'), reference(resourceId('Microsoft.Web/sites', parameters('name')), '2022-03-01', 'full').identity.principalId, '')]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - }, - "uri": { - "type": "string", - "value": "[format('https://{0}', reference(resourceId('Microsoft.Web/sites', parameters('name')), '2022-03-01').defaultHostName)]" - } - } - } - } - } - ], - "outputs": { - "identityPrincipalId": { - "type": "string", - "value": "[if(parameters('managedIdentity'), reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.identityPrincipalId.value, '')]" - }, - "name": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.name.value]" - }, - "uri": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-functions', parameters('name'))), '2022-09-01').outputs.uri.value]" - } - } - } - } - } - ], - "outputs": { - "SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.identityPrincipalId.value]" - }, - "SERVICE_FUNCTION_NAME": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.name.value]" - }, - "SERVICE_FUNCTION_URI": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-function', parameters('serviceName'))), '2022-09-01').outputs.uri.value]" - } - } - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'appserviceplan')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "monitoring", - "resourceGroup": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "includeApplicationInsights": { - "value": true - }, - "logAnalyticsName": "[if(not(empty(parameters('logAnalyticsName'))), createObject('value', parameters('logAnalyticsName')), createObject('value', format('{0}{1}', variables('abbrs').operationalInsightsWorkspaces, variables('resourceToken'))))]", - "applicationInsightsName": "[if(not(empty(parameters('applicationInsightsName'))), createObject('value', parameters('applicationInsightsName')), createObject('value', format('{0}{1}', variables('abbrs').insightsComponents, variables('resourceToken'))))]", - "applicationInsightsDashboardName": "[if(not(empty(parameters('applicationInsightsDashboardName'))), createObject('value', parameters('applicationInsightsDashboardName')), createObject('value', format('{0}{1}', variables('abbrs').portalDashboards, variables('resourceToken'))))]" - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "9649583309334040372" - }, - "description": "Creates an Application Insights instance and a Log Analytics workspace." - }, - "parameters": { - "logAnalyticsName": { - "type": "string" - }, - "includeApplicationInsights": { - "type": "bool", - "defaultValue": false - }, - "applicationInsightsName": { - "type": "string" - }, - "applicationInsightsDashboardName": { - "type": "string", - "defaultValue": "" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - } - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "loganalytics", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('logAnalyticsName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[parameters('tags')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "14042274885298020376" - }, - "description": "Creates a Log Analytics workspace." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - } - }, - "resources": [ - { - "type": "Microsoft.OperationalInsights/workspaces", - "apiVersion": "2021-12-01-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "properties": { - "retentionInDays": 30, - "features": { - "searchVersion": 1 - }, - "sku": { - "name": "PerGB2018" - } - } - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - } - }, - { - "condition": "[parameters('includeApplicationInsights')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "applicationinsights", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('applicationInsightsName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tags": { - "value": "[parameters('tags')]" - }, - "dashboardName": { - "value": "[parameters('applicationInsightsDashboardName')]" - }, - "logAnalyticsWorkspaceId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.id.value]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "14163752244503191857" - }, - "description": "Creates an Application Insights instance based on an existing Log Analytics workspace." - }, - "parameters": { - "name": { - "type": "string" - }, - "dashboardName": { - "type": "string", - "defaultValue": "" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "logAnalyticsWorkspaceId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Insights/components", - "apiVersion": "2020-02-02", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "web", - "properties": { - "Application_Type": "web", - "WorkspaceResourceId": "[parameters('logAnalyticsWorkspaceId')]" - } - }, - { - "condition": "[not(empty(parameters('dashboardName')))]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "application-insights-dashboard", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": { - "value": "[parameters('dashboardName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "applicationInsightsName": { - "value": "[parameters('name')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "4772814496944658769" - }, - "description": "Creates a dashboard for an Application Insights instance." - }, - "parameters": { - "name": { - "type": "string" - }, - "applicationInsightsName": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - } - }, - "resources": [ - { - "type": "Microsoft.Portal/dashboards", - "apiVersion": "2020-09-01-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "properties": { - "lenses": [ - { - "order": 0, - "parts": [ - { - "position": { - "x": 0, - "y": 0, - "colSpan": 2, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "id", - "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - { - "name": "Version", - "value": "1.0" - } - ], - "type": "Extension/AppInsightsExtension/PartType/AspNetOverviewPinnedPart", - "asset": { - "idInputName": "id", - "type": "ApplicationInsights" - }, - "defaultMenuItemId": "overview" - } - }, - { - "position": { - "x": 2, - "y": 0, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "Version", - "value": "1.0" - } - ], - "type": "Extension/AppInsightsExtension/PartType/ProactiveDetectionAsyncPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - }, - "defaultMenuItemId": "ProactiveDetection" - } - }, - { - "position": { - "x": 3, - "y": 0, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "ResourceId", - "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - } - ], - "type": "Extension/AppInsightsExtension/PartType/QuickPulseButtonSmallPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - } - } - }, - { - "position": { - "x": 4, - "y": 0, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "TimeContext", - "value": { - "durationMs": 86400000, - "endTime": null, - "createdTime": "2018-05-04T01:20:33.345Z", - "isInitialTime": true, - "grain": 1, - "useDashboardTimeRange": false - } - }, - { - "name": "Version", - "value": "1.0" - } - ], - "type": "Extension/AppInsightsExtension/PartType/AvailabilityNavButtonPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - } - } - }, - { - "position": { - "x": 5, - "y": 0, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "TimeContext", - "value": { - "durationMs": 86400000, - "endTime": null, - "createdTime": "2018-05-08T18:47:35.237Z", - "isInitialTime": true, - "grain": 1, - "useDashboardTimeRange": false - } - }, - { - "name": "ConfigurationId", - "value": "78ce933e-e864-4b05-a27b-71fd55a6afad" - } - ], - "type": "Extension/AppInsightsExtension/PartType/AppMapButtonPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - } - } - }, - { - "position": { - "x": 0, - "y": 1, - "colSpan": 3, - "rowSpan": 1 - }, - "metadata": { - "inputs": [], - "type": "Extension/HubsExtension/PartType/MarkdownPart", - "settings": { - "content": { - "settings": { - "content": "# Usage", - "title": "", - "subtitle": "" - } - } - } - } - }, - { - "position": { - "x": 3, - "y": 1, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "TimeContext", - "value": { - "durationMs": 86400000, - "endTime": null, - "createdTime": "2018-05-04T01:22:35.782Z", - "isInitialTime": true, - "grain": 1, - "useDashboardTimeRange": false - } - } - ], - "type": "Extension/AppInsightsExtension/PartType/UsageUsersOverviewPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - } - } - }, - { - "position": { - "x": 4, - "y": 1, - "colSpan": 3, - "rowSpan": 1 - }, - "metadata": { - "inputs": [], - "type": "Extension/HubsExtension/PartType/MarkdownPart", - "settings": { - "content": { - "settings": { - "content": "# Reliability", - "title": "", - "subtitle": "" - } - } - } - } - }, - { - "position": { - "x": 7, - "y": 1, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ResourceId", - "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - { - "name": "DataModel", - "value": { - "version": "1.0.0", - "timeContext": { - "durationMs": 86400000, - "createdTime": "2018-05-04T23:42:40.072Z", - "isInitialTime": false, - "grain": 1, - "useDashboardTimeRange": false - } - }, - "isOptional": true - }, - { - "name": "ConfigurationId", - "value": "8a02f7bf-ac0f-40e1-afe9-f0e72cfee77f", - "isOptional": true - } - ], - "type": "Extension/AppInsightsExtension/PartType/CuratedBladeFailuresPinnedPart", - "isAdapter": true, - "asset": { - "idInputName": "ResourceId", - "type": "ApplicationInsights" - }, - "defaultMenuItemId": "failures" - } - }, - { - "position": { - "x": 8, - "y": 1, - "colSpan": 3, - "rowSpan": 1 - }, - "metadata": { - "inputs": [], - "type": "Extension/HubsExtension/PartType/MarkdownPart", - "settings": { - "content": { - "settings": { - "content": "# Responsiveness\r\n", - "title": "", - "subtitle": "" - } - } - } - } - }, - { - "position": { - "x": 11, - "y": 1, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ResourceId", - "value": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - { - "name": "DataModel", - "value": { - "version": "1.0.0", - "timeContext": { - "durationMs": 86400000, - "createdTime": "2018-05-04T23:43:37.804Z", - "isInitialTime": false, - "grain": 1, - "useDashboardTimeRange": false - } - }, - "isOptional": true - }, - { - "name": "ConfigurationId", - "value": "2a8ede4f-2bee-4b9c-aed9-2db0e8a01865", - "isOptional": true - } - ], - "type": "Extension/AppInsightsExtension/PartType/CuratedBladePerformancePinnedPart", - "isAdapter": true, - "asset": { - "idInputName": "ResourceId", - "type": "ApplicationInsights" - }, - "defaultMenuItemId": "performance" - } - }, - { - "position": { - "x": 12, - "y": 1, - "colSpan": 3, - "rowSpan": 1 - }, - "metadata": { - "inputs": [], - "type": "Extension/HubsExtension/PartType/MarkdownPart", - "settings": { - "content": { - "settings": { - "content": "# Browser", - "title": "", - "subtitle": "" - } - } - } - } - }, - { - "position": { - "x": 15, - "y": 1, - "colSpan": 1, - "rowSpan": 1 - }, - "metadata": { - "inputs": [ - { - "name": "ComponentId", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "MetricsExplorerJsonDefinitionId", - "value": "BrowserPerformanceTimelineMetrics" - }, - { - "name": "TimeContext", - "value": { - "durationMs": 86400000, - "createdTime": "2018-05-08T12:16:27.534Z", - "isInitialTime": false, - "grain": 1, - "useDashboardTimeRange": false - } - }, - { - "name": "CurrentFilter", - "value": { - "eventTypes": [ - 4, - 1, - 3, - 5, - 2, - 6, - 13 - ], - "typeFacets": {}, - "isPermissive": false - } - }, - { - "name": "id", - "value": { - "Name": "[parameters('applicationInsightsName')]", - "SubscriptionId": "[subscription().subscriptionId]", - "ResourceGroup": "[resourceGroup().name]" - } - }, - { - "name": "Version", - "value": "1.0" - } - ], - "type": "Extension/AppInsightsExtension/PartType/MetricsExplorerBladePinnedPart", - "asset": { - "idInputName": "ComponentId", - "type": "ApplicationInsights" - }, - "defaultMenuItemId": "browser" - } - }, - { - "position": { - "x": 0, - "y": 2, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "sessions/count", - "aggregationType": 5, - "namespace": "microsoft.insights/components/kusto", - "metricVisualization": { - "displayName": "Sessions", - "color": "#47BDF5" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "users/count", - "aggregationType": 5, - "namespace": "microsoft.insights/components/kusto", - "metricVisualization": { - "displayName": "Users", - "color": "#7E58FF" - } - } - ], - "title": "Unique sessions and users", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - }, - "openBladeOnClick": { - "openBlade": true, - "destinationBlade": { - "extensionName": "HubsExtension", - "bladeName": "ResourceMenuBlade", - "parameters": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", - "menuid": "segmentationUsers" - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 4, - "y": 2, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "requests/failed", - "aggregationType": 7, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Failed requests", - "color": "#EC008C" - } - } - ], - "title": "Failed requests", - "visualization": { - "chartType": 3, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - }, - "openBladeOnClick": { - "openBlade": true, - "destinationBlade": { - "extensionName": "HubsExtension", - "bladeName": "ResourceMenuBlade", - "parameters": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", - "menuid": "failures" - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 8, - "y": 2, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "requests/duration", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Server response time", - "color": "#00BCF2" - } - } - ], - "title": "Server response time", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - }, - "openBladeOnClick": { - "openBlade": true, - "destinationBlade": { - "extensionName": "HubsExtension", - "bladeName": "ResourceMenuBlade", - "parameters": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", - "menuid": "performance" - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 12, - "y": 2, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "browserTimings/networkDuration", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Page load network connect time", - "color": "#7E58FF" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "browserTimings/processingDuration", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Client processing time", - "color": "#44F1C8" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "browserTimings/sendDuration", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Send request time", - "color": "#EB9371" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "browserTimings/receiveDuration", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Receiving response time", - "color": "#0672F1" - } - } - ], - "title": "Average page load time breakdown", - "visualization": { - "chartType": 3, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 0, - "y": 5, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "availabilityResults/availabilityPercentage", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Availability", - "color": "#47BDF5" - } - } - ], - "title": "Average availability", - "visualization": { - "chartType": 3, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - }, - "openBladeOnClick": { - "openBlade": true, - "destinationBlade": { - "extensionName": "HubsExtension", - "bladeName": "ResourceMenuBlade", - "parameters": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]", - "menuid": "availability" - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 4, - "y": 5, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "exceptions/server", - "aggregationType": 7, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Server exceptions", - "color": "#47BDF5" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "dependencies/failed", - "aggregationType": 7, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Dependency failures", - "color": "#7E58FF" - } - } - ], - "title": "Server exceptions and Dependency failures", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 8, - "y": 5, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "performanceCounters/processorCpuPercentage", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Processor time", - "color": "#47BDF5" - } - }, - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "performanceCounters/processCpuPercentage", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Process CPU", - "color": "#7E58FF" - } - } - ], - "title": "Average processor and process CPU utilization", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 12, - "y": 5, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "exceptions/browser", - "aggregationType": 7, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Browser exceptions", - "color": "#47BDF5" - } - } - ], - "title": "Browser exceptions", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 0, - "y": 8, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "availabilityResults/count", - "aggregationType": 7, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Availability test results count", - "color": "#47BDF5" - } - } - ], - "title": "Availability test results count", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 4, - "y": 8, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "performanceCounters/processIOBytesPerSecond", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Process IO rate", - "color": "#47BDF5" - } - } - ], - "title": "Average process I/O rate", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - }, - { - "position": { - "x": 8, - "y": 8, - "colSpan": 4, - "rowSpan": 3 - }, - "metadata": { - "inputs": [ - { - "name": "options", - "value": { - "chart": { - "metrics": [ - { - "resourceMetadata": { - "id": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Insights/components/{2}', subscription().subscriptionId, resourceGroup().name, parameters('applicationInsightsName'))]" - }, - "name": "performanceCounters/memoryAvailableBytes", - "aggregationType": 4, - "namespace": "microsoft.insights/components", - "metricVisualization": { - "displayName": "Available memory", - "color": "#47BDF5" - } - } - ], - "title": "Average available memory", - "visualization": { - "chartType": 2, - "legendVisualization": { - "isVisible": true, - "position": 2, - "hideSubtitle": false - }, - "axisVisualization": { - "x": { - "isVisible": true, - "axisType": 2 - }, - "y": { - "isVisible": true, - "axisType": 1 - } - } - } - } - } - }, - { - "name": "sharedTimeRange", - "isOptional": true - } - ], - "type": "Extension/HubsExtension/PartType/MonitorChartPart", - "settings": {} - } - } - ] - } - ] - } - } - ] - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Insights/components', parameters('name'))]" - ] - } - ], - "outputs": { - "connectionString": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Insights/components', parameters('name')), '2020-02-02').ConnectionString]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.Insights/components', parameters('name'))]" - }, - "instrumentationKey": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Insights/components', parameters('name')), '2020-02-02').InstrumentationKey]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'loganalytics')]" - ] - } - ], - "outputs": { - "applicationInsightsConnectionString": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.connectionString.value]" - }, - "applicationInsightsId": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.id.value]" - }, - "applicationInsightsInstrumentationKey": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.instrumentationKey.value]" - }, - "applicationInsightsName": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'applicationinsights'), '2022-09-01').outputs.name.value]" - }, - "logAnalyticsWorkspaceId": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.id.value]" - }, - "logAnalyticsWorkspaceName": { - "type": "string", - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'loganalytics'), '2022-09-01').outputs.name.value]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useAOAI')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "openai", - "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('openAiServiceName'))), createObject('value', parameters('openAiServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesAccounts, variables('resourceToken'))))]", - "location": { - "value": "[parameters('openAiResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "sku": { - "value": { - "name": "[parameters('openAiSkuName')]" - } - }, - "deployments": { - "value": "[concat(createArray(createObject('name', parameters('azureEmbeddingDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureEmbeddingModelName'), 'version', '2'), 'sku', createObject('name', 'Standard', 'capacity', parameters('embeddingDeploymentCapacity')))), if(parameters('useVision'), createArray(createObject('name', parameters('azureChatGptDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIChatGptModelName'), 'version', '2024-05-13'), 'sku', createObject('name', 'Standard', 'capacity', parameters('chatGptDeploymentCapacity')))), createArray(createObject('name', parameters('azureChatGptDeploymentName'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIChatGptModelName'), 'version', parameters('azureOpenAIChatGptModelVersion')), 'sku', createObject('name', 'Standard', 'capacity', parameters('chatGptDeploymentCapacity'))))))]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13725164836340477772" - }, - "description": "Creates an Azure Cognitive Services instance." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "customSubDomainName": { - "type": "string", - "defaultValue": "[parameters('name')]", - "metadata": { - "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." - } - }, - "deployments": { - "type": "array", - "defaultValue": [] - }, - "kind": { - "type": "string", - "defaultValue": "OpenAI" - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "allowedValues": [ - "Enabled", - "Disabled" - ] - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "S0" - } - }, - "allowedIpRules": { - "type": "array", - "defaultValue": [] - }, - "networkAcls": { - "type": "object", - "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" - } - }, - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2023-05-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "[parameters('kind')]", - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "customSubDomainName": "[parameters('customSubDomainName')]", - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "networkAcls": "[parameters('networkAcls')]", - "disableLocalAuth": true - }, - "sku": "[parameters('sku')]" - }, - { - "copy": { - "name": "deployment", - "count": "[length(parameters('deployments'))]", - "mode": "serial", - "batchSize": 1 - }, - "type": "Microsoft.CognitiveServices/accounts/deployments", - "apiVersion": "2023-05-01", - "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", - "properties": { - "model": "[parameters('deployments')[copyIndex()].model]", - "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" - }, - "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - ] - } - ], - "outputs": { - "endpoint": { - "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" - }, - "endpoints": { - "type": "object", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useVision')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "computerVision", - "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('computerVisionServiceName'))), createObject('value', parameters('computerVisionServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesComputerVision, variables('resourceToken'))))]", - "kind": { - "value": "ComputerVision" - }, - "location": { - "value": "[parameters('computerVisionResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "sku": { - "value": { - "name": "[parameters('computerVisionSkuName')]" - } - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13725164836340477772" - }, - "description": "Creates an Azure Cognitive Services instance." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "customSubDomainName": { - "type": "string", - "defaultValue": "[parameters('name')]", - "metadata": { - "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." - } - }, - "deployments": { - "type": "array", - "defaultValue": [] - }, - "kind": { - "type": "string", - "defaultValue": "OpenAI" - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "allowedValues": [ - "Enabled", - "Disabled" - ] - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "S0" - } - }, - "allowedIpRules": { - "type": "array", - "defaultValue": [] - }, - "networkAcls": { - "type": "object", - "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" - } - }, - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2023-05-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "[parameters('kind')]", - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "customSubDomainName": "[parameters('customSubDomainName')]", - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "networkAcls": "[parameters('networkAcls')]", - "disableLocalAuth": true - }, - "sku": "[parameters('sku')]" - }, - { - "copy": { - "name": "deployment", - "count": "[length(parameters('deployments'))]", - "mode": "serial", - "batchSize": 1 - }, - "type": "Microsoft.CognitiveServices/accounts/deployments", - "apiVersion": "2023-05-01", - "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", - "properties": { - "model": "[parameters('deployments')[copyIndex()].model]", - "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" - }, - "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - ] - } - ], - "outputs": { - "endpoint": { - "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" - }, - "endpoints": { - "type": "object", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "formrecognizer", - "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('formRecognizerServiceName'))), createObject('value', parameters('formRecognizerServiceName')), createObject('value', format('{0}{1}', variables('abbrs').cognitiveServicesFormRecognizer, variables('resourceToken'))))]", - "kind": { - "value": "FormRecognizer" - }, - "location": { - "value": "[parameters('formRecognizerResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "sku": { - "value": { - "name": "[parameters('formRecognizerSkuName')]" - } - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13725164836340477772" - }, - "description": "Creates an Azure Cognitive Services instance." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "customSubDomainName": { - "type": "string", - "defaultValue": "[parameters('name')]", - "metadata": { - "description": "The custom subdomain name used to access the API. Defaults to the value of the name parameter." - } - }, - "deployments": { - "type": "array", - "defaultValue": [] - }, - "kind": { - "type": "string", - "defaultValue": "OpenAI" - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "allowedValues": [ - "Enabled", - "Disabled" - ] - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "S0" - } - }, - "allowedIpRules": { - "type": "array", - "defaultValue": [] - }, - "networkAcls": { - "type": "object", - "defaultValue": "[if(empty(parameters('allowedIpRules')), createObject('defaultAction', 'Allow'), createObject('ipRules', parameters('allowedIpRules'), 'defaultAction', 'Deny'))]" - } - }, - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2023-05-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "[parameters('kind')]", - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "customSubDomainName": "[parameters('customSubDomainName')]", - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "networkAcls": "[parameters('networkAcls')]", - "disableLocalAuth": true - }, - "sku": "[parameters('sku')]" - }, - { - "copy": { - "name": "deployment", - "count": "[length(parameters('deployments'))]", - "mode": "serial", - "batchSize": 1 - }, - "type": "Microsoft.CognitiveServices/accounts/deployments", - "apiVersion": "2023-05-01", - "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", - "properties": { - "model": "[parameters('deployments')[copyIndex()].model]", - "raiPolicyName": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'raiPolicyName'), null())]" - }, - "sku": "[coalesce(tryGet(parameters('deployments')[copyIndex()], 'sku'), createObject('name', 'Standard', 'capacity', 20))]", - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - ] - } - ], - "outputs": { - "endpoint": { - "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoint]" - }, - "endpoints": { - "type": "object", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2023-05-01').endpoints]" - }, - "id": { - "type": "string", - "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-service", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('searchServiceName'))), createObject('value', parameters('searchServiceName')), createObject('value', format('gptkb-{0}', variables('resourceToken'))))]", - "location": { - "value": "[parameters('searchServiceResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "authOptions": { - "value": { - "aadOrApiKey": { - "aadAuthFailureMode": "http401WithBearerChallenge" - } - } - }, - "sku": { - "value": { - "name": "[parameters('searchServiceSkuName')]" - } - }, - "semanticSearch": { - "value": "[variables('actualSearchServiceSemanticRankerLevel')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "17661970536534412467" - }, - "description": "Creates an Azure AI Search instance." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "standard" - } - }, - "authOptions": { - "type": "object", - "defaultValue": {} - }, - "disableLocalAuth": { - "type": "bool", - "defaultValue": false - }, - "disabledDataExfiltrationOptions": { - "type": "array", - "defaultValue": [] - }, - "encryptionWithCmk": { - "type": "object", - "defaultValue": { - "enforcement": "Unspecified" - } - }, - "hostingMode": { - "type": "string", - "defaultValue": "default", - "allowedValues": [ - "default", - "highDensity" - ] - }, - "networkRuleSet": { - "type": "object", - "defaultValue": { - "bypass": "None", - "ipRules": [] - } - }, - "partitionCount": { - "type": "int", - "defaultValue": 1 - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "enabled", - "allowedValues": [ - "enabled", - "disabled" - ] - }, - "replicaCount": { - "type": "int", - "defaultValue": 1 - }, - "semanticSearch": { - "type": "string", - "defaultValue": "disabled", - "allowedValues": [ - "disabled", - "free", - "standard" - ] - } - }, - "variables": { - "searchIdentityProvider": "[if(equals(parameters('sku').name, 'free'), null(), createObject('type', 'SystemAssigned'))]" - }, - "resources": [ - { - "type": "Microsoft.Search/searchServices", - "apiVersion": "2021-04-01-preview", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "identity": "[variables('searchIdentityProvider')]", - "properties": { - "authOptions": "[if(parameters('disableLocalAuth'), null(), parameters('authOptions'))]", - "disableLocalAuth": "[parameters('disableLocalAuth')]", - "disabledDataExfiltrationOptions": "[parameters('disabledDataExfiltrationOptions')]", - "encryptionWithCmk": "[parameters('encryptionWithCmk')]", - "hostingMode": "[parameters('hostingMode')]", - "networkRuleSet": "[parameters('networkRuleSet')]", - "partitionCount": "[parameters('partitionCount')]", - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "replicaCount": "[parameters('replicaCount')]", - "semanticSearch": "[parameters('semanticSearch')]" - }, - "sku": "[parameters('sku')]" - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.Search/searchServices', parameters('name'))]" - }, - "endpoint": { - "type": "string", - "value": "[format('https://{0}.search.windows.net/', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - }, - "principalId": { - "type": "string", - "value": "[if(not(empty(variables('searchIdentityProvider'))), reference(resourceId('Microsoft.Search/searchServices', parameters('name')), '2021-04-01-preview', 'full').identity.principalId, '')]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "name": "[if(not(empty(parameters('storageAccountName'))), createObject('value', parameters('storageAccountName')), createObject('value', format('{0}{1}', variables('abbrs').storageStorageAccounts, variables('resourceToken'))))]", - "location": { - "value": "[parameters('storageResourceGroupLocation')]" - }, - "tags": { - "value": "[variables('updatedTags')]" - }, - "publicNetworkAccess": { - "value": "Enabled" - }, - "allowBlobPublicAccess": { - "value": false - }, - "allowSharedKeyAccess": { - "value": false - }, - "defaultToOAuthAuthentication": { - "value": true - }, - "sku": { - "value": { - "name": "Standard_LRS" - } - }, - "deleteRetentionPolicy": { - "value": { - "enabled": true, - "days": 2 - } - }, - "containers": { - "value": [ - { - "name": "[parameters('storageContainerName')]", - "publicAccess": "None" - } - ] - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "13643245339099960210" - }, - "description": "Creates an Azure storage account." - }, - "parameters": { - "name": { - "type": "string" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "tags": { - "type": "object", - "defaultValue": {} - }, - "accessTier": { - "type": "string", - "defaultValue": "Hot", - "allowedValues": [ - "Cool", - "Hot", - "Premium" - ] - }, - "allowBlobPublicAccess": { - "type": "bool", - "defaultValue": true - }, - "allowCrossTenantReplication": { - "type": "bool", - "defaultValue": true - }, - "allowSharedKeyAccess": { - "type": "bool", - "defaultValue": true - }, - "containers": { - "type": "array", - "defaultValue": [] - }, - "corsRules": { - "type": "array", - "defaultValue": [] - }, - "defaultToOAuthAuthentication": { - "type": "bool", - "defaultValue": false - }, - "deleteRetentionPolicy": { - "type": "object", - "defaultValue": {} - }, - "dnsEndpointType": { - "type": "string", - "defaultValue": "Standard", - "allowedValues": [ - "AzureDnsZone", - "Standard" - ] - }, - "files": { - "type": "array", - "defaultValue": [] - }, - "kind": { - "type": "string", - "defaultValue": "StorageV2" - }, - "minimumTlsVersion": { - "type": "string", - "defaultValue": "TLS1_2" - }, - "queues": { - "type": "array", - "defaultValue": [] - }, - "shareDeleteRetentionPolicy": { - "type": "object", - "defaultValue": {} - }, - "supportsHttpsTrafficOnly": { - "type": "bool", - "defaultValue": true - }, - "tables": { - "type": "array", - "defaultValue": [] - }, - "networkAcls": { - "type": "object", - "defaultValue": { - "bypass": "AzureServices", - "defaultAction": "Allow" - } - }, - "publicNetworkAccess": { - "type": "string", - "defaultValue": "Enabled", - "allowedValues": [ - "Enabled", - "Disabled" - ] - }, - "sku": { - "type": "object", - "defaultValue": { - "name": "Standard_LRS" - } - } - }, - "resources": [ - { - "copy": { - "name": "storage::blobServices::container", - "count": "[length(parameters('containers'))]" - }, - "condition": "[not(empty(parameters('containers')))]", - "type": "Microsoft.Storage/storageAccounts/blobServices/containers", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}/{2}', parameters('name'), 'default', parameters('containers')[copyIndex()].name)]", - "properties": { - "publicAccess": "[coalesce(tryGet(parameters('containers')[copyIndex()], 'publicAccess'), 'None')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('name'), 'default')]" - ] - }, - { - "copy": { - "name": "storage::queueServices::queue", - "count": "[length(parameters('queues'))]" - }, - "condition": "[not(empty(parameters('queues')))]", - "type": "Microsoft.Storage/storageAccounts/queueServices/queues", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}/{2}', parameters('name'), 'default', parameters('queues')[copyIndex()].name)]", - "properties": { - "metadata": {} - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/queueServices', parameters('name'), 'default')]" - ] - }, - { - "condition": "[not(empty(parameters('containers')))]", - "type": "Microsoft.Storage/storageAccounts/blobServices", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}', parameters('name'), 'default')]", - "properties": { - "cors": { - "corsRules": "[parameters('corsRules')]" - }, - "deleteRetentionPolicy": "[parameters('deleteRetentionPolicy')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" - ] - }, - { - "condition": "[not(empty(parameters('files')))]", - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}', parameters('name'), 'default')]", - "properties": { - "cors": { - "corsRules": "[parameters('corsRules')]" - }, - "shareDeleteRetentionPolicy": "[parameters('shareDeleteRetentionPolicy')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" - ] - }, - { - "condition": "[not(empty(parameters('queues')))]", - "type": "Microsoft.Storage/storageAccounts/queueServices", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}', parameters('name'), 'default')]", - "properties": {}, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" - ] - }, - { - "condition": "[not(empty(parameters('tables')))]", - "type": "Microsoft.Storage/storageAccounts/tableServices", - "apiVersion": "2023-01-01", - "name": "[format('{0}/{1}', parameters('name'), 'default')]", - "properties": {}, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2023-01-01", - "name": "[parameters('name')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", - "kind": "[parameters('kind')]", - "sku": "[parameters('sku')]", - "properties": { - "accessTier": "[parameters('accessTier')]", - "allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]", - "allowCrossTenantReplication": "[parameters('allowCrossTenantReplication')]", - "allowSharedKeyAccess": "[parameters('allowSharedKeyAccess')]", - "defaultToOAuthAuthentication": "[parameters('defaultToOAuthAuthentication')]", - "dnsEndpointType": "[parameters('dnsEndpointType')]", - "minimumTlsVersion": "[parameters('minimumTlsVersion')]", - "networkAcls": "[parameters('networkAcls')]", - "publicNetworkAccess": "[parameters('publicNetworkAccess')]", - "supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]" - } - } - ], - "outputs": { - "id": { - "type": "string", - "value": "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" - }, - "name": { - "type": "string", - "value": "[parameters('name')]" - }, - "primaryEndpoints": { - "type": "object", - "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '2023-01-01').primaryEndpoints]" - } - } - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useAOAI')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "openai-role-user", - "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "formrecognizer-role-user", - "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "a97b65f3-24c7-4388-baec-2e87135dc908" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-role-user", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-contribrole-user", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-role-user", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-contrib-role-user", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "8ebe5a00-799e-43f5-93ac-243d3dce84a7" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-svccontrib-role-user", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "7ca78c08-252a-4471-8644-bb5ff32d4ba0" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useVision')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "vision-role-user", - "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[parameters('principalId')]" - }, - "roleDefinitionId": { - "value": "a97b65f3-24c7-4388-baec-2e87135dc908" - }, - "principalType": { - "value": "[parameters('principalType')]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useAOAI')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "openai-role-function", - "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "formrecognizer-role-function", - "resourceGroup": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "a97b65f3-24c7-4388-baec-2e87135dc908" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-role-function", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-contribrole-function", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-role-function", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-contrib-role-function", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "8ebe5a00-799e-43f5-93ac-243d3dce84a7" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-svccontrib-role-function", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "7ca78c08-252a-4471-8644-bb5ff32d4ba0" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useVision')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "vision-role-function", - "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "a97b65f3-24c7-4388-baec-2e87135dc908" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function')]", - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - ] - }, - { - "condition": "[parameters('useAOAI')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "openai-role-backend", - "resourceGroup": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-role-backend", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "storage-contribrole-backend", - "resourceGroup": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "ba92f5b4-2d11-453d-a403-e96b0029c9fe" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "search-role-backend", - "resourceGroup": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "1407120a-92aa-4202-b7e9-c0e197c71c8f" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - }, - { - "condition": "[parameters('useVision')]", - "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "vision-role-backend", - "resourceGroup": "[if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "principalId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_PRINCIPAL_ID.value]" - }, - "roleDefinitionId": { - "value": "a97b65f3-24c7-4388-baec-2e87135dc908" - }, - "principalType": { - "value": "ServicePrincipal" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.36.1.42791", - "templateHash": "1525080529756490231" - }, - "description": "Creates a role assignment for a service principal." - }, - "parameters": { - "principalId": { - "type": "string" - }, - "principalType": { - "type": "string", - "defaultValue": "ServicePrincipal", - "allowedValues": [ - "Device", - "ForeignGroup", - "Group", - "ServicePrincipal", - "User" - ] - }, - "roleDefinitionId": { - "type": "string" - } - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), parameters('roleDefinitionId'))]", - "properties": { - "principalId": "[parameters('principalId')]", - "principalType": "[parameters('principalType')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]" - } - } - ] - } - }, - "dependsOn": [ - "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web')]" - ] - } - ], - "outputs": { - "APPLICATIONINSIGHTS_CONNECTION_STRING": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsConnectionString.value]" - }, - "APPLICATIONINSIGHTS_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsName.value]" - }, - "AZURE_USE_APPLICATION_INSIGHTS": { - "type": "bool", - "value": "[parameters('useApplicationInsights')]" - }, - "AZURE_CONTAINER_ENVIRONMENT_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.environmentName.value]" - }, - "AZURE_CONTAINER_REGISTRY_ENDPOINT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryLoginServer.value]" - }, - "AZURE_CONTAINER_REGISTRY_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" - }, - "AZURE_CONTAINER_REGISTRY_RESOURCE_GROUP": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'container-apps'), '2022-09-01').outputs.registryName.value]" - }, - "AZURE_FORMRECOGNIZER_RESOURCE_GROUP": { - "type": "string", - "value": "[if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - }, - "AZURE_FORMRECOGNIZER_SERVICE": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.name.value]" - }, - "AZURE_FORMRECOGNIZER_SERVICE_ENDPOINT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('formRecognizerResourceGroupName'))), parameters('formRecognizerResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'formrecognizer'), '2022-09-01').outputs.endpoint.value]" - }, - "AZURE_COMPUTERVISION_RESOURCE_GROUP": { - "type": "string", - "value": "[if(parameters('useVision'), if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), '')]" - }, - "AZURE_COMPUTERVISION_SERVICE": { - "type": "string", - "value": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.name.value, '')]" - }, - "AZURE_COMPUTERVISION_SERVICE_ENDPOINT": { - "type": "string", - "value": "[if(parameters('useVision'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('computerVisionResourceGroupName'))), parameters('computerVisionResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'computerVision'), '2022-09-01').outputs.endpoint.value, '')]" - }, - "AZURE_KEY_VAULT_ENDPOINT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.endpoint.value]" - }, - "AZURE_KEY_VAULT_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'keyvault'), '2022-09-01').outputs.name.value]" - }, - "AZURE_KEY_VAULT_RESOURCE_GROUP": { - "type": "string", - "value": "[if(not(empty(parameters('keyVaultResourceGroupName'))), parameters('keyVaultResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - }, - "AZURE_LOCATION": { - "type": "string", - "value": "[parameters('location')]" - }, - "AZURE_OPENAI_RESOURCE_LOCATION": { - "type": "string", - "value": "[parameters('openAiResourceGroupLocation')]" - }, - "AZURE_OPENAI_CHATGPT_DEPLOYMENT": { - "type": "string", - "value": "[parameters('azureChatGptDeploymentName')]" - }, - "AZURE_OPENAI_EMBEDDING_DEPLOYMENT": { - "type": "string", - "value": "[parameters('azureEmbeddingDeploymentName')]" - }, - "AZURE_OPENAI_ENDPOINT": { - "type": "string", - "value": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.endpoint.value, '')]" - }, - "AZURE_OPENAI_RESOURCE_GROUP": { - "type": "string", - "value": "[if(parameters('useAOAI'), if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), '')]" - }, - "AZURE_OPENAI_SERVICE": { - "type": "string", - "value": "[if(parameters('useAOAI'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'openai'), '2022-09-01').outputs.name.value, '')]" - }, - "AZURE_RESOURCE_GROUP": { - "type": "string", - "value": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]" - }, - "AZURE_SEARCH_INDEX": { - "type": "string", - "value": "[parameters('searchIndexName')]" - }, - "AZURE_SEARCH_SERVICE": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.name.value]" - }, - "AZURE_SEARCH_SERVICE_ENDPOINT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'search-service'), '2022-09-01').outputs.endpoint.value]" - }, - "AZURE_SEARCH_SERVICE_RESOURCE_GROUP": { - "type": "string", - "value": "[if(not(empty(parameters('searchServiceResourceGroupName'))), parameters('searchServiceResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - }, - "AZURE_SEARCH_SERVICE_SKU": { - "type": "string", - "value": "[parameters('searchServiceSkuName')]" - }, - "AZURE_STORAGE_ACCOUNT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.name.value]" - }, - "AZURE_STORAGE_BLOB_ENDPOINT": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))), 'Microsoft.Resources/deployments', 'storage'), '2022-09-01').outputs.primaryEndpoints.value.blob]" - }, - "AZURE_STORAGE_CONTAINER": { - "type": "string", - "value": "[parameters('storageContainerName')]" - }, - "AZURE_STORAGE_RESOURCE_GROUP": { - "type": "string", - "value": "[if(not(empty(parameters('storageResourceGroupName'))), parameters('storageResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" - }, - "AZURE_TENANT_ID": { - "type": "string", - "value": "[tenant().tenantId]" - }, - "SERVICE_WEB_IDENTITY_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_IDENTITY_NAME.value]" - }, - "SERVICE_WEB_NAME": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'web'), '2022-09-01').outputs.SERVICE_WEB_NAME.value]" - }, - "SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID": { - "type": "string", - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))), 'Microsoft.Resources/deployments', 'function'), '2022-09-01').outputs.SERVICE_FUNCTION_IDENTITY_PRINCIPAL_ID.value]" - }, - "USE_AOAI": { - "type": "bool", - "value": "[parameters('useAOAI')]" - }, - "USE_VISION": { - "type": "bool", - "value": "[parameters('useVision')]" - }, - "OPENAI_EMBEDDING_DEPLOYMENT": { - "type": "string", - "value": "[parameters('openAiEmbeddingDeployment')]" - }, - "AZURE_OPENAI_CHATGPT_MODEL_VERSION": { - "type": "string", - "value": "[parameters('azureOpenAIChatGptModelVersion')]" - }, - "AZURE_OPENAI_CHATGPT_MODEL_NAME": { - "type": "string", - "value": "[parameters('azureOpenAIChatGptModelName')]" - } - } -} \ No newline at end of file