New auth code doesn't work if multiple accounts are signed in or you sign in to an account with access to multiple tenants.
https://github.com/microsoft/vscode-azuretools/issues/1809 affects the new code for https://github.com/Azure/bicep/issues/14101, which should ship in December. If the bug isn't fixed before we ship, may need to work around it (I think I can at least detect the issue and ask them to sign out of one of them).
Need to verify and also update the required vscode version.
Will need to add code on our side for the moment to allow a user to select a tenant to sign into if we can't find subscriptions. Also need a couple of fixes from the azext authors.
Work-around:
If you run into the error “No subscriptions found.” In the output window, please let me know, and then try this work-around: Install the “Azure Resources” extension, go to the Azure view, and see if it “Sign in to Directory…”. If so, click it and follow instructions. Bicep deploy should then work.
TL;DR
In the next Bicep release (due very soon), I've changed our Azure authentication code for the Deploy Bicep File… menu inside VS Code so that it no longer depends on the Azure Account extension (see https://github.com/Azure/bicep/issues/14101), and instead uses VSCode’s authentication mechanism. This change affects deployment inside VS Code only, and does not affect the CLI or module restoration, nor does it fix the issue with VisualStudioCode credentials in bicepconfig.json).
All previous scenarios seem to be working fine, but I have seen some problems when signed in to multiple accounts (this wasn’t possible with the previous code, but is now via Azure: Sign In (azureResourceGroups.login) command) and when users have access to multiple tenants.
@maskati, can you let us know if you have seen this?
@puicchan I have not seen this recently.