"variables"
: {
"siteNameStage"
:
"[concat(parameters('siteName'),'stage')]"
,
"databaseNameStage"
:
"[concat(parameters('databaseName'),'stage')]"
,
"storageAccountId"
:
"[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/','Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]"
,
"storageAccountIdStage"
:
"[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountNameStage'))]"
,
"storageAccountNameStage"
:
"[concat(parameters('storageAccountName'),'stage')]"
},
"resources"
: [
...
{
"apiVersion"
:
"2015-06-01"
,
"name"
:
"[parameters('siteName')]"
,
"type"
:
"Microsoft.Web/Sites"
,
"location"
:
"[parameters('siteLocation')]"
,
"dependsOn"
: [
"[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]"
],
"tags"
: {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
:
"empty"
},
"properties"
: {
"name"
:
"[parameters('siteName')]"
,
"serverFarmId"
:
"[parameters('hostingPlanName')]"
},
"resources"
: [
{
"apiVersion"
:
"2014-11-01"
,
"type"
:
"config"
,
"name"
:
"connectionstrings"
,
"dependsOn"
: [
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
,
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
,
"[resourceId('Microsoft.Cache/Redis', parameters('redisName'))]"
],
"properties"
: {
"DefaultConnection"
: {
"value"
:
"[concat('Data Source=tcp:', reference(concat('Microsoft.Sql/servers/', parameters('serverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '@', parameters('serverName'), ';Password=', parameters('administratorLoginPassword'), ';')]"
,
"type"
:
"SQLAzure"
},
"AzureWebJobsDashboard"
: {
"value"
:
"[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
,
"type"
:
"custom"
},
"AzureWebJobsStorage"
: {
"value"
:
"[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
,
"type"
:
"custom"
},
"AzureWebJobsServiceBus"
: {
"value"
:
"[parameters('serviceBusConnectionString')]"
,
"type"
:
"custom"
},
"WebDocDb"
: {
"value"
:
"[concat('AccountEndpoint=', reference(concat('Microsoft.DocumentDb/databaseAccounts/', parameters('databaseName'))).documentEndpoint, ';AccountKey=', listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', parameters('databaseName')), '2015-04-08').primaryMasterKey, ';')]"
,
"type"
:
"custom"
},
"RedisCache"
: {
"value"
:
"[listKeys(resourceId('Microsoft.Cache/Redis', parameters('redisName')), '2014-04-01').primaryKey]"
,
"type"
:
"custom"
}
}
},
{
"apiVersion"
:
"2015-04-01"
,
"name"
:
"appsettings"
,
"type"
:
"config"
,
"dependsOn"
: [
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
],
"properties"
: {
"Demo:Environment"
:
"PROD"
,
"Test:Environment"
:
""
}
},
{
"apiVersion"
:
"2014-11-01"
,
"name"
:
"slotconfignames"
,
"type"
:
"config"
,
"dependsOn"
: [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties"
: {
"connectionStringNames"
: [
"DefaultConnection"
,
"AzureWebJobsDashboard"
,
"AzureWebJobsStorage"
,
"AzureWebJobsServiceBus"
,
"WebDocDb"
,
"RedisCache"
],
"appSettingNames"
: [
"Demo:Environment"
,
"Test:Environment"
]
}
},
{
"apiVersion"
:
"2015-04-01"
,
"name"
:
"Staging"
,
"type"
:
"slots"
,
"location"
:
"[parameters('siteLocation')]"
,
"dependsOn"
: [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties"
: {
},
"resources"
: [
{
"apiVersion"
:
"2014-11-01"
,
"type"
:
"config"
,
"name"
:
"connectionstrings"
,
"dependsOn"
: [
"[resourceId('Microsoft.Web/Sites/slots', parameters('siteName'), 'Staging')]"
,
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
,
"[resourceId('Microsoft.Cache/Redis', parameters('redisName'))]"
],
"properties"
: {
"DefaultConnection"
: {
"value"
:
"[concat('Data Source=tcp:', reference(concat('Microsoft.Sql/servers/', parameters('serverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', variables('databaseNameStage'), ';User Id=', parameters('administratorLogin'), '@', parameters('serverName'), ';Password=', parameters('administratorLoginPassword'), ';')]"
,
"type"
:
"SQLAzure"
},
"AzureWebJobsDashboard"
: {
"value"
:
"[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountNameStage'), ';AccountKey=', listKeys(variables('storageAccountIdStage'),'2015-05-01-preview').key1)]"
,
"type"
:
"custom"
},
"AzureWebJobsStorage"
: {
"value"
:
"[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountNameStage'), ';AccountKey=', listKeys(variables('storageAccountIdStage'),'2015-05-01-preview').key1)]"
,
"type"
:
"custom"
},
"AzureWebJobsServiceBus"
: {
"value"
:
"[parameters('serviceBusConnectionStringStage')]"
,
"type"
:
"custom"
},
"WebDocDb"
: {
"value"
:
"[concat('AccountEndpoint=', reference(concat('Microsoft.DocumentDb/databaseAccounts/', variables('databaseNameStage'))).documentEndpoint, ';AccountKey=', listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', variables('databaseNameStage')), '2015-04-08').primaryMasterKey, ';')]"
,
"type"
:
"custom"
},
"RedisCache"
: {
"value"
:
"[listKeys(resourceId('Microsoft.Cache/Redis', parameters('redisName')), '2014-04-01').primaryKey]"
,
"type"
:
"custom"
}
}
},
{
"apiVersion"
:
"2015-04-01"
,
"name"
:
"appsettings"
,
"type"
:
"config"
,
"dependsOn"
: [
"[resourceId('Microsoft.Web/Sites/slots', parameters('siteName'), 'Staging')]"
],
"properties"
: {
"Demo:Environment"
:
"TEST"
,
"Test:Environment"
:
"TEST"
}
}
]
}
]
},
...