Deploy a node.js site using Azure Resource Manager - node.js

I'm struggling with a ARM deployment script for my node.js application. If I point to a repo with an MVC application it all works fine, but not using an node.js app.
Are there any specific settings for node.js sites?
Here is the resource part of my script:
{
"apiVersion": "2015-08-01",
"name": "[parameters('nodeName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('nodeName'))]": "Resource",
"displayName": "Website"
},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('nodeName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', concat(parameters('nodeName')))]"
],
"properties": {
"repoUrl": "https://github.com/microServiceBus/microservicebus.node.git",
"branch": "master",
"IsManualIntegration": true
}
}
],
"properties": {
"name": "[parameters('nodeName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('nodeName'))]",
"siteConfig": {
"appSettings": [
{
"Name": "hubUri",
"Value": "[parameters('hubUri')]"
},
{
"Name": "nodeName",
"Value": "[parameters('nodeName')]"
},
{
"Name": "organizationaId",
"Value": "[parameters('organizationaId')]"
}
]
}
}
}

The issue was that the name of the repo had a dot in it (microservicebus.node.git). I believe the bug is fixed or is going to be fixed soon.

Related

AZURE ARM Templates. The parameter LinuxFxVersion has an invalid value [duplicate]

I've set-up an App Service using the following ARM template snippet:
{
"name": "[variables('webBackEnd')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName')))]": "Resource",
"displayName": "BackendWebApp"
},
"properties": {
"name": "[variables('webBackEnd')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
}
},
This will deploy an App Service. However, by default, it will be setup to use the .Net Framework. Below is a view from my Azure Portal:
In order to run my ASP.Net Core-based web server, I have to manually switch the Stack Settings from ".Net" to ".Net Core". It's a trivial thing to do, but I'd much rather configure it correctly through the ARM template. I searched Microsoft's docs but was unable to find the correct property. How does one go about to do this?
here's how an example web app looks when created from the portal:
{
"apiVersion": "2018-02-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [],
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[parameters('currentStack')]"
}
]
},
// redacted some values
}
},
and the current stack value is dotnetcore
The accepted answer didn't work for me. I began my own investigation and finished with this code, which works in my case.
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('site_name')]",
"location": "[resourceGroup().location]",
.........................................
"resources": [
{
"name": "metadata",
"type": "config",
"apiVersion": "2018-11-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('site_name'))]"
],
"tags": {
},
"properties": {
"CURRENT_STACK": "dotnetcore"
}
}
]

Azure app service slot different value app setting

