UNPKG

generator-team

Version:

Generates an app with CI/CD in Team Foundation Server or Team Services

270 lines 11 kB
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "hostingPlanName": { "type": "string", "minLength": 1 }, "webSiteName": { "type": "string", "minLength": 1 }, "aiLocation": { "type": "string", "allowedValues": [ "East US", "North Europe", "South Central US", "West Europe" ] }, "websiteNodeVersion": { "type": "string", "minLength": 1, "defaultValue": "6.9.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" } } }, "resources": [ { "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]", "tags": { "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource", "displayName": "Website" }, "dependsOn": [ "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]" ], "properties": { "name": "[parameters('webSiteName')]", "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" }, "resources": [ { "name": "appsettings", "type": "config", "apiVersion": "2015-08-01", "dependsOn": [ "[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]", "[concat('Microsoft.Insights/components/', parameters('webSiteName'))]" ], "tags": { "displayName": "appSettings" }, "properties": { "WEBSITE_NODE_DEFAULT_VERSION": "[parameters('websiteNodeVersion')]", "MSDEPLOY_RENAME_LOCKED_FILES": "1", "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('Microsoft.Insights/components', parameters('webSiteName')), '2014-04-01').InstrumentationKey]" } } ] }, { "apiVersion": "2014-04-01", "name": "[concat(parameters('hostingPlanName'), '-', resourceGroup().name)]", "type": "Microsoft.Insights/autoscalesettings", "location": "[resourceGroup().location]", "tags": { "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource", "displayName": "AutoScaleSettings" }, "dependsOn": [ "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]" ], "properties": { "profiles": [ { "name": "Default", "capacity": { "minimum": 1, "maximum": 2, "default": 1 }, "rules": [ { "metricTrigger": { "metricName": "CpuPercentage", "metricResourceUri": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]", "timeGrain": "PT1M", "statistic": "Average", "timeWindow": "PT10M", "timeAggregation": "Average", "operator": "GreaterThan", "threshold": 80.0 }, "scaleAction": { "direction": "Increase", "type": "ChangeCount", "value": 1, "cooldown": "PT10M" } }, { "metricTrigger": { "metricName": "CpuPercentage", "metricResourceUri": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]", "timeGrain": "PT1M", "statistic": "Average", "timeWindow": "PT1H", "timeAggregation": "Average", "operator": "LessThan", "threshold": 60.0 }, "scaleAction": { "direction": "Decrease", "type": "ChangeCount", "value": 1, "cooldown": "PT1H" } } ] } ], "enabled": false, "name": "[concat(parameters('hostingPlanName'), '-', resourceGroup().name)]", "targetResourceUri": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]" } }, { "condition": "[equals(parameters('skuName'), 'S1')]", "comments": "Staging slot", "type": "Microsoft.Web/sites/slots", "kind": "app", "name": "[concat(parameters('webSiteName'), '/stage')]", "apiVersion": "2016-08-01", "location": "[resourceGroup().location]", "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" }, "resources": [ { "condition": "[equals(parameters('skuName'), 'S1')]", "name": "appsettings", "type": "config", "apiVersion": "2015-08-01", "dependsOn": [ "[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]", "[resourceId('Microsoft.Web/sites/slots', parameters('webSiteName'), 'stage')]" ], "tags": { "displayName": "appSettings" }, "properties": { "WEBSITE_NODE_DEFAULT_VERSION": "[parameters('websiteNodeVersion')]", "MSDEPLOY_RENAME_LOCKED_FILES": "1" } } ], "dependsOn": [ "[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]", "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]" ] }, { "apiVersion": "2014-04-01", "name": "[parameters('webSiteName')]", "type": "Microsoft.Insights/components", "location": "[parameters('aiLocation')]", "dependsOn": [ "[concat('Microsoft.Web/sites/', parameters('webSiteName'))]" ], "tags": { "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('webSiteName'))]": "Resource", "displayName": "AppInsightsComponent" }, "properties": { "applicationId": "[parameters('webSiteName')]", "Application_Type": "web" } }, { "apiVersion": "2015-05-01", "name": "[concat(parameters('webSiteName'), 'Ping')]", "type": "Microsoft.Insights/webtests", "location": "[parameters('aiLocation')]", "tags": { "[concat('hidden-link:', resourceId('Microsoft.Insights/components/', parameters('webSiteName')))]": "Resource" }, "dependsOn": [ "[concat('Microsoft.Insights/components/', parameters('webSiteName'))]" ], "properties": { "Name": "[concat(parameters('webSiteName'), 'Ping')]", "Description": "Pings URL to make sure site is up.", "Enabled": true, "Frequency": 300, "Timeout": 30, "Kind": "ping", "Locations": [ { "Id": "us-ca-sjc-azr" }, { "Id": "us-il-ch1-azr" }, { "Id": "us-tx-sn1-azr" }, { "Id": "us-fl-mia-edge" }, { "Id": "us-va-ash-azr" } ], "Configuration": { "WebTest": "[concat('<WebTest Name=\"ping\" Id=\"<%= webtest_guid %>\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"0\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"> <Items> <Request Method=\"GET\" Guid=\"a5f10126-e4cd-570d-961c-cea43999a200\" Version=\"1.1\" Url=\"http://', reference(resourceId('Microsoft.Web/sites/', parameters('webSiteName')), '2015-08-01').defaultHostName ,'\" ThinkTime=\"0\" Timeout=\"300\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>')]" }, "SyntheticMonitorId": "Ping" } } ] }