0

I have an ARM template that deploys API's to an API Management instance

Here is an example of one API

{
  "properties": {
    "authenticationSettings": {
      "subscriptionKeyRequired": false
    },
    "subscriptionKeyParameterNames": {
      "header": "Ocp-Apim-Subscription-Key",
      "query": "subscription-key"
    },
    "apiRevision": "1",
    "isCurrent": true,
    "subscriptionRequired": true,
    "displayName": "DDD.CRM.PostLeadRequest",
    "serviceUrl": "https://test1/api/FuncCreateLead?code=XXXXXXXXXX",
    "path": "CRMAPI/PostLeadRequest",
    "protocols": [
      "https"
    ]
  },
  "name": "[concat(variables('ApimServiceName'), '/mms-crm-postleadrequest')]",
  "type": "Microsoft.ApiManagement/service/apis",
  "apiVersion": "2019-01-01",
  "dependsOn": []
}

When I am deploying this to different environments I would like to be able to substitute the service url depending on the environment. I'm wondering the best approach?

Can I read in a config file or something like that?

At the time of deployment I have a variable that tells me the environment so I can base decisions on that. Just not sure the best way to do it

David
  • 1,203
  • 6
  • 25
  • 48

1 Answers1

1

See about ARM template parameters: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates#parameters They can be specified in a separate file. So you will have single template, but environment specific parameter files.

Vitaliy Kurokhtin
  • 7,205
  • 1
  • 19
  • 18