Azure / LogicAppsUX

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

Logic App Standard Deployment Issue to Government Cloud - Cannot read properties of undefined (reading 'kind') #6039

Open StephenWThomas opened 2 weeks ago

StephenWThomas commented 2 weeks ago

Describe the Bug with repro steps

Deploying a Standard Logic App using VS Code does not work as expected when using the Azure Government Cloud.

Other items, like Azure Resources, work as expected using the Azure Government Cloud to view and create Azure Artifacts.

Changing the account to a non-government cloud results in a successful deployment.

This was tested on two new VS Code environments running Windows 10 and 11 with the same results.

  1. Sign into Azure Government Cloud inside VS Code
  2. Create a Standard Edition Logic App
  3. Navigate to Azure - Workspaces on the left toolbar
  4. Select the Logic App icon - Deploy to logic app…
  5. One of two errors is seen.

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

No

Workflow JSON

No response

Screenshots or Videos

No response

Browser

Latest version of VS Code

Additional context

No response

ccastrotrejo commented 2 weeks ago

Hi @StephenWThomas thanks for raising this issue.

I am taking a look at it right now. About the two issue

  1. Usually this happens when something is wrong with the remote logic app that its already in porta. Did you created this one in the portal or through the vscode?
  2. This issue got resolved in the following PR https://github.com/Azure/LogicAppsUX/pull/6014. This shouldn't affect the functionality of the extension, except for the Azure panel on the left toolbar. If you experience that your remote Logic Apps aren't loading properly, you should be able to see them correctly by clicking on the refresh icon on the top of the panel

Image

StephenWThomas commented 1 week ago

Both of the errors referenced above happen when I try to deploy a Logic App Standard created locally in VS Code to US Government Azure. When I get past the token issue, usually by signing in and out and opening and closing the VS Code, I get the kind error.

I can create workflows without issues in the portal and see them under Azure Resources.

To recap, as of now, I am unable to move the locally created Logic Apps into the US government cloud using VS Code. I do not have this issue deploying the same Logic Apps into the commercial cloud.

Thanks.

StephenWThomas commented 1 week ago

I tested this again tonight with the latest Function and C# extensions released today, and I'm still getting the same issue. I have tried deployment to 2 different Government Cloud instances using 2 separate accounts on different VMs, both with the same error.

Does the Logic App Standard Extension support deployment into the Azure US Government Cloud?

Error Message: The access token has been obtained for wrong audience or resource 'https://management.core.usgovcloudapi.net/'. It should exactly match with one of the allowed audiences 'https://management.core.windows.net/','https://management.core.windows.net','https://management.azure.com/','https://management.azure.com'.

ccastrotrejo commented 1 week ago

Hi @StephenWThomas yes we support deployment to non-public clouds. For this issue that you are experiencing this shouldn't affect the functionality of the extension, except for the Azure panel on the left toolbar. If you experience that your remote Logic Apps aren't loading properly, you should be able to see them correctly by clicking on the refresh icon on the top of the panel

StephenWThomas commented 1 week ago

Looking here: (https://learn.microsoft.com/en-us/azure/logic-apps/create-single-tenant-workflows-visual-studio-code#deploy-to-azure) It crashes with one of the two errors at step 2.

Note if I just switch accounts to a non-govenment cloud, it works just fine. Only when using US Government Cloud it doesn't work

All other areas of VS code seem to work fine, I can view items in the Government Cloud. I just can not deploy.

Below are the detailed steps I just ran.

Step 1 Image

Step 2 Image

Step 3 Image

Step 4 - Error Image

ccastrotrejo commented 1 week ago

Hi @StephenWThomas thanks for the detailed screenshots on this, now I am able to repro it. I will come up with a fix and let you know

ccastrotrejo commented 1 week ago

Hi @StephenWThomas we will be releasing a new version of the vscode extension today. Its the 4.107.4. Could you please give it a try?

StephenWThomas commented 1 week ago

I was not able to get it to work with the new extension.

I have tried on two different environments connecting to two different US Govenment Cloud accounts. Like before, I can view everything fine in Azure Resources. When I go to deploy, I get the same error in both places as shown below. It is a different error from before, though.

I should add that I signed out of Auzre, closed VS Code, and signed back in a few times to test it out with no luck.

The error is: EnvironmentCredential is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.

Image

ccastrotrejo commented 1 week ago

Hi @StephenWThomas could you please check if you have these settings properly configured accordingly to the cloud yo want to select to? Image

StephenWThomas commented 1 week ago

Yes, I have those set correctly in both of my separate environments, which both give the same error.
I even put together a post and video in case anyone else needs to update these: https://www.stephenwthomas.com/azure-integration-thoughts/configuring-us-government-cloud-in-visual-studio-code-for-developers/

Are there any other settings I'm missing?
VS Code was just updated a few days so, as well as C# and Funcations runtime. Those have any impacts?

ccastrotrejo commented 1 week ago

Alright, I just wanted to make sure this was properly set up. The error is coming from the Azure SDK for JavaScript, I don't really think this might be affecting it. But I am checking it.

StephenWThomas commented 6 days ago

Something else I should add, I just got this EvnionmentCredentail issue on another, non Govenment, system trying to deploy.

It did work a few weeks ago with this same code.

ccastrotrejo commented 5 days ago

@StephenWThomas ok ok, I am still looking around on what would be happening over here.

In the meantime, I suspect that the issue staterted on the 4.107.2 version of the extension Could you please try to install an older version? The steps are the follow: 1.- Right click in the extension 2.- Click in install specific version Image 3.- Install version 4.96.2 Image

StephenWThomas commented 5 days ago

I finally got it working in the government cloud!!!!

I created a new Workspace without custom code. I did a deployment using VS Code and it worked! Note this did not work last week due to the other issue you fixed Friday.

Then, I opened the other workspace with the .Net 8 custom code, and the deployment worked perfectly! I'll try again tomorrow without doing the first deployment and see if it still works.

It seems something just needed to be configured or set somewhere.
Maybe this is related to using .Net 8 custom code? I have had a lot of issues with it the past few weeks.

ccastrotrejo commented 5 days ago

@StephenWThomas Amazing!!! Yep, the fix that it was made on Friday was related to the credentials in Gov cloud. Despite the .NET 8 configuration, I am not aware of any specific settings, please if you find something let me know. Also, if you face any other issue let me know