{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." } }, "textTranslationName": { "type": "string", "metadata": { "description": "Name of the Text Translation service" } }, "textTranslationTier": { "type": "String", "allowedValues": [ "S1", "S2", "S3", "S4", "C2", "C3", "C4" ], "defaultValue": "S1", "metadata": { "description": "Pricing tier" } }, "storageAccountType": { "type": "string", "defaultValue": "Standard_LRS", "allowedValues": ["Standard_LRS", "Standard_GRS", "Standard_RAGRS"], "metadata": { "description": "Storage Account type for the Azure Functions data." } }, "eventHubNamespaceName": { "type": "string", "metadata": { "description": "Name of the Azure Event Hub namespace" } }, "eventHubSKU": { "type": "string", "allowedValues": ["Basic", "Standard"], "defaultValue": "Standard", "metadata": { "description": "The messaging tier for the Azure Service Bus namespace" } }, "eventHubSKUCapacity": { "type": "int", "allowedValues": [1, 2, 4], "defaultValue": 1, "metadata": { "description": "Azure Event Hub MessagingUnits for the premium namespace" } }, "eventHubSenderName": { "type": "string", "metadata": { "description": "Name of the send string Azure Event Hub" } }, "eventHubReceiverName": { "type": "string", "metadata": { "description": "Name of the receive string Azure Event Hub" } }, "functionName": { "type": "string", "metadata": { "description": "The name of the Azure Function app to create" } }, "functionAppSKU": { "type": "string", "allowedValues": [ "Free", "Basic", "Standard" ], "defaultValue": "Standard", "metadata": { "description": "The pricing tier for the Function App hosting plan." } }, "functionAppSKUCode": { "type": "string", "allowedValues": [ "F1", "B1", "S1" ], "defaultValue": "S1", "metadata": { "description": "The pricing tier for the Function App hosting plan." } }, "functionAppWorkerSize": { "type": "string", "allowedValues": [ "0", "1", "2" ], "defaultValue": "0", "metadata": { "description": "The instance size of the hosting plan (small, medium, or large)" } }, "repoUrl": { "type": "string", "defaultValue": "https://github.com/Azure-Samples/gaming-cognitive-services-text-translation" }, "branch": { "type": "string", "defaultValue": "master" } }, "variables": { "defaultSASKeyName": "RootManageSharedAccessKey", "authRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('eventHubNamespaceName'), variables('defaultSASKeyName'))]", "functionAppName": "[parameters('functionName')]", "hostingPlanName": "[parameters('functionName')]", "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'cstt')]", "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]" }, "resources": [ { "apiVersion": "2017-05-10", "name": "pid-e46856dc-f310-45b1-98c8-244096f72e5a", "comments": "GUID for tracking production pilot deployments intended for Gaming-Text-Translation.", "type": "Microsoft.Resources/deployments", "properties": { "mode": "Incremental", "template": { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [] } } }, { "type": "Microsoft.CognitiveServices/accounts", "sku": { "name": "[parameters('textTranslationTier')]" }, "kind": "TextTranslation", "name": "[parameters('textTranslationName')]", "apiVersion": "2016-02-01-preview", "location": "global", "scale": null, "properties": {}, "dependsOn": [] }, { "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2016-12-01", "location": "[parameters('location')]", "kind": "Storage", "sku": { "name": "[parameters('storageAccountType')]" } }, { "type": "Microsoft.EventHub/namespaces", "sku": { "name": "[parameters('eventHubSKU')]", "tier": "[parameters('eventHubSKU')]", "capacity": "[parameters('eventHubSKUCapacity')]" }, "name": "[parameters('eventHubNamespaceName')]", "apiVersion": "2017-04-01", "location": "[parameters('location')]", "tags": {}, "scale": null, "properties": { "isAutoInflateEnabled": false, "maximumThroughputUnits": 0 }, "dependsOn": [] }, { "type": "Microsoft.EventHub/namespaces/eventhubs", "name": "[concat(parameters('eventHubNamespaceName'), '/', parameters('eventHubSenderName'))]", "apiVersion": "2017-04-01", "location": "[parameters('location')]", "scale": null, "properties": { "messageRetentionInDays": 7, "partitionCount": 1, "status": "Active" }, "dependsOn": [ "[resourceId('Microsoft.EventHub/namespaces', parameters('eventHubNamespaceName'))]" ] }, { "type": "Microsoft.EventHub/namespaces/eventhubs", "name": "[concat(parameters('eventHubNamespaceName'), '/', parameters('eventHubReceiverName'))]", "apiVersion": "2017-04-01", "location": "[parameters('location')]", "scale": null, "properties": { "messageRetentionInDays": 7, "partitionCount": 1, "status": "Active" }, "dependsOn": [ "[resourceId('Microsoft.EventHub/namespaces', parameters('eventHubNamespaceName'))]" ] }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2016-09-01", "name": "[variables('hostingPlanName')]", "location": "[parameters('location')]", "properties": { "name": "[variables('hostingPlanName')]", "workerSizeId": "[parameters('functionAppWorkerSize')]", "hostingEnvironment": "", "numberOfWorkers": 1 }, "sku": { "Tier": "[parameters('functionAppSKU')]", "Name": "[parameters('functionAppSKUCode')]" } }, { "apiVersion": "2016-08-01", "type": "Microsoft.Web/sites", "name": "[variables('functionAppName')]", "location": "[parameters('location')]", "kind": "functionapp", "properties": { "name": "[variables('functionAppName')]", "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "hostingEnvironment": "", "clientAffinityEnabled": false, "siteConfig": { "appSettings": [ { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~2" }, { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2019-06-01').keys[0].value)]" }, { "name": "AzureWebJobsDashboard", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2019-06-01').keys[0].value)]" } ] } }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], "resources": [ { "apiVersion": "2015-08-01", "name": "web", "type": "sourcecontrols", "dependsOn": [ "[resourceId('Microsoft.Web/Sites', parameters('functionName'))]" ], "properties": { "RepoUrl": "[parameters('repoUrl')]", "branch": "[parameters('branch')]", "IsManualIntegration": true } } ] } ] }