Merge pull request #76 from HangyiWang/migrate-function-app-version-from-2-to-4

Migrate Azure Function App from 2.x to 4.x with few other updates
This commit is contained in:
peolivei2 2023-05-08 10:22:01 -07:00 коммит произвёл GitHub
Родитель 8fd28e1db0 3f9789084b
Коммит 906b655ae2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 57 добавлений и 32 удалений

Просмотреть файл

@ -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": {},

Просмотреть файл

@ -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

Просмотреть файл

@ -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')]"

Двоичные данные
iotc-bridge-az-function.zip

Двоичный файл не отображается.