{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.29.47.4906", "templateHash": "15510503880947378622" } }, "parameters": { "StorageAccount": { "type": "string", "metadata": { "description": "The name of the storage account. It must be unique across all existing storage account names in Azure, between 3 and 24 characters long, and can contain only lowercase letters and numbers." } }, "Locale": { "type": "string", "defaultValue": "en-US | English (United States)", "allowedValues": [ "ar-BH | Arabic (Bahrain)", "ar-EG | Arabic (Egypt)", "ar-SY | Arabic (Syria)", "ca-ES | Catalan", "da-DK | Danish (Denmark)", "de-DE | German (Germany)", "en-AU | English (Australia)", "en-CA | English (Canada)", "en-GB | English (United Kingdom)", "en-IN | English (India)", "en-NZ | English (New Zealand)", "en-US | English (United States)", "es-ES | Spanish (Spain)", "es-MX | Spanish (Mexico)", "fi-FI | Finnish (Finland)", "fr-CA | French (Canada)", "fr-FR | French (France)", "gu-IN | Gujarati (Indian)", "hi-IN | Hindi (India)", "it-IT | Italian (Italy)", "ja-JP | Japanese (Japan)", "ko-KR | Korean (Korea)", "mr-IN | Marathi (India)", "nb-NO | Norwegian (Bokmål)", "nl-NL | Dutch (Netherlands)", "pl-PL | Polish (Poland)", "pt-BR | Portuguese (Brazil)", "pt-PT | Portuguese (Portugal)", "ru-RU | Russian (Russia)", "sv-SE | Swedish (Sweden)", "ta-IN | Tamil (India)", "te-IN | Telugu (India)", "th-TH | Thai (Thailand)", "tr-TR | Turkish (Turkey)", "zh-CN | Chinese (Mandarin, simplified)", "zh-HK | Chinese (Cantonese, Traditional)", "zh-TW | Chinese (Taiwanese Mandarin)" ] }, "CustomModelId": { "type": "string", "defaultValue": "", "metadata": { "description": "The id of the custom model for transcription. If empty, the base model will be selected." } }, "AzureSpeechServicesKey": { "type": "securestring", "metadata": { "description": "The key for the Azure Speech Services subscription." } }, "AzureSpeechServicesRegion": { "type": "string", "defaultValue": "westus", "allowedValues": [ "centralus", "eastus", "eastus2", "northcentralus", "southcentralus", "westcentralus", "westus", "westus2", "canadacentral", "brazilsouth", "eastasia", "southeastasia", "australiaeast", "centralindia", "japaneast", "japanwest", "koreacentral", "northeurope", "westeurope", "francecentral", "uksouth", "usgovarizona", "usgovvirginia" ], "metadata": { "description": "The region the Azure speech services subscription is associated with." } }, "CustomEndpoint": { "type": "string", "defaultValue": "", "metadata": { "description": "Enter the address of your private endpoint here (e.g. https://mycustomendpoint.cognitiveservices.azure.com/) if you are connecting with a private endpoint" } }, "StartTranscriptionFunctionTimeInterval": { "type": "string", "defaultValue": "0 */2 * * * *", "metadata": { "description": "The time interval for the timer trigger in the StartTranscription function (https://learn.microsoft.com/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-csharp#ncrontab-expressions). The default value is every 2 minutes." } }, "ProfanityFilterMode": { "type": "string", "defaultValue": "None", "allowedValues": [ "None", "Removed", "Tags", "Masked" ], "metadata": { "description": "The requested profanity filter mode." } }, "PunctuationMode": { "type": "string", "defaultValue": "DictatedAndAutomatic", "allowedValues": [ "None", "Dictated", "Automatic", "DictatedAndAutomatic" ], "metadata": { "description": "The requested punctuation mode." } }, "AddDiarization": { "type": "bool", "defaultValue": false, "metadata": { "description": "A value indicating whether diarization (speaker separation) is requested." } }, "AddWordLevelTimestamps": { "type": "bool", "defaultValue": false, "metadata": { "description": "A value indicating whether word level timestamps are requested." } }, "TextAnalyticsKey": { "type": "securestring", "defaultValue": "", "metadata": { "description": "The key for the Text Analytics subscription." } }, "TextAnalyticsEndpoint": { "type": "string", "defaultValue": "", "metadata": { "description": "The endpoint the Text Analytics subscription is associated with (format should be like https://{resourceName}.cognitiveservices.azure.com or https://{region}.api.cognitive.microsoft.com or similar). If empty, no text analysis will be performed." } }, "SentimentAnalysis": { "type": "string", "defaultValue": "None", "allowedValues": [ "None", "UtteranceLevel", "AudioLevel" ], "metadata": { "description": "A value indicating whether sentiment analysis is requested (either per utterance or per audio). Will only be performed if a Text Analytics Key and Region is provided." } }, "PiiRedaction": { "type": "string", "defaultValue": "None", "allowedValues": [ "None", "UtteranceAndAudioLevel" ], "metadata": { "description": "A value indicating whether personally identifiable information (PII) redaction is requested. Will only be performed if a Text Analytics Key and Region is provided." } }, "SqlAdministratorLogin": { "type": "string", "defaultValue": "", "metadata": { "description": "The administrator username of the SQL Server, which is used to gain insights of the audio with the provided PowerBI scripts. If it is left empty, no SQL server/database will be created." } }, "SqlAdministratorLoginPassword": { "type": "securestring", "defaultValue": "", "metadata": { "description": "The administrator password of the SQL Server. If it is left empty, no SQL server/database will be created." } }, "DeploymentId": { "type": "string", "defaultValue": "[utcNow()]", "metadata": { "description": "Id that will be suffixed to all created resources to identify resources of a certain deployment. Leave as is to use timestamp as deployment id." } }, "CompletedServiceBusConnectionString": { "type": "securestring", "defaultValue": "", "metadata": { "description": "The connection string for the Service Bus Queue where you want to receive the notification of completion of the transcription for each audio file. If left empty, no completion notification will be sent." } } }, "variables": { "Version": "v2.1.12", "AudioInputContainer": "audio-input", "AudioProcessedContainer": "audio-processed", "ErrorFilesOutputContainer": "audio-failed", "JsonResultOutputContainer": "json-result-output", "HtmlResultOutputContainer": "html-result-output", "ErrorReportOutputContainer": "error-report", "ConsolidatedFilesOutputContainer": "consolidated-files", "CreateHtmlResultFile": false, "CreateConsolidatedOutputFiles": false, "TimerBasedExecution": true, "CreateAudioProcessedContainer": true, "IsByosEnabledSubscription": false, "MessagesPerFunctionExecution": 1000, "FilesPerTranscriptionJob": 100, "RetryLimit": 4, "InitialPollingDelayInMinutes": 2, "MaxPollingDelayInMinutes": 180, "InstanceId": "[parameters('DeploymentId')]", "StorageAccountName": "[parameters('StorageAccount')]", "UseSqlDatabase": "[and(not(equals(parameters('SqlAdministratorLogin'), '')), not(equals(parameters('SqlAdministratorLoginPassword'), '')))]", "SqlServerName": "[format('sqlserver{0}', toLower(variables('InstanceId')))]", "DatabaseName": "[format('Database-{0}', toLower(variables('InstanceId')))]", "ServiceBusName": "[format('ServiceBus-{0}', variables('InstanceId'))]", "AppInsightsName": "[format('AppInsights-{0}', variables('InstanceId'))]", "KeyVaultName": "[format('KV-{0}', variables('InstanceId'))]", "EventGridSystemTopicName": "[format('{0}-{1}', variables('StorageAccountName'), variables('InstanceId'))]", "StartTranscriptionFunctionName": "[take(format('StartTranscription-{0}', variables('InstanceId')), 60)]", "StartTranscriptionFunctionId": "[resourceId('Microsoft.Web/sites', variables('StartTranscriptionFunctionName'))]", "FetchTranscriptionFunctionName": "[take(format('FetchTranscription-{0}', variables('InstanceId')), 60)]", "FetchTranscriptionFunctionId": "[resourceId('Microsoft.Web/sites', variables('FetchTranscriptionFunctionName'))]", "AppServicePlanName": "[format('AppServicePlan-{0}', variables('InstanceId'))]", "AzureSpeechServicesKeySecretName": "AzureSpeechServicesKey", "TextAnalyticsKeySecretName": "TextAnalyticsKey", "DatabaseConnectionStringSecretName": "DatabaseConnectionString", "PiiCategories": "", "ConversationPiiCategories": "", "ConversationPiiRedaction": "None", "ConversationPiiInferenceSource": "text", "ConversationSummarizationOptions": "{\"Stratergy\":{\"Key\":\"Channel\",\"Mapping\":{\"0\":\"Agent\",\"1\":\"Customer\"},\"FallbackRole\":\"None\"},\"Aspects\":[\"Issue\",\"Resolution\",\"ChapterTitle\",\"Narrative\"],\"Enabled\":false,\"InputLengthLimit\":125000}", "IsAzureGovDeployment": "[or(equals(parameters('AzureSpeechServicesRegion'), 'usgovarizona'), equals(parameters('AzureSpeechServicesRegion'), 'usgovvirginia'))]", "AzureSpeechServicesEndpointUri": "[if(not(equals(parameters('CustomEndpoint'), '')), parameters('CustomEndpoint'), if(variables('IsAzureGovDeployment'), format('https://{0}.api.cognitive.microsoft.us/', parameters('AzureSpeechServicesRegion')), format('https://{0}.api.cognitive.microsoft.com/', parameters('AzureSpeechServicesRegion'))))]", "EndpointSuffix": "[if(variables('IsAzureGovDeployment'), 'core.usgovcloudapi.net', 'core.windows.net')]", "BinariesRoutePrefix": "https://github.com/Azure-Samples/cognitive-services-speech-sdk/releases/download/ingestion-", "StartTranscriptionByTimerBinary": "[format('{0}{1}/StartTranscriptionByTimer.zip', variables('BinariesRoutePrefix'), variables('Version'))]", "StartTranscriptionByServiceBusBinary": "[format('{0}{1}/StartTranscriptionByServiceBus.zip', variables('BinariesRoutePrefix'), variables('Version'))]", "FetchTranscriptionBinary": "[format('{0}{1}/FetchTranscription.zip', variables('BinariesRoutePrefix'), variables('Version'))]" }, "resources": [ { "type": "Microsoft.Insights/components", "apiVersion": "2020-02-02-preview", "name": "[variables('AppInsightsName')]", "location": "[resourceGroup().location]", "tags": { "applicationType": "web", "applicationName": "TranscriptionInsights" }, "kind": "web", "properties": { "Application_Type": "web" } }, { "type": "Microsoft.ServiceBus/namespaces", "apiVersion": "2018-01-01-preview", "name": "[variables('ServiceBusName')]", "location": "[resourceGroup().location]", "sku": { "name": "Standard", "tier": "Standard" }, "properties": { "zoneRedundant": false } }, { "type": "Microsoft.KeyVault/vaults", "apiVersion": "2019-09-01", "name": "[variables('KeyVaultName')]", "location": "[resourceGroup().location]", "properties": { "enabledForDeployment": true, "enabledForDiskEncryption": false, "enabledForTemplateDeployment": false, "tenantId": "[subscription().tenantId]", "accessPolicies": [ { "objectId": "[reference(resourceId('Microsoft.Web/sites', variables('StartTranscriptionFunctionName')), '2019-08-01', 'full').identity.principalId]", "tenantId": "[reference(resourceId('Microsoft.Web/sites', variables('StartTranscriptionFunctionName')), '2019-08-01', 'full').identity.tenantId]", "permissions": { "secrets": [ "get", "list" ] } }, { "objectId": "[reference(resourceId('Microsoft.Web/sites', variables('FetchTranscriptionFunctionName')), '2019-08-01', 'full').identity.principalId]", "tenantId": "[reference(resourceId('Microsoft.Web/sites', variables('FetchTranscriptionFunctionName')), '2019-08-01', 'full').identity.tenantId]", "permissions": { "secrets": [ "get", "list" ] } } ], "sku": { "name": "standard", "family": "A" }, "networkAcls": { "defaultAction": "Allow", "bypass": "AzureServices" } }, "dependsOn": [ "[resourceId('Microsoft.Web/sites', variables('FetchTranscriptionFunctionName'))]", "[resourceId('Microsoft.Web/sites', variables('StartTranscriptionFunctionName'))]" ] }, { "type": "Microsoft.KeyVault/vaults/secrets", "apiVersion": "2019-09-01", "name": "[format('{0}/{1}', variables('KeyVaultName'), variables('AzureSpeechServicesKeySecretName'))]", "properties": { "value": "[parameters('AzureSpeechServicesKey')]" }, "dependsOn": [ "[resourceId('Microsoft.KeyVault/vaults', variables('KeyVaultName'))]" ] }, { "type": "Microsoft.KeyVault/vaults/secrets", "apiVersion": "2019-09-01", "name": "[format('{0}/{1}', variables('KeyVaultName'), variables('TextAnalyticsKeySecretName'))]", "properties": { "value": "[if(empty(parameters('TextAnalyticsKey')), 'NULL', parameters('TextAnalyticsKey'))]" }, "dependsOn": [ "[resourceId('Microsoft.KeyVault/vaults', variables('KeyVaultName'))]" ] }, { "type": "Microsoft.KeyVault/vaults/secrets", "apiVersion": "2019-09-01", "name": "[format('{0}/{1}', variables('KeyVaultName'), variables('DatabaseConnectionStringSecretName'))]", "properties": { "value": "[if(variables('UseSqlDatabase'), format('Server=tcp:{0},1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;', reference(variables('SqlServerName'), '2014-04-01-preview').fullyQualifiedDomainName, variables('DatabaseName'), parameters('SqlAdministratorLogin'), parameters('SqlAdministratorLoginPassword')), 'NULL')]" }, "dependsOn": [ "[resourceId('Microsoft.KeyVault/vaults', variables('KeyVaultName'))]", "[resourceId('Microsoft.Sql/servers', variables('SqlServerName'))]" ] }, { "condition": "[variables('UseSqlDatabase')]", "type": "Microsoft.Sql/servers", "apiVersion": "2021-02-01-preview", "name": "[variables('SqlServerName')]", "location": "[resourceGroup().location]", "tags": { "displayName": "SqlServer" }, "properties": { "administratorLogin": "[parameters('SqlAdministratorLogin')]", "administratorLoginPassword": "[parameters('SqlAdministratorLoginPassword')]", "version": "12.0" } }, { "condition": "[variables('UseSqlDatabase')]", "type": "Microsoft.Sql/servers/databases", "apiVersion": "2015-01-01", "name": "[format('{0}/{1}', variables('SqlServerName'), variables('DatabaseName'))]", "location": "[resourceGroup().location]", "tags": { "displayName": "Database" }, "properties": { "edition": "Basic", "collation": "SQL_Latin1_General_CP1_CI_AS", "requestedServiceObjectiveName": "Basic" }, "dependsOn": [ "[resourceId('Microsoft.Sql/servers', variables('SqlServerName'))]" ] }, { "condition": "[variables('UseSqlDatabase')]", "type": "Microsoft.Sql/servers/databases/transparentDataEncryption", "apiVersion": "2014-04-01-preview", "name": "[format('{0}/{1}/{2}', variables('SqlServerName'), variables('DatabaseName'), 'current')]", "location": "[resourceGroup().location]", "properties": { "status": "Enabled" }, "dependsOn": [ "[resourceId('Microsoft.Sql/servers/databases', variables('SqlServerName'), variables('DatabaseName'))]" ] }, { "condition": "[variables('UseSqlDatabase')]", "type": "Microsoft.Sql/servers/auditingSettings", "apiVersion": "2017-03-01-preview", "name": "[format('{0}/{1}', variables('SqlServerName'), 'DefaultAuditingSettings')]", "properties": { "state": "Enabled", "storageEndpoint": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), '2018-03-01-preview').PrimaryEndpoints.Blob]", "storageAccountAccessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), '2018-03-01-preview').keys[0].value]", "storageAccountSubscriptionId": "[subscription().subscriptionId]", "auditActionsAndGroups": null, "isStorageSecondaryKeyInUse": false }, "dependsOn": [ "[resourceId('Microsoft.Sql/servers', variables('SqlServerName'))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]" ] }, { "condition": "[variables('UseSqlDatabase')]", "type": "Microsoft.Sql/servers/firewallRules", "apiVersion": "2014-04-01", "name": "[format('{0}/{1}', variables('SqlServerName'), 'AllowAllMicrosoftAzureIps')]", "properties": { "endIpAddress": "0.0.0.0", "startIpAddress": "0.0.0.0" }, "dependsOn": [ "[resourceId('Microsoft.Sql/servers', variables('SqlServerName'))]" ] }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "name": "[variables('StorageAccountName')]", "location": "[resourceGroup().location]", "sku": { "name": "Standard_GRS" }, "kind": "StorageV2", "properties": { "networkAcls": { "bypass": "AzureServices", "virtualNetworkRules": [], "ipRules": [], "defaultAction": "Allow" }, "supportsHttpsTrafficOnly": true, "encryption": { "services": { "file": { "keyType": "Account", "enabled": true }, "blob": { "keyType": "Account", "enabled": true } }, "keySource": "Microsoft.Storage" }, "accessTier": "Hot" } }, { "type": "Microsoft.ServiceBus/namespaces/AuthorizationRules", "apiVersion": "2017-04-01", "name": "[format('{0}/{1}', variables('ServiceBusName'), 'RootManageSharedAccessKey')]", "properties": { "rights": [ "Listen", "Manage", "Send" ] }, "dependsOn": [ "[resourceId('Microsoft.ServiceBus/namespaces', variables('ServiceBusName'))]" ] }, { "type": "Microsoft.ServiceBus/namespaces/queues", "apiVersion": "2017-04-01", "name": "[format('{0}/{1}', variables('ServiceBusName'), 'start_transcription_queue')]", "properties": { "lockDuration": "PT4M", "maxSizeInMegabytes": 5120, "requiresDuplicateDetection": false, "requiresSession": false, "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S", "deadLetteringOnMessageExpiration": false, "enableBatchedOperations": false, "duplicateDetectionHistoryTimeWindow": "PT10M", "maxDeliveryCount": 1, "status": "Active", "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S", "enablePartitioning": false, "enableExpress": false }, "dependsOn": [ "[resourceId('Microsoft.ServiceBus/namespaces', variables('ServiceBusName'))]" ] }, { "type": "Microsoft.ServiceBus/namespaces/queues", "apiVersion": "2017-04-01", "name": "[format('{0}/{1}', variables('ServiceBusName'), 'fetch_transcription_queue')]", "properties": { "lockDuration": "PT5M", "maxSizeInMegabytes": 5120, "requiresDuplicateDetection": false, "requiresSession": false, "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S", "deadLetteringOnMessageExpiration": false, "enableBatchedOperations": false, "duplicateDetectionHistoryTimeWindow": "PT10M", "maxDeliveryCount": 5, "status": "Active", "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S", "enablePartitioning": false, "enableExpress": false }, "dependsOn": [ "[resourceId('Microsoft.ServiceBus/namespaces', variables('ServiceBusName'))]" ] }, { "type": "Microsoft.Storage/storageAccounts/blobServices", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}', variables('StorageAccountName'), 'default')]", "properties": { "cors": { "corsRules": [] }, "deleteRetentionPolicy": { "enabled": false } }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]" ] }, { "type": "Microsoft.Storage/storageAccounts/fileServices", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}', variables('StorageAccountName'), 'default')]", "properties": { "cors": { "corsRules": [] } }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]" ] }, { "type": "Microsoft.ServiceBus/namespaces/queues/authorizationRules", "apiVersion": "2017-04-01", "name": "[format('{0}/{1}/{2}', variables('ServiceBusName'), 'fetch_transcription_queue', 'FetchTranscription')]", "properties": { "rights": [ "Listen", "Send" ] }, "dependsOn": [ "[resourceId('Microsoft.ServiceBus/namespaces/queues', variables('ServiceBusName'), 'fetch_transcription_queue')]", "[resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey')]" ] }, { "type": "Microsoft.ServiceBus/namespaces/queues/authorizationRules", "apiVersion": "2017-04-01", "name": "[format('{0}/{1}/{2}', variables('ServiceBusName'), 'start_transcription_queue', 'StartTranscription')]", "properties": { "rights": [ "Listen", "Send" ] }, "dependsOn": [ "[resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey')]", "[resourceId('Microsoft.ServiceBus/namespaces/queues', variables('ServiceBusName'), 'start_transcription_queue')]" ] }, { "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('AudioInputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('JsonResultOutputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "condition": "[variables('CreateConsolidatedOutputFiles')]", "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('ConsolidatedFilesOutputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "condition": "[variables('CreateAudioProcessedContainer')]", "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('AudioProcessedContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "condition": "[variables('CreateHtmlResultFile')]", "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('HtmlResultOutputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('ErrorReportOutputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2019-06-01", "name": "[format('{0}/{1}/{2}', variables('StorageAccountName'), 'default', variables('ErrorFilesOutputContainer'))]", "properties": { "publicAccess": "None" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.EventGrid/systemTopics", "apiVersion": "2020-04-01-preview", "name": "[variables('EventGridSystemTopicName')]", "location": "[resourceGroup().location]", "properties": { "source": "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]", "topicType": "Microsoft.Storage.StorageAccounts" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]", "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.EventGrid/systemTopics/eventSubscriptions", "apiVersion": "2020-04-01-preview", "name": "[format('{0}/{1}', variables('EventGridSystemTopicName'), 'BlobCreatedEvent')]", "properties": { "destination": { "endpointType": "ServiceBusQueue", "properties": { "resourceId": "[format('/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.ServiceBus/namespaces/{2}/queues/start_transcription_queue', subscription().subscriptionId, resourceGroup().name, variables('ServiceBusName'))]" } }, "filter": { "includedEventTypes": [ "Microsoft.Storage.BlobCreated" ], "advancedFilters": [ { "operatorType": "StringBeginsWith", "key": "Subject", "values": [ "[format('/blobServices/default/containers/{0}/blobs', variables('AudioInputContainer'))]" ] }, { "operatorType": "StringContains", "key": "data.api", "values": [ "FlushWithClose", "PutBlob", "PutBlockList", "CopyBlob" ] } ] }, "labels": [], "eventDeliverySchema": "EventGridSchema" }, "dependsOn": [ "[resourceId('Microsoft.EventGrid/systemTopics', variables('EventGridSystemTopicName'))]", "[resourceId('Microsoft.ServiceBus/namespaces/queues', variables('ServiceBusName'), 'start_transcription_queue')]", "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]", "[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('StorageAccountName'), 'default')]" ] }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2018-02-01", "name": "[variables('AppServicePlanName')]", "kind": "app", "location": "[resourceGroup().location]", "properties": {}, "sku": { "name": "EP1" } }, { "type": "Microsoft.Web/sites", "apiVersion": "2020-09-01", "name": "[variables('StartTranscriptionFunctionName')]", "location": "[resourceGroup().location]", "kind": "functionapp", "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('AppServicePlanName'))]", "httpsOnly": true, "siteConfig": { "netFrameworkVersion": "v8.0" } }, "identity": { "type": "SystemAssigned" }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('AppServicePlanName'))]" ] }, { "type": "Microsoft.Web/sites/config", "apiVersion": "2020-09-01", "name": "[format('{0}/{1}', variables('StartTranscriptionFunctionName'), 'AppSettings')]", "location": "[resourceGroup().location]", "tags": { "displayName": "WebAppSettings" }, "properties": { "AddDiarization": "[parameters('AddDiarization')]", "AddWordLevelTimestamps": "[parameters('AddWordLevelTimestamps')]", "APPLICATIONINSIGHTS_CONNECTION_STRING": "[reference(resourceId('Microsoft.Insights/components', variables('AppInsightsName')), '2020-02-02-preview').ConnectionString]", "AudioInputContainer": "[variables('AudioInputContainer')]", "AzureServiceBus": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey'), '2017-04-01').primaryConnectionString]", "AzureSpeechServicesKey": "[format('@Microsoft.KeyVault(VaultName={0};SecretName={1})', variables('KeyVaultName'), variables('AzureSpeechServicesKeySecretName'))]", "AzureSpeechServicesRegion": "[parameters('AzureSpeechServicesRegion')]", "AzureWebJobsStorage": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('StorageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, variables('EndpointSuffix'))]", "AzureWebJobsDashboard": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('StorageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, variables('EndpointSuffix'))]", "CustomModelId": "[parameters('CustomModelId')]", "ErrorFilesOutputContainer": "[variables('ErrorFilesOutputContainer')]", "ErrorReportOutputContainer": "[variables('ErrorReportOutputContainer')]", "FetchTranscriptionServiceBusConnectionString": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'fetch_transcription_queue', 'FetchTranscription'), '2017-04-01').primaryConnectionString]", "FilesPerTranscriptionJob": "[variables('FilesPerTranscriptionJob')]", "FUNCTIONS_EXTENSION_VERSION": "~4", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "AzureSpeechServicesEndpointUri": "[variables('AzureSpeechServicesEndpointUri')]", "InitialPollingDelayInMinutes": "[variables('InitialPollingDelayInMinutes')]", "IsAzureGovDeployment": "[variables('IsAzureGovDeployment')]", "IsByosEnabledSubscription": "[variables('IsByosEnabledSubscription')]", "MaxPollingDelayInMinutes": "[variables('MaxPollingDelayInMinutes')]", "Locale": "[parameters('Locale')]", "MessagesPerFunctionExecution": "[variables('MessagesPerFunctionExecution')]", "StartTranscriptionFunctionTimeInterval": "[parameters('StartTranscriptionFunctionTimeInterval')]", "ProfanityFilterMode": "[parameters('ProfanityFilterMode')]", "PunctuationMode": "[parameters('PunctuationMode')]", "RetryLimit": "[variables('RetryLimit')]", "StartTranscriptionServiceBusConnectionString": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'start_transcription_queue', 'StartTranscription'), '2017-04-01').primaryConnectionString]", "Version": "[variables('Version')]", "WEBSITE_RUN_FROM_PACKAGE": "[if(variables('TimerBasedExecution'), variables('StartTranscriptionByTimerBinary'), variables('StartTranscriptionByServiceBusBinary'))]" }, "dependsOn": [ "[resourceId('Microsoft.Insights/components', variables('AppInsightsName'))]", "[resourceId('Microsoft.KeyVault/vaults', variables('KeyVaultName'))]", "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('KeyVaultName'), variables('AzureSpeechServicesKeySecretName'))]", "[resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'fetch_transcription_queue', 'FetchTranscription')]", "[resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey')]", "[resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'start_transcription_queue', 'StartTranscription')]", "[resourceId('Microsoft.Web/sites', variables('StartTranscriptionFunctionName'))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]" ] }, { "type": "Microsoft.Web/sites", "apiVersion": "2020-09-01", "name": "[variables('FetchTranscriptionFunctionName')]", "location": "[resourceGroup().location]", "kind": "functionapp", "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('AppServicePlanName'))]", "httpsOnly": true, "siteConfig": { "netFrameworkVersion": "v8.0" } }, "identity": { "type": "SystemAssigned" }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('AppServicePlanName'))]" ] }, { "type": "Microsoft.Web/sites/config", "apiVersion": "2020-09-01", "name": "[format('{0}/{1}', variables('FetchTranscriptionFunctionName'), 'AppSettings')]", "location": "[resourceGroup().location]", "tags": { "displayName": "WebAppSettings" }, "properties": { "APPLICATIONINSIGHTS_CONNECTION_STRING": "[reference(resourceId('Microsoft.Insights/components', variables('AppInsightsName')), '2020-02-02-preview').ConnectionString]", "PiiRedactionSetting": "[parameters('PiiRedaction')]", "SentimentAnalysisSetting": "[parameters('SentimentAnalysis')]", "AudioInputContainer": "[variables('AudioInputContainer')]", "AzureServiceBus": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey'), '2017-04-01').primaryConnectionString]", "AzureSpeechServicesKey": "[format('@Microsoft.KeyVault(VaultName={0};SecretName={1})', variables('KeyVaultName'), variables('AzureSpeechServicesKeySecretName'))]", "AzureWebJobsStorage": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('StorageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, variables('EndpointSuffix'))]", "AzureWebJobsDashboard": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('StorageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, variables('EndpointSuffix'))]", "CreateHtmlResultFile": "[variables('CreateHtmlResultFile')]", "DatabaseConnectionString": "[format('@Microsoft.KeyVault(VaultName={0};SecretName={1})', variables('KeyVaultName'), variables('DatabaseConnectionStringSecretName'))]", "ErrorFilesOutputContainer": "[variables('ErrorFilesOutputContainer')]", "ErrorReportOutputContainer": "[variables('ErrorReportOutputContainer')]", "FetchTranscriptionServiceBusConnectionString": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'fetch_transcription_queue', 'FetchTranscription'), '2017-04-01').primaryConnectionString]", "FUNCTIONS_EXTENSION_VERSION": "~4", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "HtmlResultOutputContainer": "[variables('HtmlResultOutputContainer')]", "InitialPollingDelayInMinutes": "[variables('InitialPollingDelayInMinutes')]", "MaxPollingDelayInMinutes": "[variables('MaxPollingDelayInMinutes')]", "JsonResultOutputContainer": "[variables('JsonResultOutputContainer')]", "RetryLimit": "[variables('RetryLimit')]", "StartTranscriptionServiceBusConnectionString": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'start_transcription_queue', 'StartTranscription'), '2017-04-01').primaryConnectionString]", "TextAnalyticsKey": "[format('@Microsoft.KeyVault(VaultName={0};SecretName={1})', variables('KeyVaultName'), variables('TextAnalyticsKeySecretName'))]", "TextAnalyticsEndpoint": "[parameters('TextAnalyticsEndpoint')]", "UseSqlDatabase": "[variables('UseSqlDatabase')]", "WEBSITE_RUN_FROM_PACKAGE": "[variables('FetchTranscriptionBinary')]", "CreateConsolidatedOutputFiles": "[variables('CreateConsolidatedOutputFiles')]", "ConsolidatedFilesOutputContainer": "[variables('ConsolidatedFilesOutputContainer')]", "CreateAudioProcessedContainer": "[variables('CreateAudioProcessedContainer')]", "AudioProcessedContainer": "[variables('AudioProcessedContainer')]", "PiiCategories": "[variables('PiiCategories')]", "ConversationPiiCategories": "[variables('ConversationPiiCategories')]", "ConversationPiiInferenceSource": "[variables('ConversationPiiInferenceSource')]", "ConversationPiiSetting": "[variables('ConversationPiiRedaction')]", "ConversationSummarizationOptions": "[variables('ConversationSummarizationOptions')]", "CompletedServiceBusConnectionString": "[parameters('CompletedServiceBusConnectionString')]", "Version": "[variables('Version')]" }, "dependsOn": [ "[resourceId('Microsoft.Insights/components', variables('AppInsightsName'))]", "[resourceId('Microsoft.Web/sites', variables('FetchTranscriptionFunctionName'))]", "[resourceId('Microsoft.KeyVault/vaults', variables('KeyVaultName'))]", "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('KeyVaultName'), variables('AzureSpeechServicesKeySecretName'))]", "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('KeyVaultName'), variables('TextAnalyticsKeySecretName'))]", "[resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'fetch_transcription_queue', 'FetchTranscription')]", "[resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', variables('ServiceBusName'), 'RootManageSharedAccessKey')]", "[resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', variables('ServiceBusName'), 'start_transcription_queue', 'StartTranscription')]", "[resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName'))]" ] } ], "outputs": { "StartTranscriptionFunctionId": { "type": "string", "value": "[variables('StartTranscriptionFunctionId')]" }, "FetchTranscriptionFunctionId": { "type": "string", "value": "[variables('FetchTranscriptionFunctionId')]" } } }