Merge pull request #5149 from sbwalker/dev
update based on changes suggested by @adefwebserver
This commit is contained in:
commit
9f9bd1988f
109
azuredeploy.json
109
azuredeploy.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||||
"contentVersion": "1.0.0.1",
|
"contentVersion": "1.0.0.2",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"sqlDatabaseEditionTierDtuCapacity": {
|
"sqlDatabaseEditionTierDtuCapacity": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
"Standard-S12-3000-250",
|
"Standard-S12-3000-250",
|
||||||
"Premium-P1-125-500",
|
"Premium-P1-125-500",
|
||||||
"Premium-P2-250-500",
|
"Premium-P2-250-500",
|
||||||
"Premium-P4-500-500" ,
|
"Premium-P4-500-500",
|
||||||
"Premium-P6-1000-500",
|
"Premium-P6-1000-500",
|
||||||
"Premium-P11-1750-500-1024",
|
"Premium-P11-1750-500-1024",
|
||||||
"Premium-P15-4000-1024",
|
"Premium-P15-4000-1024",
|
||||||
|
@ -38,19 +38,19 @@
|
||||||
"sqlDatabaseName": {
|
"sqlDatabaseName": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "The name of the sql databaseName. It has to be unique."
|
"description": "The name of the sql database. It has to be unique."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sqlAdministratorLogin": {
|
"sqlAdministratorLogin": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "The admin user of the SQL Server"
|
"description": "The admin user of the SQL Server."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sqlAdministratorLoginPassword": {
|
"sqlAdministratorLoginPassword": {
|
||||||
"type": "securestring",
|
"type": "securestring",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "The password of the admin user of the SQL Server"
|
"description": "The password of the admin user of the SQL Server."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"BlazorWebsiteName": {
|
"BlazorWebsiteName": {
|
||||||
|
@ -75,7 +75,10 @@
|
||||||
"P3",
|
"P3",
|
||||||
"P4"
|
"P4"
|
||||||
],
|
],
|
||||||
"defaultValue": "B1"
|
"defaultValue": "B1",
|
||||||
|
"metadata": {
|
||||||
|
"description": "The SKU for the App Service Plan"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"BlazorSKUCapacity": {
|
"BlazorSKUCapacity": {
|
||||||
"type": "int",
|
"type": "int",
|
||||||
|
@ -101,15 +104,18 @@
|
||||||
"databaseEdition": "[variables('databaseEditionTierDtuCapacity')[0]]",
|
"databaseEdition": "[variables('databaseEditionTierDtuCapacity')[0]]",
|
||||||
"databaseTier": "[variables('databaseEditionTierDtuCapacity')[1]]",
|
"databaseTier": "[variables('databaseEditionTierDtuCapacity')[1]]",
|
||||||
"databaseDtu": "[if(greater(length(variables('databaseEditionTierDtuCapacity')), 2), variables('databaseEditionTierDtuCapacity')[2], '')]",
|
"databaseDtu": "[if(greater(length(variables('databaseEditionTierDtuCapacity')), 2), variables('databaseEditionTierDtuCapacity')[2], '')]",
|
||||||
"databaseMaxSizeGigaBytes":"[if(greater(length(variables('databaseEditionTierDtuCapacity')), 3), variables('databaseEditionTierDtuCapacity')[3], '')]",
|
"databaseMaxSizeGigaBytes": "[if(greater(length(variables('databaseEditionTierDtuCapacity')), 3), variables('databaseEditionTierDtuCapacity')[3], '')]",
|
||||||
"databaseServerlessTiers": [
|
"databaseServerlessTiers": [
|
||||||
"GP_S_Gen5_2"
|
"GP_S_Gen5_2"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"resources": [
|
"resources": [
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// SQL Server
|
||||||
|
// ------------------------------------------------------
|
||||||
{
|
{
|
||||||
"type": "Microsoft.Sql/servers",
|
"type": "Microsoft.Sql/servers",
|
||||||
"apiVersion": "2021-11-01",
|
"apiVersion": "2022-05-01-preview", // Updated API version
|
||||||
"name": "[parameters('sqlServerName')]",
|
"name": "[parameters('sqlServerName')]",
|
||||||
"location": "[parameters('location')]",
|
"location": "[parameters('location')]",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
@ -121,9 +127,12 @@
|
||||||
"version": "12.0"
|
"version": "12.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// SQL Database (separate resource rather than subresource)
|
||||||
|
// ------------------------------------------------------
|
||||||
{
|
{
|
||||||
"type": "Microsoft.Sql/servers/databases",
|
"type": "Microsoft.Sql/servers/databases",
|
||||||
"apiVersion": "2021-11-01",
|
"apiVersion": "2022-05-01-preview", // Updated API version
|
||||||
"name": "[format('{0}/{1}', parameters('sqlServerName'), parameters('sqlDatabaseName'))]",
|
"name": "[format('{0}/{1}', parameters('sqlServerName'), parameters('sqlDatabaseName'))]",
|
||||||
"location": "[parameters('location')]",
|
"location": "[parameters('location')]",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
@ -132,24 +141,40 @@
|
||||||
"sku": {
|
"sku": {
|
||||||
"name": "[if(equals(variables('databaseEdition'), 'GeneralPurpose'), variables('databaseTier'), variables('databaseEdition'))]",
|
"name": "[if(equals(variables('databaseEdition'), 'GeneralPurpose'), variables('databaseTier'), variables('databaseEdition'))]",
|
||||||
"tier": "[variables('databaseEdition')]",
|
"tier": "[variables('databaseEdition')]",
|
||||||
"capacity": "[if(equals(variables('databaseDtu'), ''), json('null'), int(variables('databaseDtu')))]"
|
"capacity": "[if(equals(variables('databaseDtu'), ''), json('null'), int(variables('databaseDtu')))]"
|
||||||
},
|
},
|
||||||
"kind": "[concat('v12.0,user,vcore',if(contains(variables('databaseServerlessTiers'),variables('databaseTier')),',serverless',''))]",
|
"kind": "[concat('v12.0,user,vcore', if(contains(variables('databaseServerlessTiers'), variables('databaseTier')), ',serverless', ''))]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"edition": "[variables('databaseEdition')]",
|
"edition": "[variables('databaseEdition')]",
|
||||||
"collation": "[variables('databaseCollation')]",
|
"collation": "[variables('databaseCollation')]",
|
||||||
"maxSizeBytes": "[if(equals(variables('databaseMaxSizeGigaBytes'), ''), json('null'), mul(mul(mul(int(variables('databaseMaxSizeGigaBytes')),1024),1024),1024))]",
|
"maxSizeBytes": "[if(equals(variables('databaseMaxSizeGigaBytes'), ''), json('null'), mul(mul(mul(int(variables('databaseMaxSizeGigaBytes')),1024),1024),1024))]",
|
||||||
"requestedServiceObjectiveName": "[variables('databaseTier')]"
|
"requestedServiceObjectiveName": "[variables('databaseTier')]"
|
||||||
|
|
||||||
},
|
},
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[resourceId('Microsoft.Sql/servers', parameters('sqlserverName'))]"
|
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// Transparent Data Encryption child resource
|
||||||
|
// ------------------------------------------------------
|
||||||
|
{
|
||||||
|
"type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
|
||||||
|
"apiVersion": "2021-02-01-preview",
|
||||||
|
"name": "[format('{0}/{1}/current', parameters('sqlServerName'), parameters('sqlDatabaseName'))]",
|
||||||
|
"properties": {
|
||||||
|
"state": "Enabled"
|
||||||
|
},
|
||||||
|
"dependsOn": [
|
||||||
|
"[resourceId('Microsoft.Sql/servers/databases', parameters('sqlServerName'), parameters('sqlDatabaseName'))]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// Firewall Rule (renamed to 'AllowAllMicrosoftAzureIps')
|
||||||
|
// ------------------------------------------------------
|
||||||
{
|
{
|
||||||
"type": "Microsoft.Sql/servers/firewallRules",
|
"type": "Microsoft.Sql/servers/firewallRules",
|
||||||
"apiVersion": "2021-11-01",
|
"apiVersion": "2022-05-01-preview", // Updated API version
|
||||||
"name": "[format('{0}/{1}', parameters('sqlServerName'), 'AllowAllWindowsAzureIps')]",
|
"name": "[format('{0}/{1}', parameters('sqlServerName'), 'AllowAllMicrosoftAzureIps')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"endIpAddress": "0.0.0.0",
|
"endIpAddress": "0.0.0.0",
|
||||||
"startIpAddress": "0.0.0.0"
|
"startIpAddress": "0.0.0.0"
|
||||||
|
@ -158,26 +183,33 @@
|
||||||
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
|
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// App Service Plan
|
||||||
|
// ------------------------------------------------------
|
||||||
{
|
{
|
||||||
"name": "[variables('hostingPlanName')]",
|
|
||||||
"type": "Microsoft.Web/serverfarms",
|
"type": "Microsoft.Web/serverfarms",
|
||||||
"location": "[resourceGroup().location]",
|
"apiVersion": "2022-03-01", // Updated API version
|
||||||
"apiVersion": "2022-09-01",
|
"name": "[variables('hostingPlanName')]",
|
||||||
"dependsOn": [],
|
"location": "[parameters('location')]",
|
||||||
"tags": {
|
"tags": {
|
||||||
"displayName": "Blazor"
|
"displayName": "Blazor"
|
||||||
},
|
},
|
||||||
"sku": {
|
"sku": {
|
||||||
"name": "[parameters('BlazorSKU')]",
|
"name": "[parameters('BlazorSKU')]",
|
||||||
|
// If you want to auto-map to certain "tier" strings, you can do so. Here we just set the capacity:
|
||||||
"capacity": "[parameters('BlazorSKUCapacity')]"
|
"capacity": "[parameters('BlazorSKUCapacity')]"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": "[variables('hostingPlanName')]",
|
"name": "[variables('hostingPlanName')]",
|
||||||
"numberOfWorkers": 1
|
"numberOfWorkers": 1
|
||||||
}
|
},
|
||||||
|
"dependsOn": []
|
||||||
},
|
},
|
||||||
|
// ------------------------------------------------------
|
||||||
|
// Web App
|
||||||
|
// ------------------------------------------------------
|
||||||
{
|
{
|
||||||
"apiVersion": "2018-02-01",
|
"apiVersion": "2022-03-01", // Updated API version
|
||||||
"name": "[parameters('BlazorWebsiteName')]",
|
"name": "[parameters('BlazorWebsiteName')]",
|
||||||
"type": "Microsoft.Web/sites",
|
"type": "Microsoft.Web/sites",
|
||||||
"location": "[parameters('location')]",
|
"location": "[parameters('location')]",
|
||||||
|
@ -189,27 +221,46 @@
|
||||||
"displayName": "Website"
|
"displayName": "Website"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": "[parameters('BlazorWebsiteName')]",
|
|
||||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
|
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
|
||||||
"siteConfig": {
|
"siteConfig": {
|
||||||
"webSocketsEnabled": true,
|
"webSocketsEnabled": true,
|
||||||
"netFrameworkVersion": "v5.0"
|
// Updated .NET version "v9.0" from second snippet
|
||||||
|
"netFrameworkVersion": "v9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resources": [
|
"resources": [
|
||||||
|
// --------------------------------------------------
|
||||||
|
// Source Control for your Web App
|
||||||
|
// --------------------------------------------------
|
||||||
{
|
{
|
||||||
"type": "sourcecontrols",
|
"type": "sourcecontrols",
|
||||||
"apiVersion": "2018-02-01",
|
"apiVersion": "2022-03-01",
|
||||||
"name": "web",
|
"name": "web",
|
||||||
"location": "[parameters('location')]",
|
"location": "[parameters('location')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[resourceId('Microsoft.Web/sites', parameters('BlazorWebsiteName'))]"
|
"[resourceId('Microsoft.Web/sites', parameters('BlazorWebsiteName'))]"
|
||||||
//"[resourceId('Microsoft.Web/Sites/config', parameters('BlazorWebsiteName'), 'connectionstrings')]"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"RepoUrl": "https://github.com/oqtane/oqtane.framework.git",
|
"repoUrl": "https://github.com/oqtane/oqtane.framework.git",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"IsManualIntegration": true
|
"isManualIntegration": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// --------------------------------------------------
|
||||||
|
// Connection Strings (to use FQDN)
|
||||||
|
// --------------------------------------------------
|
||||||
|
{
|
||||||
|
"type": "config",
|
||||||
|
"apiVersion": "2022-03-01",
|
||||||
|
"name": "connectionstrings",
|
||||||
|
"dependsOn": [
|
||||||
|
"[resourceId('Microsoft.Web/sites', parameters('BlazorWebsiteName'))]"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"DefaultConnection": {
|
||||||
|
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('sqlDatabaseName'), ';User Id=', parameters('sqlAdministratorLogin'), '@', reference(resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))).fullyQualifiedDomainName, ';Password=', parameters('sqlAdministratorLoginPassword'), ';')]",
|
||||||
|
"type": "SQLAzure"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user