azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

In ”az logic workflow create”, cannot create API connection copied from existing workflow created from "az logic workflow show"

Open nobuko-yamada opened this issue 3 years ago • 12 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

In order to copy the existing workflow, I tried to use "az logic workflow show" and "az logic workflow create". "az logic workflow show" succeed. But when use "az logic workflow create". there is an error message.

(ApiConnectionNotFound) The API connection 'office365' could not be found.
Code: ApiConnectionNotFound
Message: The API connection 'office365' could not be found.

Describe the bug

To Reproduce

I ran commands below: az logic workflow show --name testapps005 --resource-group playground-eastjapan > workflow.json az logic workflow create --resource-group "playground-eastjapan" --location "japaneast" --name "test_workflow" --definition "workflow.json"

workflow is

{
  "accessControl": null,
  "accessEndpoint": "https://prod-19.centralus.logic.azure.com:443/workflows/553dd07bec45430aa0014edeea631ebd",
  "changedTime": "2022-11-30T02:07:23.151148+00:00",
  "createdTime": "2022-11-27T23:31:44.168313+00:00",
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {
      "メールの送信_(V2)": {
        "inputs": {
          "body": {
            "Body": "<p><br>\n@{variables('main')}</p>",
            "Importance": "Normal",
            "Subject": "件名",
            "To": ""
          },
          "host": {
            "connection": {
              "name": "@parameters('$connections')['office365']['connectionId']"
            }
          },
          "method": "post",
          "path": "/v2/Mail"
        },
        "runAfter": {
          "変数を初期化する": [
            "Succeeded"
          ]
        },
        "type": "ApiConnection"
      },
      "変数を初期化する": {
        "inputs": {
          "variables": [
            {
              "name": "main",
              "type": "string",
              "value": "Hello world"
            }
          ]
        },
        "runAfter": {},
        "type": "InitializeVariable"
      }
    },
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "parameters": {
      "$connections": {
        "defaultValue": {},
        "type": "Object"
      }
    },
    "triggers": {
      "manual": {
        "inputs": {
          "schema": {}
        },
        "kind": "Http",
        "type": "Request"
      }
    }
  },
  "endpointsConfiguration": {
    "connector": {
      "accessEndpointIpAddresses": null,
      "outgoingIpAddresses": [
        {
          "address": "52.173.241.27"
        },
        {
          "address": "52.173.245.164"
        },
        {
          "address": "13.89.171.80/28"
        },
        {
          "address": "13.89.178.64/27"
        },
        {
          "address": "40.77.68.110"
        },
        {
          "address": "20.98.144.224/27"
        },
        {
          "address": "20.98.145.0/28"
        },
        {
          "address": "20.80.123.134"
        },
        {
          "address": "20.80.123.57"
        }
      ]
    },
    "workflow": {
      "accessEndpointIpAddresses": [
        {
          "address": "13.67.236.76"
        },
        {
          "address": "40.77.111.254"
        },
        {
          "address": "40.77.31.87"
        },
        {
          "address": "104.43.243.39"
        },
        {
          "address": "13.86.98.126"
        },
        {
          "address": "20.109.202.37"
        }
      ],
      "outgoingIpAddresses": [
        {
          "address": "13.67.236.125"
        },
        {
          "address": "104.208.25.27"
        },
        {
          "address": "40.122.170.198"
        },
        {
          "address": "40.113.218.230"
        },
        {
          "address": "23.100.86.139"
        },
        {
          "address": "23.100.87.24"
        },
        {
          "address": "23.100.87.56"
        },
        {
          "address": "23.100.82.16"
        },
        {
          "address": "52.141.221.6"
        },
        {
          "address": "52.141.218.55"
        },
        {
          "address": "20.109.202.36"
        },
        {
          "address": "20.109.202.29"
        }
      ]
    }
  },
  "id": "/subscriptions/64802ffd-86e1-4902-95e3-3741e722750c/resourceGroups/playground-eastjapan/providers/Microsoft.Logic/workflows/testapps005",
  "integrationAccount": null,
  "integrationServiceEnvironment": null,
  "location": "centralus",
  "name": "testapps005",
  "parameters": {
    "$connections": {
      "description": null,
      "metadata": null,
      "type": null,
      "value": {
        "office365": {
          "connectionId": "/subscriptions/64802ffd-86e1-4902-95e3-3741e722750c/resourceGroups/playground-eastjapan/providers/Microsoft.Web/connections/office365",
          "connectionName": "office365",
          "id": "/subscriptions/64802ffd-86e1-4902-95e3-3741e722750c/providers/Microsoft.Web/locations/centralus/managedApis/office365"
        }
      }
    }
  },
  "provisioningState": "Succeeded",
  "resourceGroup": "playground-eastjapan",
  "sku": null,
  "state": "Disabled",
  "tags": null,
  "type": "Microsoft.Logic/workflows",
  "version": "08585318328423311969"
}