I have a webapp with a slot. Both should have the app setting name DISABLE_CRON. The webapp (production slot) should have this setting set to false and the slot should have the setting set to true. I would like to do this with ARM-template. The webapp have many appsettings such as database name, database login username and password etc. I want all of those settings to be in a variable so I don't have to write them one time for the webapp and one time for the slot. Basically I just want to change the value to true on the slot and keep all other settings the same.
"variables": {
"appName": "[concat(parameters('applicationName'),'-',parameters('environment'),'-app')]",
"hostingPlanName": "[concat(parameters('applicationName'),'-',parameters('environment'),'-plan')]",
"dbserverName": "[concat('onlinecampaignsites-',parameters('environment'),'-dbs-01')]",
"connectionString": "[concat('Database=', parameters('applicationName'), ';Data Source=', concat('onlinecampaignsites-',parameters('environment'),'-dbs-01'),'.mysql.database.azure.com;User Id=',parameters('administratorLogin'),'#',concat('onlinecampaignsites-',parameters('environment'),'-dbs-01'),';Password=',parameters('administratorLoginPassword'))]",
"appInsightsName": "[concat(parameters('applicationName'),'-',parameters('environment'),'-appIn')]",
"databaseName": "[parameters('applicationName')]",
"storageName": "[concat(parameters('applicationName'),parameters('environment'),'stg')]",
"serverFarmResourceGroup": "[resourceGroup().name]",
"subscriptionId": "[subscription().subscriptionId]",
"containerName01": "[concat(parameters('applicationName'),'-',parameters('environment'),'-uploads')]",
"staging": "staging",
"appsettings": {
"DISABLE_CRON": "false",
"HEJSAN": "Den vann den"
}
},
"resources": [
{
"name": "[variables('appname')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"apiVersion": "2018-02-01",
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]"
],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "DISABLE_CRON",
"value": "true"
}
]
},
"hostNameSslStates":"[concat('{\"name\": \"',parameters('customDomain'),'\", \"sslState\": \"Disabled\", \"virtualIP\": null, \"thumbprint\": null, \"toUpdate\": null,\"hostType\": \"Standard\"}')]",
"serverFarmId": "[concat('/subscriptions/', variables('subscriptionId'),'/resourcegroups/', variables('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]",
"hostingEnvironment": "",
"httpsOnly": true
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "slotconfignames",
"type": "config",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('appName'))]"
],
"properties": {
"appSettingNames": [ "DISABLE_CRON" ]
}
},
{
"apiVersion": "2018-02-01",
"type": "config",
"name": "appsettings",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('appName'))]"
],
"properties": "[variables('appsettings')]"
}
]
},
{
"apiVersion": "2018-02-01",
"type": "Microsoft.Web/sites/slots",
"name": "[concat(variables('appName'), '/', variables('staging'))]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('appName'))]",
"[concat('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]"
],
"properties": {},
"resources": [
{
"apiVersion": "2018-02-01",
"type": "config",
"name": "appsettings",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/slots', variables('appName'), variables('staging'))]"
],
"properties": "[variables('appsettings')]"
}
]
},
In the ARM-template example there are two appsettings. It does not work to set the DISABLE_CRON to true, I just wanted to show that with this example.

How to Set Up Application Insights from an Release Pipeline/ARM Templates

