{ "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.18.4.5664", "templateHash": "16421825411901804024" } }, "parameters": { "environmentName": { "type": "string", "metadata": { "description": "Name of the the environment which is used to generate a short unique hash used in all resources." }, "maxLength": 64, "minLength": 1 }, "location": { "type": "string", "metadata": { "description": "Primary location for all resources" }, "minLength": 1 }, "appServicePlanName": { "type": "string", "defaultValue": "key1" }, "backendServiceName": { "type": "string", "defaultValue": "key2" }, "resourceGroupName": { "type": "string", "defaultValue": "rg" }, "searchServiceName": { "type": "string", "defaultValue": "sherlockqna-search" }, "searchServiceResourceGroupName": { "type": "string", "defaultValue": "rg-sherlock-openai-sbx-westeurope-01" }, "searchServiceResourceGroupLocation": { "type": "string", "defaultValue": "West Europe" }, "searchServiceSkuName": { "type": "string", "defaultValue": "standard" }, "searchIndexName": { "type": "string", "defaultValue": "gptkbindex" }, "storageAccountName": { "type": "string", "defaultValue": "sherlockqnastr" }, "storageResourceGroupName": { "type": "string", "defaultValue": "rg-sherlock-openai-sbx-westeurope-01" }, "storageResourceGroupLocation": { "type": "string", "defaultValue": "West Europe" }, "storageContainerName": { "type": "string", "defaultValue": "sherlockdocs" }, "openAiServiceName": { "type": "string", "defaultValue": "Sherlock-AI-test" }, "openAiResourceGroupName": { "type": "string", "defaultValue": "rg-sherlock-openai-sbx-westeurope-01" }, "openAiResourceGroupLocation": { "type": "string", "defaultValue": "eastus", "metadata": { "azd": { "type": "location" }, "description": "Location for the OpenAI resource group" }, "allowedValues": [ "eastus", "francecentral", "southcentralus", "uksouth", "westeurope" ] }, "openAiSkuName": { "type": "string", "defaultValue": "S0" }, "formRecognizerServiceName": { "type": "string", "defaultValue": "sherlockqna-formrecog" }, "formRecognizerResourceGroupName": { "type": "string", "defaultValue": "rg-sherlock-openai-sbx-westeurope-01" }, "formRecognizerResourceGroupLocation": { "type": "string", "defaultValue": "West Europe" }, "formRecognizerSkuName": { "type": "string", "defaultValue": "S0" }, "gptDeploymentName": { "type": "string", "defaultValue": "gpt-35-turbo" }, "gptDeploymentCapacity": { "type": "int", "defaultValue": 30 }, "gptModelName": { "type": "string", "defaultValue": "gpt-35-turbo" }, "chatGptDeploymentName": { "type": "string", "defaultValue": "gpt-35-turbo-16k" }, "chatGptDeploymentCapacity": { "type": "int", "defaultValue": 30 }, "chatGptModelName": { "type": "string", "defaultValue": "gpt-35-turbo-16k" }, "principalId": { "type": "string", "defaultValue": "a42f54c5-67f3-4935-ae36-a42ad8011e78", "metadata": { "description": "Id of the user or app to assign application roles" } } }, "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-", "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-" }, "abbrs": "[variables('$fxv#0')]", "resourceToken": "[toLower(uniqueString(subscription().id, parameters('environmentName'), parameters('location')))]", "tags": { "azd-env-name": "[parameters('environmentName')]" } }, "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('tags')]" }, { "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('tags')]" }, "sku": { "value": { "name": "B1", "capacity": 1 } }, "kind": { "value": "linux" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.18.4.5664", "templateHash": "9608612916691970434" } }, "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": "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('backendServiceName'))), createObject('value', parameters('backendServiceName')), createObject('value', format('{0}backend-{1}', variables('abbrs').webSitesAppService, variables('resourceToken'))))]", "location": { "value": "[parameters('location')]" }, "tags": { "value": "[union(variables('tags'), createObject('azd-service-name', 'backend'))]" }, "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]" }, "runtimeName": { "value": "python" }, "runtimeVersion": { "value": "3.10" }, "scmDoBuildDuringDeployment": { "value": true }, "managedIdentity": { "value": true }, "appSettings": { "value": { "AZURE_STORAGE_ACCOUNT": "[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_CONTAINER": "[parameters('storageContainerName')]", "AZURE_OPENAI_SERVICE": "[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'), '2023-05-01').outputs.name.value]", "AZURE_SEARCH_INDEX": "[parameters('searchIndexName')]", "AZURE_SEARCH_SERVICE": "[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_OPENAI_GPT_DEPLOYMENT": "[parameters('gptDeploymentName')]", "AZURE_OPENAI_CHATGPT_DEPLOYMENT": "[parameters('chatGptDeploymentName')]" } } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.18.4.5664", "templateHash": "9928361088941636336" } }, "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": "object", "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/config", "apiVersion": "2022-03-01", "name": "[format('{0}/{1}', parameters('name'), 'appsettings')]", "properties": "[union(parameters('appSettings'), createObject('SCM_DO_BUILD_DURING_DEPLOYMENT', string(parameters('scmDoBuildDuringDeployment')), 'ENABLE_ORYX_BUILD', string(parameters('enableOryxBuild'))), 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()))]", "dependsOn": [ "[resourceId('Microsoft.Web/sites', parameters('name'))]" ] }, { "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.Web/sites/config', parameters('name'), 'appsettings')]" ] }, { "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')]", "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')]" } } ], "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)]" } } } }, "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')]", "[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": "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('tags')]" }, "sku": { "value": { "name": "[parameters('openAiSkuName')]" } }, "deployments": { "value": [ { "name": "[parameters('gptDeploymentName')]", "model": { "format": "OpenAI", "name": "[parameters('gptModelName')]", "version": "0301" }, "scaleSettings": { "scaleType": "Standard" } }, { "name": "[parameters('chatGptDeploymentName')]", "model": { "format": "OpenAI", "name": "[parameters('chatGptModelName')]", "version": "0613" }, "scaleSettings": { "scaleType": "Standard" } } ] } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.18.4.5664", "templateHash": "5645337143362902405" } }, "parameters": { "name": { "type": "string" }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]" }, "tags": { "type": "object", "defaultValue": {} }, "customSubDomainName": { "type": "string", "defaultValue": "[parameters('name')]" }, "deployments": { "type": "array", "defaultValue": [] }, "kind": { "type": "string", "defaultValue": "OpenAI" }, "publicNetworkAccess": { "type": "string", "defaultValue": "Enabled" }, "sku": { "type": "object", "defaultValue": { "name": "S0" } } }, "resources": [ { "type": "Microsoft.CognitiveServices/accounts", "apiVersion": "2022-10-01", "name": "[parameters('name')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "kind": "[parameters('kind')]", "properties": { "customSubDomainName": "[parameters('customSubDomainName')]", "publicNetworkAccess": "[parameters('publicNetworkAccess')]", "networkAcls": { "defaultAction": "Allow", "virtualNetworkRules": [], "ipRules": [] } }, "sku": "[parameters('sku')]" }, { "copy": { "name": "deployment", "count": "[length(parameters('deployments'))]", "mode": "serial", "batchSize": 1 }, "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2022-10-01", "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", "properties": { "model": "[parameters('deployments')[copyIndex()].model]", "raiPolicyName": "[if(contains(parameters('deployments')[copyIndex()], 'raiPolicyName'), parameters('deployments')[copyIndex()].raiPolicyName, null())]", "scaleSettings": "[parameters('deployments')[copyIndex()].scaleSettings]" }, "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" ] } ], "outputs": { "endpoint": { "type": "string", "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2022-10-01').endpoint]" }, "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('tags')]" }, "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.18.4.5664", "templateHash": "5645337143362902405" } }, "parameters": { "name": { "type": "string" }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]" }, "tags": { "type": "object", "defaultValue": {} }, "customSubDomainName": { "type": "string", "defaultValue": "[parameters('name')]" }, "deployments": { "type": "array", "defaultValue": [] }, "kind": { "type": "string", "defaultValue": "OpenAI" }, "publicNetworkAccess": { "type": "string", "defaultValue": "Enabled" }, "sku": { "type": "object", "defaultValue": { "name": "S0" } } }, "resources": [ { "type": "Microsoft.CognitiveServices/accounts", "apiVersion": "2022-10-01", "name": "[parameters('name')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "kind": "[parameters('kind')]", "properties": { "customSubDomainName": "[parameters('customSubDomainName')]", "publicNetworkAccess": "[parameters('publicNetworkAccess')]", "networkAcls": { "defaultAction": "Allow", "virtualNetworkRules": [], "ipRules": [] } }, "sku": "[parameters('sku')]" }, { "copy": { "name": "deployment", "count": "[length(parameters('deployments'))]", "mode": "serial", "batchSize": 1 }, "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2022-10-01", "name": "[format('{0}/{1}', parameters('name'), parameters('deployments')[copyIndex()].name)]", "properties": { "model": "[parameters('deployments')[copyIndex()].model]", "raiPolicyName": "[if(contains(parameters('deployments')[copyIndex()], 'raiPolicyName'), parameters('deployments')[copyIndex()].raiPolicyName, null())]", "scaleSettings": "[parameters('deployments')[copyIndex()].scaleSettings]" }, "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('name'))]" ] } ], "outputs": { "endpoint": { "type": "string", "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('name')), '2022-10-01').endpoint]" }, "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('tags')]" }, "authOptions": { "value": { "aadOrApiKey": { "aadAuthFailureMode": "http401WithBearerChallenge" } } }, "sku": { "value": { "name": "[parameters('searchServiceSkuName')]" } }, "semanticSearch": { "value": "free" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.18.4.5664", "templateHash": "10830704314591863216" } }, "parameters": { "name": { "type": "string" }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]" }, "tags": { "type": "object", "defaultValue": {} }, "sku": { "type": "object", "defaultValue": { "name": "standard" } }, "authOptions": { "type": "object", "defaultValue": {} }, "semanticSearch": { "type": "string", "defaultValue": "disabled" } }, "resources": [ { "type": "Microsoft.Search/searchServices", "apiVersion": "2021-04-01-preview", "name": "[parameters('name')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "identity": { "type": "SystemAssigned" }, "properties": { "authOptions": "[parameters('authOptions')]", "disableLocalAuth": false, "disabledDataExfiltrationOptions": [], "encryptionWithCmk": { "enforcement": "Unspecified" }, "hostingMode": "default", "networkRuleSet": { "bypass": "None", "ipRules": [] }, "partitionCount": 1, "publicNetworkAccess": "Enabled", "replicaCount": 1, "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')]" } } } }, "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('tags')]" }, "publicNetworkAccess": { "value": "Enabled" }, "sku": { "value": { "name": "Standard_GRS" } }, "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.18.4.5664", "templateHash": "18311665087856610593" } }, "parameters": { "name": { "type": "string" }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]" }, "tags": { "type": "object", "defaultValue": {} }, "accessTier": { "type": "string", "defaultValue": "Hot", "allowedValues": [ "Hot", "Cool", "Premium" ] }, "allowBlobPublicAccess": { "type": "bool", "defaultValue": false }, "allowCrossTenantReplication": { "type": "bool", "defaultValue": true }, "allowSharedKeyAccess": { "type": "bool", "defaultValue": true }, "defaultToOAuthAuthentication": { "type": "bool", "defaultValue": false }, "deleteRetentionPolicy": { "type": "object", "defaultValue": {} }, "dnsEndpointType": { "type": "string", "defaultValue": "Standard", "allowedValues": [ "AzureDnsZone", "Standard" ] }, "kind": { "type": "string", "defaultValue": "StorageV2" }, "minimumTlsVersion": { "type": "string", "defaultValue": "TLS1_2" }, "publicNetworkAccess": { "type": "string", "defaultValue": "Disabled", "allowedValues": [ "Enabled", "Disabled" ] }, "sku": { "type": "object", "defaultValue": { "name": "Standard_LRS" } }, "containers": { "type": "array", "defaultValue": [] } }, "resources": [ { "copy": { "name": "container", "count": "[length(parameters('containers'))]" }, "condition": "[not(empty(parameters('containers')))]", "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2022-05-01", "name": "[format('{0}/{1}/{2}', parameters('name'), 'default', parameters('containers')[copyIndex()].name)]", "properties": { "publicAccess": "[if(contains(parameters('containers')[copyIndex()], 'publicAccess'), parameters('containers')[copyIndex()].publicAccess, 'None')]" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('name'), 'default')]" ] }, { "condition": "[not(empty(parameters('containers')))]", "type": "Microsoft.Storage/storageAccounts/blobServices", "apiVersion": "2022-05-01", "name": "[format('{0}/{1}', parameters('name'), 'default')]", "properties": { "deleteRetentionPolicy": "[parameters('deleteRetentionPolicy')]" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]" ] }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2022-05-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')]", "supportsHttpsTrafficOnly": true, "minimumTlsVersion": "TLS1_2", "networkAcls": { "bypass": "AzureServices", "defaultAction": "Allow" }, "publicNetworkAccess": "[parameters('publicNetworkAccess')]" } } ], "outputs": { "name": { "type": "string", "value": "[parameters('name')]" }, "primaryEndpoints": { "type": "object", "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '2022-05-01').primaryEndpoints]" } } } }, "dependsOn": [ "[subscriptionResourceId('Microsoft.Resources/resourceGroups', if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" ] } ], "outputs": { "AZURE_LOCATION": { "type": "string", "value": "[parameters('location')]" }, "AZURE_TENANT_ID": { "type": "string", "value": "[tenant().tenantId]" }, "AZURE_RESOURCE_GROUP": { "type": "string", "value": "[if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName')))]" }, "AZURE_OPENAI_SERVICE": { "type": "string", "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.name.value]" }, "AZURE_OPENAI_RESOURCE_GROUP": { "type": "string", "value": "[if(not(empty(parameters('openAiResourceGroupName'))), parameters('openAiResourceGroupName'), if(not(empty(parameters('resourceGroupName'))), parameters('resourceGroupName'), format('{0}{1}', variables('abbrs').resourcesResourceGroups, parameters('environmentName'))))]" }, "AZURE_OPENAI_GPT_DEPLOYMENT": { "type": "string", "value": "[parameters('gptDeploymentName')]" }, "AZURE_OPENAI_CHATGPT_DEPLOYMENT": { "type": "string", "value": "[parameters('chatGptDeploymentName')]" }, "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_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_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_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_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_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'))))]" }, "BACKEND_URI": { "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.uri.value]" } } }