Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az logic workflow create cmd does not pass in the parameters from the workflowdefinition.json Definition File #27982

Closed
starkfell opened this issue Dec 7, 2023 · 2 comments · Fixed by Azure/azure-cli-extensions#7132
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Logic App az logic Service Attention This issue is responsible by Azure service team.

Comments

@starkfell
Copy link

Describe the bug

Description

When attempting to pass in parameters from a workflowdefinition.json Definition File to the az logic workflow create command, the parameters are not applied to the Logic App.

When these parameters are not applied, any associated API Connection(s) in the Logic App do not appear which causes any Logic App task that depends on these associations to fail.

The error that will typically appear in the Azure Portal in the Logic app designer view is Connector not found.


Additional Notes

The issue describe above appears to be related to the existing issue: #22071

Related command

The commands below require the use of azure-cli logic extension. From the troubleshooting I've already done, it appears the root cause maybe in the extension.

az logic workflow create
az logic workflow update

Errors

No Error messaging or failures are returned.

Issue script & Debug output

Debug output has been added under the Environment Summary.

Expected behavior

The parameters that are passed in from the workflowdefinition.json Definition File should be applied to the target Logic App.

An example of the parameters being passed in are shown below:

    "parameters": {
        "$connections": {
            "value": {
                "api-azblob": {
                    "connectionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-example/providers/Microsoft.Web/connections/api-azblob",
                    "connectionName": "api-azblob",
                    "connectionProperties": {
                        "authentication": {
                            "type": "ManagedServiceIdentity"
                        }
                    },
                    "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westeurope/managedApis/azureblob"
                },
                "api-azqueues": {
                    "connectionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-example/providers/Microsoft.Web/connections/api-azqueues",
                    "connectionName": "api-azqueues",
                    "connectionProperties": {
                        "authentication": {
                            "type": "ManagedServiceIdentity"
                        }
                    },
                    "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westeurope/managedApis/azurequeues"
                }
            }
        }
    }

When these parameters are passed in as part of the workflowdefinition.json Definition File, they should appear in the targeted Logic App in the Azure Portal under the Development Tools Blade in the Logic App code review section.

Environment Summary

This issue occurs when using azure-cli version 2.54.0 or higher and extension logic version 1.0.0.

{
  "azure-cli": "2.55.0",
  "azure-cli-core": "2.55.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "logic": "1.0.0"
  }
}

When this az logic workflow create command is ran with the --debug switch, the parameters in the Definition File never make it to the Request body of the API Call.

cli.azure.cli.core.sdk.policies: Request method: 'PUT'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'Content-Length': '5158'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '00000000-0000-0000-0000-000000000000'
cli.azure.cli.core.sdk.policies:     'CommandName': 'logic workflow create'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--name --resource-group --definition --state --location --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.55.0 (DEB) (AAZ) azsdk-python-core/1.26.0 Python/3.11.5 (Linux-5.15.0-88-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"location": "westeurope", "properties": {"definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "contentVersion": "1.0.0.0", "parameters": {"$connections": {"defaultValue": {}, "type": "Object"}}, "triggers": {REST_REMOVED_DUE_TO_SENSITIVE_CONTENT}, "state": "Enabled"}}
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-example/providers/Microsoft.Logic/workflows/logic-app-workflow?api-version=2019-05-01 HTTP/1.1" 200 None

Additional context

This issue does not occur when using azure-cli version 2.53.0 and extension logic version 0.1.7.

The parameters that are passed in as part of the workflowdefinition.json Definition File, appear as intended in the targeted Logic App in the Azure Portal under the Development Tools Blade in the Logic App code review section.

{
  "azure-cli": "2.53.0",
  "azure-cli-core": "2.53.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "logic": "0.1.7",
  }
}
@starkfell starkfell added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 7, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 7, 2023

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

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Logic App az logic Service Attention This issue is responsible by Azure service team. labels Dec 7, 2023
@jsntcy
Copy link
Member

jsntcy commented Dec 14, 2023

@Jing-song, please help take a look at this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Logic App az logic Service Attention This issue is responsible by Azure service team.
Projects
None yet
4 participants