We have an Azure DevOps release pipeline, which sets up all of our Azure resources in a location. I can create everything successfully with ARM templates, but I'm struggling to link the App Service with the App Insights resource.
If I were doing it manually, I'd click a "Turn on site extension" button in the AppInsights blade of the App Service (under the heading "Enable Application Insights through site extension without redeploying your code").
I've tried adding an "Azure App Service Manage" step to my release pipeline, set to install the "Application Insights extension for Azure App Service" extension:
In addition, I've added an "Azure App Service Manage" step to my release pipeline, set to "Enable Continuous Monitoring":
But the result is still that AppInsights is connected, but the extension is not installed:
Is there any way I can do this automatically? Either via an ARM template, a PowerShell script, or something else?
Edit: In the "Extensions" blade, I can see "Application Insights extension for Azure App Service" (v2.6.5) and "ASP.NET Core Logging Extensions" (v2.2.0), but I'm still asked to "Turn on site extension" in the "Aplication Insights" blade.
In an ARM-template you can do:
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-02-01",
"name": "[variables('web_app_service_name')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('plan_name'))]",
"[resourceId('Microsoft.Insights/components', variables('app_insights_name'))]"
],
"kind": "app",
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(variables('app_insights_name'), '2015-05-01').InstrumentationKey]"
},
{
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
"value": "~2"
}
]
}
}
}
Refer to documentation at https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps#automate-monitoring
i think you would need to do something like that:
{
"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": [
"[resourceId('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]"
],
"properties": {
"name": "[parameters('webSiteName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('webSiteName'))]",
"Microsoft.ApplicationInsights.AzureWebSites"
],
"properties": {
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(concat('microsoft.insights/components/', parameters('appInsightsName'))).InstrumentationKey]"
}
},
{
// this bit installs application insights extension
"apiVersion": "2015-08-01",
"name": "Microsoft.ApplicationInsights.AzureWebSites",
"type": "siteextensions",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('webSiteName'))]"
],
"properties": {
}
}
]
}
I've never actually tried this, but looks correct, link to the example I've found: https://github.com/tomasr/webapp-appinsights/blob/master/WebSite.json
Make sure that your app settings key is APPINSIGHTS_INSTRUMENTATIONKEY and not ApplicationInsights:InstrumentationKey. Somewhere in the MS docs it gives the impression that you can use either. In fact that's not the case, in Azure you need to use the former otherwise Application Insights won't be enabled for server side insights.
In order for the Azure Portal to show an active integration with Application Insights, you need to set three app settings.
https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps?tabs=net#automate-the-creation-of-an-application-insights-resource-and-link-to-your-newly-created-app-service
{
"resources": [
{
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference('microsoft.insights/components/AppMonitoredSite', '2015-05-01').InstrumentationKey]"
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[reference('microsoft.insights/components/AppMonitoredSite', '2015-05-01').ConnectionString]"
},
{
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
"value": "~2"
}
]
},
"name": "[parameters('name')]",
"serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"hostingEnvironment": "[parameters('hostingEnvironment')]"
},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"microsoft.insights/components/AppMonitoredSite"
],
"apiVersion": "2016-03-01",
"location": "[parameters('location')]"
},
{
"apiVersion": "2016-09-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('hostingPlanName')]",
"workerSizeId": "[parameters('workerSize')]",
"numberOfWorkers": "1",
"hostingEnvironment": "[parameters('hostingEnvironment')]"
},
"sku": {
"Tier": "[parameters('sku')]",
"Name": "[parameters('skuCode')]"
}
},
{
"apiVersion": "2015-05-01",
"name": "AppMonitoredSite",
"type": "microsoft.insights/components",
"location": "West US 2",
"properties": {
"ApplicationId": "[parameters('name')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
}
],
"parameters": {
"name": {
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"hostingEnvironment": {
"type": "string"
},
"location": {
"type": "string"
},
"sku": {
"type": "string"
},
"skuCode": {
"type": "string"
},
"workerSize": {
"type": "string"
},
"serverFarmResourceGroup": {
"type": "string"
},
"subscriptionId": {
"type": "string"
}
},
"$schema": "https://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0"
}
See also my other answer on this: Azure Cli How to enable Application Insights for webapp

ARM Template for to configure App Services with new VNet Integration feature?

