Templates/DB.json

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "sqlServerPrimaryName": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The primary name of the SQL Server."
      }
    },
    "dbName": {
      "type": "string",
      "defaultValue": "db[UID]",
      "metadata": {
        "description": "The DB name."
      }
    },
    "dbEdition": {
      "type": "string",
      "defaultValue": "Basic",
      "allowedValues": [
        "Basic",
        "Standard",
        "Premium"
      ],
      "metadata": {
        "description": "The DB edition."
      }
    },
    "dbMaxSizeBytes": {
      "type": "string",
      "defaultValue": "1073741824",
      "metadata": {
        "description": "Max size of the DB in bytes."
      }
    },
    "dbCollation": {
      "type": "string",
      "defaultValue": "SQL_Latin1_General_CP1_CI_AS",
      "metadata": {
        "description": "The DB Collation method."
      }
    },
    "dbRequestedServiceObjectiveName": {
      "type": "string",
      "defaultValue": "Basic",
      "allowedValues": [
        "Basic",
        "S0",
        "S1",
        "S2",
        "P1",
        "P2",
        "P3"
      ],
      "metadata": {
        "description": "The DB requested service objective name."
      }
    },
    "dbSampleName": {
      "type": "string",
      "defaultValue": "",
      "allowedValues": [
        "",
        "AdventureWorksLT"
      ],
      "metadata": {
        "description": "The sample DB name (if none leave blank)."
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2017-10-01-preview",
      "type": "Microsoft.Sql/servers/databases",
      "name": "[concat(parameters('sqlServerPrimaryName'), '/', parameters('dbName'))]",
      "tags": {},
      "location": "[resourceGroup().location]",
      "properties": {
        "collation": "[parameters('dbCollation')]",
        "edition": "[parameters('dbEdition')]",
        "maxSizeBytes": "[parameters('dbMaxSizeBytes')]",
        "requestedServiceObjectiveName": "[parameters('dbRequestedServiceObjectiveName')]",
        "sampleName": "[parameters('dbSampleName')]"
      }
    }
  ],
  "outputs": {}
}