iotc-device-bridge/azuredeploy.json

162 строки
6.9 KiB
JSON
Исходник Обычный вид История

2018-10-12 04:46:26 +03:00
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
2018-10-12 04:46:26 +03:00
"parameters": {
"scopeID": {
"type": "string"
2018-10-12 04:46:26 +03:00
},
"iotCentralSASKey": {
"type": "string"
2018-10-12 04:46:26 +03:00
}
},
"variables": {
2023-05-05 07:18:40 +03:00
"planName": "[concat('iotcpln', uniqueString(resourceGroup().id))]",
2023-05-05 06:37:07 +03:00
"storageName": "[concat('iotcsa', uniqueString(resourceGroup().id))]",
2023-05-05 07:18:40 +03:00
"functionAppName": "[concat('iotcfn', uniqueString(resourceGroup().id))]",
2023-05-05 06:37:07 +03:00
"keyVaultName": "[concat('iotcvlt', uniqueString(resourceGroup().id))]",
2018-10-12 04:46:26 +03:00
"iotcKeyName": "iotckey"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"name": "[variables('storageName')]",
"apiVersion": "2022-09-01",
2018-10-12 04:46:26 +03:00
"location": "[resourceGroup().location]"
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-09-01",
2018-10-12 04:46:26 +03:00
"name": "[variables('planName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Y1"
2018-10-12 04:46:26 +03:00
}
},
{
"type": "Microsoft.Web/sites",
"kind": "functionapp",
"name": "[variables('functionAppName')]",
"apiVersion": "2022-09-01",
2018-10-12 04:46:26 +03:00
"location": "[resourceGroup().location]",
"tags": {
2018-11-09 21:52:42 +03:00
"iotCentral": "device-bridge",
2023-05-05 06:37:07 +03:00
"iotCentralDeviceBridge": "function-app"
},
2018-10-12 04:46:26 +03:00
"identity": {
"type": "SystemAssigned"
},
"properties": {
"enabled": true,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('planName'))]",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(variables('functionAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "~18"
},
{
"name": "WEBSITE_HTTPSCALEV2_ENABLED",
"value": 0
},
{
"name": "ID_SCOPE",
"value": "[parameters('scopeID')]"
},
{
"name": "IOTC_KEY_URL",
"value": "[concat('https://', variables('keyVaultName'), '.vault.azure.net/secrets/', variables('iotcKeyName'), '/')]"
}
2018-10-12 04:46:26 +03:00
]
}
},
"resources": [
{
"name": "MSDeploy",
"type": "extensions",
2018-10-12 04:46:26 +03:00
"location": "[resourceGroup().location]",
"apiVersion": "2022-09-01",
2018-10-12 04:46:26 +03:00
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('functionAppName'))]"
],
"properties": {
2018-11-14 02:31:29 +03:00
"packageUri": "https://raw.githubusercontent.com/Azure/iotc-device-bridge/master/iotc-bridge-az-function.zip"
2018-10-12 04:46:26 +03:00
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]",
"[resourceId('Microsoft.Web/serverfarms', variables('planName'))]"
]
},
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2022-07-01",
2018-10-12 04:46:26 +03:00
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"family": "A",
"name": "standard"
2018-10-12 04:46:26 +03:00
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[reference(concat('Microsoft.Web/sites/', variables('functionAppName')), '2016-08-01', 'Full').identity.tenantId]",
"objectId": "[reference(concat('Microsoft.Web/sites/', variables('functionAppName')), '2016-08-01', 'Full').identity.principalId]",
"permissions": {
"keys": [],
"secrets": [
"get",
"list",
"recover"
2018-10-12 04:46:26 +03:00
],
"certificates": []
}
}
]
},
"resources": [
{
"type": "secrets",
"name": "[variables('iotcKeyName')]",
"apiVersion": "2022-07-01",
2018-10-12 04:46:26 +03:00
"tags": {},
"properties": {
"value": "[parameters('iotCentralSASKey')]"
2018-10-12 04:46:26 +03:00
},
"dependsOn": [
"[concat('Microsoft.KeyVault/vaults/', variables('keyVaultName'))]"
]
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
]
}
]
}