azure-devopsazure-pipelinesazure-logic-appsazure-logic-app-standard

How to update parameters.json file in logic app standard


I have deployed the Logic App standard using the Bicep template and I am able to deploy the workflows by download it from portal zip and deploying it using the function app deployment task using azure devops I am facing issue in updating the parameters.json file whose value has to be updated according to the environment.

Is there a way to update the parameters.json like we do in appsettings.json for function app deployment?

For example: my connection.json has function app connection string:

"azureFunctionOperation-1": {
    "function": {
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/@{parameters('azureFunctionOperation-1-ResourceGroup')}/providers/Microsoft.Web/sites/@{parameters('azureFunctionOperation-1-SiteName')}/functions/Get-Dummy"
    },
    "triggerUrl": "@parameters('azureFunctionOperation-1-TriggerUrl')",
    "authentication": {
        "type": "QueryString",
        "name": "Code",
        "value": "@appsetting('azureFunctionOperation_11_functionAppKey')"
    },
    "displayName": "Get"
}

and parameter.json has value which is environment specific:

{
    "azureFunctionOperation-1-ResourceGroup": {
        "type": "String",
        "value": "dev-rg"
    },
    "azureFunctionOperation-1-SiteName": {
        "type": "String",
        "value": "get-dev"
    },
    "azureFunctionOperation-1-TriggerUrl": {
        "type": "String",
        "value": "https://get-dev-gafmfdafbsbzgda5.westeurope-01.azurewebsites.net/api/get-dummy"
    }
}

Is there a better way to manage these settings, or any command to update the parameters.json only?

I tried looking for way to update through the Bicep, but I found it only for consumption based


Solution

  • I started using the ADO Task of Microsoft which will replace the JSON values in the zip file

    steps:
    - task: FileTransform@2
      displayName: 'File Transform: '
      inputs:
        enableXmlTransform: false
        jsonTargetFiles: parameters.json