bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Bicep in VS Code won't display govcloud subscriptions

Open alaskascooter opened this issue 1 year ago • 10 comments

Bicep version 0.29.47

Describe the bug Either by right-clicking and selecting deploy bicep file, or by using the deployment pane, I am unable to select a subscription in any govcloud region. An alert appears in VS Code (bottom right) that states no subscriptions found.

To Reproduce Attempt to deploy bicep file to azure govcloud.

Additional context Spoke with an individual on the Azure Discord server who suggested it might be a wrong ARM call to "GET" the subscriptions and the appropriate error isn't presenting. Attempted at 5:45PM Eastern on 8/13/2024 for any log searching.

alaskascooter avatar Aug 13 '24 21:08 alaskascooter

I couldn't reproduce this issue. @alaskascooter, the Bicep VS Code extension relies on the Azure Account VS Code extension for authentication. Have you tried logging in and selecting a tenant ID using the following command? image

shenglol avatar Aug 21 '24 17:08 shenglol

Thanks for trying. When I try the method you suggest, this is the error I receive. Would this indicate that it is the azure component giving me issues? I am able to browse resources in the only subscription I am assigned to using the Azure Resource browser. image

Thanks again.

alaskascooter avatar Aug 21 '24 19:08 alaskascooter

Can you access the national cloud portal (e.g., https://portal.azure.us)?

shenglol avatar Aug 21 '24 20:08 shenglol

Yes, clicking on that link I am taken to my portal home screen for azure gov and can see all my resources.

alaskascooter avatar Aug 21 '24 22:08 alaskascooter

It seems this might be a bug in the Azure Account VS Code extension. I recommend trying to run Azure: Sign Out and then Azure: Sign In to Azure Cloud to see if that resolves the issue.

If it still doesn't work, it might be worth reporting the issue at https://github.com/microsoft/vscode-azure-account/issues.

shenglol avatar Aug 21 '24 22:08 shenglol

Thanks, I've attempted that a few times now. I'll jump over there and see what they can do for us.

Thank you

alaskascooter avatar Aug 22 '24 13:08 alaskascooter

FYI, their troubleshooting page provided some steps required before posting an issue related to logins. It appears to have fixed it. Specifically, I think it was clearing the tenant id from cache and then reauthenticating, selecting the tenant, and then subscriptions. Now the Bicep deployment panel allows me to see all the resource groups within my subscription.

edit However, Bicep does allow me to see and select the subscription and RG, but when I attempt to deploy, it then says SubscriptionNotFound despite it being in the Deployment Scope window having been selected.

I will attempt via cli.

alaskascooter avatar Aug 22 '24 14:08 alaskascooter

it then says SubscriptionNotFound despite it being in the Deployment Scope window having been selected

Could you share a screenshot of the error? I'm trying to determine whether it's an issue with ARM or something on the client side.

shenglol avatar Aug 28 '24 20:08 shenglol

Here is the error within the bicep pane: image

And the Deployment Scope section: image

ok, this is weird. I just tried using the right-click deploy bicep in the cli and it ran. No errors. Well, it had errors, but now it's my actual code that is wrong, not the fact that it couldn't find the subscription.

I'm going to do some more troubleshooting and restarts. I'm also setting up a system outside the company network to see if it's something with corporate firewall tomfoolery.

alaskascooter avatar Aug 28 '24 20:08 alaskascooter

Sounds like this is a bug in deployment pane then. I'll take a deeper look into the root cause.

shenglol avatar Aug 29 '24 00:08 shenglol

I see this behavior, too.

StephenWeatherford avatar Oct 30 '24 20:10 StephenWeatherford

@shenglol Removing "Investigate", this is definitely a bug, I think it's an issue communicating the correct subscription and/or authentication details to the webview.

StephenWeatherford avatar Nov 18 '24 18:11 StephenWeatherford