1

Deployments of our ARM (Azure Resource Manager) templates are performed in "Complete" mode, which sets resources as well as removes them.

One of our templates declares a Microsoft.Sql/servers/ instance. An initial complete ARM deployment will create the PaaS (Platform-as-a-Service) Microsoft SQL Server instance without issue. Subsequent complete ARM deployments error out with:

  • Code 40636
  • Message Cannot use reserved database name 'master' in this operation
  • Status Code Bad Request
  • Operation Name Delete SQL Database

It appears that subsequent deployments will attempt to delete the master database if it's not specified in the ARM template. None of the Azure Quickstart Templates demonstrate how to do this. The https://resources.azure.com/ website lists the master database as a resource, but the JSON blob doesn't work.

Dustin Venegas
  • 760
  • 1
  • 7
  • 16

1 Answers1

1

The correct way to specify the master database as a resource for Complete deployments is:

{
  "type": "databases",
  "kind": "v12.0,system",
  "name": "master",
  "location": "[resourceGroup().location]",
  "apiVersion": "2014-04-01-preview",
  "properties": {},
  "resources": [],
  "dependsOn": [
    "[concat('Microsoft.Sql/servers/', variables('sqlserverName'))]"
  ]
}
Dustin Venegas
  • 760
  • 1
  • 7
  • 16