I am working on ARM Templates, I have created the template file with two or more azure app services along with app service plan and then configured with VNET Integration of each app service.
This is sample JSON code:
{
"comments": "Web-App-01",
"name": "[variables('app_name_01')]",
"type": "Microsoft.Web/sites",
"location": "[variables('location')]",
"apiVersion": "2016-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('asp_name_01'))]"
],
"tags": {
"displayName": "[variables('app_name_01')]"
},
"properties": {
"name": "[variables('app_name_01')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('asp_name_01'))]",
"siteConfig": {
"alwaysOn": true
}
},
"resources": [
{
"type": "Microsoft.Web/sites/virtualNetworkConnections",
"name": "[concat(variables('app_name_01'), '/', variables('vnet_connection_name'),uniqueString('asdsdaxsdsd'))]",
"apiVersion": "2016-08-01",
"location": "[variables('location')]",
"properties": {
"vnetResourceId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vm_vnet_name'), variables('web_subnet_name'))]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('app_name_01'))]",
"[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vm_vnet_name'), variables('web_subnet_name'))]"
]
}
]
},
{
"comments": "Web-App-02",
"name": "[variables('app_name_02')]",
"type": "Microsoft.Web/sites",
"location": "[variables('location')]",
"apiVersion": "2016-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('asp_name_02'))]"
],
"tags": {
"displayName": "[variables('app_name_02')]"
},
"properties": {
"name": "[variables('app_name_02')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('asp_name_01'))]",
"siteConfig": {
"alwaysOn": true
}
},
"resources": [
{
"type": "Microsoft.Web/sites/virtualNetworkConnections",
"name": "[concat(variables('app_name_02'), '/', variables('vnet_connection_name'),uniqueString('asdsdaxsdsd'))]",
"apiVersion": "2016-08-01",
"location": "[variables('location')]",
"properties": {
"vnetResourceId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vm_vnet_name'), variables('web_subnet_name'))]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('app_name_02'))]",
"[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vm_vnet_name'), variables('web_subnet_name'))]"
]
}
]
}
The above code works fine for few azure app services, but for the rest of the app services I am getting internal server error or Conflict or Bad Request during VNET Integration of Azure App Service.
Note: When I deployed the above the JSON Code, the old VNET
integration is configured instead of New VNET (Preview) feature. So, I need to configure New VNET (Preview) feature for each app service.
So, can anyone suggest me how to resolve the above issue.
I've found a working example for this on an Azure Docs GitHub post:
How do we integrate the new vnet integrartion with ARM templates?
Seems to work a different way with the new VNet integration which uses a Microsoft.Web/sites/config sub-resource named virtualNetwork instead of the Microsoft.Web/sites/virtualNetworkConnections sub-resource
As well as a few requirements that need to be set on the target subnet / vnet (described in the link). The integration piece looks something like this:
{
"apiVersion": "2018-02-01",
"type": "Microsoft.Web/sites",
"name": "[parameters('appName')]",
"location": "[resourceGroup().location]",
...
"resources": [
{
"name": "virtualNetwork",
"type": "config",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"properties": {
"subnetResourceid": "[parameters('subnetResourceId')]",
"swiftSupported": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('appName'))]"
]
}
]
},
Apart from this I've not found much else documented, except for a reference to it in the azure-rest-api-specs which has the "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork" endpoint defined:
azure-rest-api-specs / WebApps.json
It also seems (as the spec suggests) replacing "type": "config" with "type": "networkConfig" also works.
I've talked to a Prem Engineer of Microsoft.
The Key is to replace the Automation Template
{
"type": "Microsoft.Web/sites/virtualNetworkConnections",
"apiVersion": "2018-11-01",
"name": "[concat(parameters('sites_FelixOFA_name'), '/xxxxxxx_Functions')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_FelixOFA_name'))]"
],
"properties": {
"vnetResourceId": "[concat(parameters('virtualNetworks_FelixODevPremNet_externalid'), '/subnets/Functions')]",
"isSwift": true
}
}
with
{
"type": "Microsoft.Web/sites/networkConfig",
"name": "[concat(parameters('webAppName'),'/VirtualNetwork')]",
"apiVersion": "2016-08-01",
"properties":
{
"subnetResourceId": "[parameters('subnetResourceId')]"
}
}
Where subnetResourceId is the resource id of their subnet – it should look like /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}
I tried to reach same functionality by Bicep file, finally using
virtualNetworkSubnetId:
worked for me.
For example:
resource webAppName_resource 'Microsoft.Web/sites#2020-12-01' = {
name: '${webAppName}'
location: location
properties: {
serverFarmId: appServicePlanPortalName.id
virtualNetworkSubnetId: '${vnetDeploy_module.outputs.vnetid}/subnets/${vnetDeploy_module.outputs.subnetname}'
siteConfig: {
linuxFxVersion: linuxFxVersion
minTlsVersion: minTlsVersion
http20Enabled: http20Enabled
}
httpsOnly: httpsOnly
}
}
See templates in https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.web/app-service-regional-vnet-integration.
Result in ARM is:
{
"type": "Microsoft.Web/sites",
"apiVersion": "2021-01-01",
"name": "[parameters('appName')]",
"location": "[parameters('location')]",
"kind": "app",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
"virtualNetworkSubnetId": "[reference(resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))).subnets[0].id]",
"httpsOnly": true,
"siteConfig": {
"vnetRouteAllEnabled": true,
"http20Enabled": true
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))]"
]
}
To fix this, I simply changed the isSwift or swiftSupported option to false.

Azure Resource Manager (ARM) Import Databases (Bacpac) Error (Closed)

