diff --git a/IoTCIntegration/package.json b/IoTCIntegration/package.json index 53728ce..a4d99d2 100644 --- a/IoTCIntegration/package.json +++ b/IoTCIntegration/package.json @@ -1,12 +1,12 @@ { "name": "iotc-integration-azure-function", - "version": "1.0.0", + "version": "1.0.1", "private": true, "description": "Sample Azure Function for cloud to cloud integration with Azure IoT Central", "main": "index.js", "dependencies": { - "azure-iot-device": "^1.7.4", - "azure-iot-device-http": "^1.7.4", + "azure-iot-device": "^1.18.2", + "azure-iot-device-http": "^1.14.2", "node-fetch": "^2.6.0" }, "devDependencies": {}, diff --git a/README.md b/README.md index f4e36dd..9a5adde 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Function. You can check the integrity of the code being deployed by verifying th of the `iotc-bridge-az-function.zip` file in the root of this repository matches the following: ``` -F7BA3AC451E8CD738B9FBC6A55677C840039E5205541575FD18326C8D9E9EBDC +0988532d85ffc8d84c1c6c65d6edd5744ed2c695af8b9481172c705d542b5af7 ``` # Contributing diff --git a/azuredeploy.json b/azuredeploy.json index 72037ac..eff1964 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -1,12 +1,12 @@ { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.1", "parameters": { "scopeID": { - "type": "String" + "type": "string" }, "iotCentralSASKey": { - "type": "String" + "type": "string" } }, "variables": { @@ -25,25 +25,23 @@ }, "kind": "Storage", "name": "[variables('storageName')]", - "apiVersion": "2018-07-01", + "apiVersion": "2022-09-01", "location": "[resourceGroup().location]" }, { "type": "Microsoft.Web/serverfarms", - "apiVersion": "2015-04-01", + "apiVersion": "2022-09-01", "name": "[variables('planName')]", "location": "[resourceGroup().location]", - "properties": { - "name": "[variables('planName')]", - "computeMode": "Dynamic", - "sku": "Dynamic" + "sku": { + "name": "Y1" } }, { "type": "Microsoft.Web/sites", "kind": "functionapp", "name": "[variables('functionAppName')]", - "apiVersion": "2016-08-01", + "apiVersion": "2022-09-01", "location": "[resourceGroup().location]", "tags": { "iotCentral": "device-bridge", @@ -57,24 +55,51 @@ "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')), '2015-05-01-preview').key1)]" }, - { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-05-01-preview').key1)]" }, - { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-05-01-preview').key1)]" }, - { "name": "WEBSITE_CONTENTSHARE", "value": "[toLower(variables('functionAppName'))]" }, - { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~2" }, - { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "8.4.0" }, - { "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'), '/')]" } + { + "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'), '/')]" + } ] } }, "resources": [ { "name": "MSDeploy", - "type": "Extensions", + "type": "extensions", "location": "[resourceGroup().location]", - "apiVersion": "2015-08-01", + "apiVersion": "2022-09-01", "dependsOn": [ "[concat('Microsoft.Web/sites/', variables('functionAppName'))]" ], @@ -91,12 +116,12 @@ { "type": "Microsoft.KeyVault/vaults", "name": "[variables('keyVaultName')]", - "apiVersion": "2016-10-01", + "apiVersion": "2022-07-01", "location": "[resourceGroup().location]", "properties": { "sku": { "family": "A", - "name": "Standard" + "name": "standard" }, "tenantId": "[subscription().tenantId]", "accessPolicies": [ @@ -106,9 +131,9 @@ "permissions": { "keys": [], "secrets": [ - "Get", - "List", - "Recover" + "get", + "list", + "recover" ], "certificates": [] } @@ -119,7 +144,7 @@ { "type": "secrets", "name": "[variables('iotcKeyName')]", - "apiVersion": "2015-06-01", + "apiVersion": "2022-07-01", "tags": {}, "properties": { "value": "[parameters('iotCentralSASKey')]" diff --git a/iotc-bridge-az-function.zip b/iotc-bridge-az-function.zip index b18bd6f..49b7a4f 100644 Binary files a/iotc-bridge-az-function.zip and b/iotc-bridge-az-function.zip differ