diff --git a/.github/workflows/arm-ttk.yml b/.github/workflows/arm-ttk.yml index 7f66d19d9..eea766bcc 100644 --- a/.github/workflows/arm-ttk.yml +++ b/.github/workflows/arm-ttk.yml @@ -2,7 +2,7 @@ name: Validate ARM templates on: pull_request: - branches: [ main ] + branches: [ main, v3-dev ] paths: - 'templates/**' push: diff --git a/src/AzureIoTHub.Portal.sln b/src/AzureIoTHub.Portal.sln index 550f890ca..08a397110 100644 --- a/src/AzureIoTHub.Portal.sln +++ b/src/AzureIoTHub.Portal.sln @@ -30,9 +30,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{3CA1 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{9EF190B3-41E2-48E1-BA4E-E129589DD250}" ProjectSection(SolutionItems) = preProject + ..\.github\workflows\arm-ttk.yml = ..\.github\workflows\arm-ttk.yml ..\.github\workflows\build.yml = ..\.github\workflows\build.yml ..\.github\workflows\codeql.yml = ..\.github\workflows\codeql.yml ..\.github\workflows\deploy_staging.yml = ..\.github\workflows\deploy_staging.yml + ..\.github\workflows\publish-documentation-new-version.yml = ..\.github\workflows\publish-documentation-new-version.yml ..\.github\workflows\publish.yml = ..\.github\workflows\publish.yml EndProjectSection EndProject diff --git a/templates/portalDeployWithLoRa.json b/templates/portalDeployWithLoRa.json index ed91ec2c0..93c802284 100644 --- a/templates/portalDeployWithLoRa.json +++ b/templates/portalDeployWithLoRa.json @@ -68,6 +68,9 @@ } }, "variables": { + "pgsqlServerName": "[concat(parameters('uniqueSolutionPrefix'), 'pgsql')]", + "pgsqlAdminLogin": "[concat(uniqueString(resourceGroup().id, newGuid()))]", + "pgsqlAdminPassword": "[concat(uniqueString(resourceGroup().id, newGuid()), 'x', '!')]", "iotHubName": "[concat(parameters('uniqueSolutionPrefix'), 'hub')]", "dpsName": "[concat(parameters('uniqueSolutionPrefix'), 'dps')]", "siteName": "[concat(parameters('uniqueSolutionPrefix'), 'portal')]", @@ -109,6 +112,30 @@ "allocationPolicy": "Hashed" } }, + { + "type": "Microsoft.DBforPostgreSQL/servers", + "apiVersion": "2017-12-01", + "name": "[variables('pgsqlServerName')]", + "location": "[parameters('location')]", + "sku": { + "name": "B_Gen5_1", + "tier": "Basic", + "capacity": "2", + "size": "5120", + "family": "Gen5" + }, + "properties": { + "createMode": "Default", + "version": "11", + "administratorLogin": "[variables('pgsqlAdminLogin')]", + "administratorLoginPassword": "[variables('pgsqlAdminPassword')]", + "storageProfile": { + "storageMB": "2048", + "backupRetentionDays": "7", + "geoRedundantBackup": "false" + } + } + }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2021-02-01", @@ -184,6 +211,11 @@ "name": "LoRaKeyManagement__Code", "type": "Custom", "connectionString": "[listkeys(variables('functionAppDefaultHost'),'2021-02-01').masterKey]" + }, + { + "name": "PostgreSQL__ConnectionString", + "type": "Custom", + "connectionString": "[concat('User ID=', variables('pgsqlAdminLogin'), ';Password=', variables('pgsqlAdminPassword'), ';Host=', concat(variables('pgsqlServerName'), '.postgres.database.azure.com') ,';Port=5432;Database=', variables('siteName') ,';Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;" } ], "appSettings": [ diff --git a/templates/portalDeployWithoutLoRa.json b/templates/portalDeployWithoutLoRa.json index 405f00d5d..e1861c840 100644 --- a/templates/portalDeployWithoutLoRa.json +++ b/templates/portalDeployWithoutLoRa.json @@ -68,6 +68,9 @@ } }, "variables": { + "pgsqlServerName": "[concat(parameters('uniqueSolutionPrefix'), 'pgsql')]", + "pgsqlAdminLogin": "[concat(uniqueString(resourceGroup().id, newGuid()))]", + "pgsqlAdminPassword": "[concat(uniqueString(resourceGroup().id, newGuid()), 'x', '!')]", "iotHubName": "[concat(parameters('uniqueSolutionPrefix'), 'hub')]", "dpsName": "[concat(parameters('uniqueSolutionPrefix'), 'dps')]", "siteName": "[concat(parameters('uniqueSolutionPrefix'), 'portal')]", @@ -83,17 +86,17 @@ }, "resources": [ { - "type": "Microsoft.Devices/IotHubs", - "apiVersion": "2021-07-02", - "sku": { - "name": "S1", - "tier": "Standard", - "capacity": 1 - }, - "name": "[variables('iotHubName')]", - "location": "[parameters('location')]", - "properties": {}, - "dependsOn": [] + "type": "Microsoft.Devices/IotHubs", + "apiVersion": "2021-07-02", + "sku": { + "name": "S1", + "tier": "Standard", + "capacity": 1 + }, + "name": "[variables('iotHubName')]", + "location": "[parameters('location')]", + "properties": {}, + "dependsOn": [] }, { "type": "Microsoft.Devices/provisioningServices", @@ -120,38 +123,62 @@ ] }, { - "type": "Microsoft.Storage/storageAccounts", - "name": "[variables('storageAccountName')]", - "apiVersion": "2021-09-01", - "location": "[parameters('location')]", - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - }, - "properties": { - "accountType": "[variables('storageAccountType')]" - }, - "dependsOn": [] + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('storageAccountName')]", + "apiVersion": "2021-09-01", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "properties": { + "accountType": "[variables('storageAccountType')]" + }, + "dependsOn": [] }, { "type": "Microsoft.Storage/storageAccounts/blobServices/containers", "apiVersion": "2021-09-01", "name": "[format('{0}/default/{1}', variables('storageAccountName'), variables('deviceImageContainerName'))]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" + ] }, { - "type": "Microsoft.Insights/components", - "kind": "web", - "name": "[variables('appInsightName')]", - "apiVersion": "2020-02-02", - "location": "[parameters('location')]", - "scale": null, - "properties": { - "Application_Type": "web" - }, - "dependsOn": [] + "type": "Microsoft.DBforPostgreSQL/servers", + "apiVersion": "2017-12-01", + "name": "[variables('pgsqlServerName')]", + "location": "[parameters('location')]", + "sku": { + "name": "B_Gen5_1", + "tier": "Basic", + "capacity": "2", + "size": "5120", + "family": "Gen5" + }, + "properties": { + "createMode": "Default", + "version": "11", + "administratorLogin": "[variables('pgsqlAdminLogin')]", + "administratorLoginPassword": "[variables('pgsqlAdminPassword')]", + "storageProfile": { + "storageMB": "2048", + "backupRetentionDays": "7", + "geoRedundantBackup": "false" + } + } + }, + { + "type": "Microsoft.Insights/components", + "kind": "web", + "name": "[variables('appInsightName')]", + "apiVersion": "2020-02-02", + "location": "[parameters('location')]", + "scale": null, + "properties": { + "Application_Type": "web" + }, + "dependsOn": [] }, { "type": "Microsoft.Web/serverfarms", @@ -225,6 +252,11 @@ "name": "StorageAccount__ConnectionString", "type": "Custom", "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]" + }, + { + "name": "PostgreSQL__ConnectionString", + "type": "Custom", + "connectionString": "[concat('User ID=', variables('pgsqlAdminLogin'), ';Password=', variables('pgsqlAdminPassword'), ';Host=', concat(variables('pgsqlServerName'), '.postgres.database.azure.com') ,';Port=5432;Database=', variables('siteName') ,';Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;" } ], "appSettings": [