Expected behavior

success to copy the existing workflow.

Environment summary

C:\Users\nobukoyamada>az version { "azure-cli": "2.42.0", "azure-cli-core": "2.42.0", "azure-cli-telemetry": "1.0.8", "extensions": { "logic": "0.1.6" } }

Additional context

nobuko-yamada avatar Dec 21 '22 04:12 nobuko-yamada

route to CXP team

yonzhan avatar Dec 21 '22 05:12 yonzhan

@nobuko-yamada Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT avatar Dec 21 '22 05:12 navba-MSFT

@nobuko-yamada Could you please run the same command again with --debug switch and share the detailed output with me ?

PS: Remove sensitive information from the output before sharing.

navba-MSFT avatar Dec 21 '22 08:12 navba-MSFT

debug.txt @navba-MSFT

nobuko-yamada avatar Dec 21 '22 09:12 nobuko-yamada

@nobuko-yamada Thanks for sharing the debug logs.

Action Plan: Could you please ensure that the API connections is in the same region (location)as your Logic App ? So while running the az logic workflow create command provide the --location in the same region as that of your Logic App connection API and check if that helps.

navba-MSFT avatar Dec 22 '22 07:12 navba-MSFT

@nobuko-yamada I wanted to do quick follow-up to check if you had a chance to look at my above comment. Please let us know if you had any updates on this. Awaiting your reply.

navba-MSFT avatar Dec 26 '22 04:12 navba-MSFT

@navba-MSFT Thank you very much for your investigation! I understand when we use the location "centralus", it succeed. But I hope we can use these command for copying the workflow. And basically Japanese user uses Japan* location. This is current situation:

API is located in Central US because it is coming from office365 connector. Logic Apps is located in JapanEast (because of Japanese user) I hope there will be workaround. Thank you very much again!

nobuko-yamada avatar Dec 27 '22 12:12 nobuko-yamada

@nobuko-yamada Thanks for getting back. I am glad that the workaround succeeds. To have a permanent solution for this ask, this might require a closer troubleshooting. May I know if it is feasible for you to open a support ticket with Microsoft Support ?

navba-MSFT avatar Dec 27 '22 12:12 navba-MSFT

@nobuko-yamada I wanted to do quick follow-up to check if you had a chance to look at my above comment. Please let us know if you had any updates on this. Awaiting your reply.

navba-MSFT avatar Jan 02 '23 03:01 navba-MSFT

Sorry about the late reply! Actually this topic was came from our customer's support request (and I'm working as support engineer you can find me as "nobukoyamada" of alias) If you need any details could you reach me?

nobuko-yamada avatar Jan 02 '23 20:01 nobuko-yamada

@nobuko-yamada Since You are internal to MS, I have pinged you over Teams.

navba-MSFT avatar Jan 03 '23 04:01 navba-MSFT

Closing this thread since the LogicApp PG is involved internally over icm.

navba-MSFT avatar Jan 05 '23 08:01 navba-MSFT