Access Azure Government with VS Code Azure Extension

Here are the steps to access Azure Government resources from VS Code. If you experience issues even after setting these setting I’d recommend capturing a Fiddler trace to inspect the URLs being accessed.

Starting sometime late 2023 or early 2024 the Azure Resources Extension requires an additional setting to authenticate with Azure Gov. Based on the discussion in this Github link this will eventually be the default config for all other extensions to use.

1.  Search settings in the search bar at the top of VS Code
 


2. Add the value below to the settings file
“microsoft-sovereign-cloud.environment”:”USGovernment”,

https://github.com/microsoft/vscode-azureresourcegroups?tab=readme-ov-file#using-sovereign-clouds

https://github.com/microsoft/vscode-azureresourcegroups/issues/817


For all other Azure Extensions in the meantime this is the method to configure auth.

1. Open VS Code and Press Ctrl-Shift-P to pull up the command pallet and search for Sign In to Azure Cloud

2. Select the respective cloud (in this case Azure US Government 

3. Once logged in you should see your resources: