Created
November 29, 2018 12:17
-
-
Save HoussemDellai/acda85963b555ca24b699177098ee4a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"hostingPlanName": { | |
"type": "string", | |
"minLength": 1 | |
}, | |
"skuName": { | |
"type": "string", | |
"defaultValue": "F1", | |
"allowedValues": [ | |
"F1", | |
"D1", | |
"B1", | |
"B2", | |
"B3", | |
"S1", | |
"S2", | |
"S3", | |
"P1", | |
"P2", | |
"P3", | |
"P4" | |
], | |
"metadata": { | |
"description": "Describes plan's pricing tier and instance size. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/" | |
} | |
}, | |
"skuCapacity": { | |
"type": "int", | |
"defaultValue": 1, | |
"minValue": 1, | |
"metadata": { | |
"description": "Describes plan's instance count" | |
} | |
}, | |
"administratorLogin": { | |
"type": "string" | |
}, | |
"administratorLoginPassword": { | |
"type": "securestring" | |
}, | |
"databaseName": { | |
"type": "string" | |
}, | |
"collation": { | |
"type": "string", | |
"defaultValue": "SQL_Latin1_General_CP1_CI_AS" | |
}, | |
"edition": { | |
"type": "string", | |
"defaultValue": "Basic", | |
"allowedValues": [ | |
"Basic", | |
"Standard", | |
"Premium" | |
] | |
}, | |
"maxSizeBytes": { | |
"type": "string", | |
"defaultValue": "1073741824" | |
}, | |
"requestedServiceObjectiveName": { | |
"type": "string", | |
"defaultValue": "Basic", | |
"allowedValues": [ | |
"Basic", | |
"S0", | |
"S1", | |
"S2", | |
"P1", | |
"P2", | |
"P3" | |
], | |
"metadata": { | |
"description": "Describes the performance level for Edition" | |
} | |
}, | |
"webSiteName": { | |
"type": "string" | |
}, | |
"sqlserverName": { | |
"type": "string" | |
} | |
}, | |
"variables": { | |
}, | |
"resources": [ | |
{ | |
"name": "[parameters('sqlserverName')]", | |
"type": "Microsoft.Sql/servers", | |
"location": "[resourceGroup().location]", | |
"tags": { | |
"displayName": "SqlServer" | |
}, | |
"apiVersion": "2014-04-01-preview", | |
"properties": { | |
"administratorLogin": "[parameters('administratorLogin')]", | |
"administratorLoginPassword": "[parameters('administratorLoginPassword')]" | |
}, | |
"resources": [ | |
{ | |
"name": "[parameters('databaseName')]", | |
"type": "databases", | |
"location": "[resourceGroup().location]", | |
"tags": { | |
"displayName": "Database" | |
}, | |
"apiVersion": "2014-04-01-preview", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Sql/servers/', parameters('sqlserverName'))]" | |
], | |
"properties": { | |
"edition": "[parameters('edition')]", | |
"collation": "[parameters('collation')]", | |
"maxSizeBytes": "[parameters('maxSizeBytes')]", | |
"requestedServiceObjectiveName": "[parameters('requestedServiceObjectiveName')]" | |
} | |
}, | |
{ | |
"type": "firewallrules", | |
"apiVersion": "2014-04-01-preview", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Sql/servers/', parameters('sqlserverName'))]" | |
], | |
"location": "[resourceGroup().location]", | |
"name": "AllowAllWindowsAzureIps", | |
"properties": { | |
"endIpAddress": "0.0.0.0", | |
"startIpAddress": "0.0.0.0" | |
} | |
} | |
] | |
}, | |
{ | |
"apiVersion": "2015-08-01", | |
"name": "[parameters('hostingPlanName')]", | |
"type": "Microsoft.Web/serverfarms", | |
"location": "[resourceGroup().location]", | |
"tags": { | |
"displayName": "HostingPlan" | |
}, | |
"sku": { | |
"name": "[parameters('skuName')]", | |
"capacity": "[parameters('skuCapacity')]" | |
}, | |
"properties": { | |
"name": "[parameters('hostingPlanName')]" | |
} | |
}, | |
{ | |
"apiVersion": "2015-08-01", | |
"name": "[parameters('webSiteName')]", | |
"type": "Microsoft.Web/sites", | |
"location": "[resourceGroup().location]", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]" | |
], | |
"tags": { | |
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty", | |
"displayName": "Website" | |
}, | |
"properties": { | |
"name": "[parameters('webSiteName')]", | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2015-08-01", | |
"type": "config", | |
"name": "connectionstrings", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/Sites/', parameters('webSiteName'))]" | |
], | |
"properties": { | |
"ProductsContext": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.Sql/servers/', parameters('sqlserverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '@', parameters('sqlserverName'), ';Password=', parameters('administratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
} | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment