Azure/azure-cli-extensions

az logic workflow create/update removes existing parameters

NathZ1 opened this issue · 2 comments

Describe the bug

I am using terraform (azurerm provider) to create Azure Logic App resources. These have configured parameters for API connections that are used within the Logic Apps. I then have a separate repo where the definitions are kept, and use Azure CLI to update them as part of my deployment pipeline.

What I am finding is that whenever I update the Logic Apps via the Azure CLI (az logic workflow create/update), it updates the definition as expected, however it replaces the template object with {}. As the template object state is initially created and managed by terraform, I need this to be retained after the update.

I thought I could just remove the parameters object from JSON definition that is used, but that didn't work... -

{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {...},
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "parameters": {
      "$connections": {
        "defaultValue": {},
        "type": "Object"
      }
    },
    "triggers": {...}
    }
  }, 
////removed the "parameters" object from here
}

This may be my lack of understanding, but is there a way to retain this when passing updated definition to retain the parameters?

Related command

az logic workflow create/update

Errors

No error, but not expected functionality

Issue script & Debug output

.

Expected behavior

parameters is retained after update of definitions

Environment Summary

azure-cli: 2.56
azure-extensions: 1.1.0

Additional context

No response

Thank you for opening this issue, we will look into it.

any update on this @yonzhan? In addition to the above, I have also noticed that existing resource Tags are removed as well which is an added annoyance!