I am using ARM template to perform Import Azure SQL databases from bacpac files storing on my storage account.
However I am getting unexpected Bad Request error from Azure.
The same ARM template has been working fine just a few weeks ago.
When I try to do the Import Databases in the new Azure portal manually, I am also getting error from Azure, but they didn't specify the error detail.
I have tried for three different locations: Southeast Asia, North Europe and Central US but all have failed.
Below is my ARM template portion for database server and database import.
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2014-04-01-preview",
"properties": {
"administratorLogin": "[parameters('dbLogin')]",
"administratorLoginPassword": "[parameters('dbPassword')]",
"version": "12.0"
},
"name": "[parameters('sqlServerName')]",
"location": "[resourceGroup().location]",
"resources": [
{
"type": "firewallrules",
"apiVersion": "2014-04-01-preview",
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
},
"name": "AllowAllWindowsAzureIps",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
]
},
{
"type": "databases",
"apiVersion": "2014-04-01-preview",
"properties": {
"edition": "[parameters('databaseEdition')]",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": "[parameters('maxDatabaseSize')]",
"requestedServiceObjectiveId": "[parameters('dbServiceObjectiveLevel')]"
},
"name": "[parameters('webDatabaseName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
],
"resources": [
{
"type": "extensions",
"apiVersion": "2014-04-01-preview",
"properties": {
"operationMode": "Import",
"storageKey": "[parameters('bacpacStorageKey')]",
"storageKeyType": "Primary",
"administratorLogin": "[parameters('dbLogin')]",
"administratorLoginPassword": "[parameters('dbPassword')]",
"storageUri": "[parameters('webBacpacUrl')]"
},
"name": "Import",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers/databases', parameters('sqlServerName'), parameters('webDatabaseName'))]"
]
}
]
},
{
"type": "databases",
"apiVersion": "2014-04-01-preview",
"properties": {
"edition": "[parameters('databaseEdition')]",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": "[parameters('maxDatabaseSize')]",
"requestedServiceObjectiveId": "[parameters('dbServiceObjectiveLevel')]"
},
"name": "[parameters('coreDatbaseName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
],
"resources": [
{
"type": "extensions",
"apiVersion": "2014-04-01-preview",
"properties": {
"operationMode": "Import",
"storageKey": "[parameters('bacpacStorageKey')]",
"storageKeyType": "Primary",
"administratorLogin": "[parameters('dbLogin')]",
"administratorLoginPassword": "[parameters('dbPassword')]",
"storageUri": "[parameters('coreBacpacUrl')]"
},
"name": "Import",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers/databases', parameters('sqlServerName'), parameters('coreDatbaseName'))]"
]
}
]
},
{
"type": "databases",
"apiVersion": "2014-04-01-preview",
"properties": {
"edition": "[parameters('databaseEdition')]",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": "[parameters('maxDatabaseSize')]",
"requestedServiceObjectiveId": "[parameters('dbServiceObjectiveLevel')]"
},
"name": "[parameters('mastrerDatabaseName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
],
"resources": [
{
"type": "extensions",
"apiVersion": "2014-04-01-preview",
"properties": {
"operationMode": "Import",
"storageKey": "[parameters('bacpacStorageKey')]",
"storageKeyType": "Primary",
"administratorLogin": "[parameters('dbLogin')]",
"administratorLoginPassword": "[parameters('dbPassword')]",
"storageUri": "[parameters('masterBacpacUrl')]"
},
"name": "Import",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers/databases', parameters('sqlServerName'), parameters('mastrerDatabaseName'))]"
]
}
]
}
]
}
The error from Azure portal for my ARM deployment:
Any help or advice is appreciated!
Note: I have suspected this could be due to platform issue but there is no issue reported for the past few days on the locations I tried based on the
Azure status history
Verified with Microsoft Azure Support and they confirmed this is a platform issue.
Update:
The issue is verified resolved after Microsoft resolved the platform issue related to Import Database.

Resources