Andrew Hill
Andrew Hill

Reputation: 2020

how to deploy an azure ARM template without changing existing sku

I am looking for a way to create, but not update, the SKU of a PaaS sql server when deployed by ARM templat, however all other changes in the template are still wanted to be deployed.

I have an ARM template representing my current infrastructure stack, which is deployed as part of our CI. One of the things specified in the file is the size scale of our PaaS database, eg:

"sku": {
   "name": "BC_Gen4",
   "tier": "BusinessCritical",
   "family": "Gen4",
   "capacity": 2
}

Because of a temporary high workload, i have scaled the number of cpu's up to 4 (or even 8). Is there any way i can deploy the template which doesn't forcibly down-scale my database back to the specified sku?

resources.azure.com shows that there are other attributes that relate to scaling. Ideally this would be set to something like 'if this resource doesn't exist then set it to X, otherwise use the existing currentServiceObjectiveName/currentSku'

"kind": "v12.0,user,vcore",
"properties": {
  "currentServiceObjectiveName": "BC_Gen4_2",
  "requestedServiceObjectiveName": "BC_Gen4_2",
  "currentSku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  }
}

At the moment our infrastructure is deployed via VSTS Azure Resource Group Deployment V2.* in 'create or update resource group, complete' mode.

Upvotes: 0

Views: 418

Answers (1)

4c74356b41
4c74356b41

Reputation: 72151

This is not possible in arm templates, you have to use external source to make that decision, not arm template. and you cannot really pull data in the arm template, so you probably need to pull the SKU externally and pass it to the template

Upvotes: 1

Related Questions