Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
77 stars 84 forks source link

Unable to save logic app in VSCode #5636

Open zzznz27 opened 2 months ago

zzznz27 commented 2 months ago

Describe the Bug with repro steps

  1. Open logic app workflow in designer
  2. After having it open for around 2 hours the auth token will expire
  3. Changes can still be made but saving does not update workflow.json
  4. Observe no warnings or notification saving failed and no way to prevent changes from being lost

What type of Logic App Is this happening in?

Standard (VSCode)

Which operating system are you using?

Windows

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

No response

Screenshots or Videos

No response

Browser

VSCode

Additional context

No response

ccastrotrejo commented 2 months ago

Hi @zzznz27 thanks for raising this issue. Here are some questions and keynotes to better understand the issue:

zzznz27 commented 2 months ago

Sorry i had meant to come back and add more context when it occurred again but forgot.

When i hit save on an expired session it seems to call all the managed connectors metadata (possibly as a validation step) before saving but if the auth token has expired i get back a 401. See below:

Here is an example of the calls failing image

Call made when hitting save

Request URL: https://management.azure.com//subscriptions/<SubscriptionId>/providers/Microsoft.Web/locations/australiaeast/managedApis/commondataservice?api-version=2018-07-01-preview
Request Method: GET
Status Code: 401 Unauthorized
Remote Address: 4.150.240.10:443
Referrer Policy: strict-origin-when-cross-origin

Response

{
    "error": {
        "code": "ExpiredAuthenticationToken",
        "message": "The access token expiry UTC time '9/23/2024 8:04:31 AM' is earlier than current UTC time '9/23/2024 11:23:34 PM'."
    }
}

Hitting save multiple times results in the same calls being made and failing I have also tired re authenticating with AZ accounts and that does not fix the issue

As far as i can tell there is no way to update this authentication to force a save while in this state and any progress made is lost.

If no managed connectors are present then the issue does not appear

MrRosendahl commented 2 weeks ago

A possible feature request, which would be very helpful in Visual Studio Code when using connection keys would be a command to refresh the local connectionkeys. For example: CTRL + SHIFT + P "Azure Logic Apps: Refresh local connectionkeys" which would force an update of the connectionkeys in local.settings.json (if there is a local.settings.json present, otherwise a warning, local.settings.json was not found)