0
votes

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.

1
just a thought that crossed my mind, you might be able to pull the current sku using reference(xx,xx,'full'), but you would need a nested template (i believe) to make it work4c74356b41
"The reference function derives its value from a runtime state, and therefore can't be used in the variables section. It can be used in outputs section of a template or linked template. It can't be used in the outputs section of a nested template. To return the values for a deployed resource in a nested template, convert your nested template to a linked template." -- docs.microsoft.com/en-us/azure/azure-resource-manager/…. Thanks @4c74356b41 looks like use of the reference function may be a way forward (using linked templates)Andrew Hill
yeah, you wouldnt be able to do that without them4c74356b41

1 Answers

1
votes

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