Cannot change account used to deploy Bicep files
Bicep version 0.33.93
Describe the bug A clear and concise description of what the bug is vs what you expected to happen
To Reproduce
- Deploy a Bicep file and authenticate, it fails
- Realize you did it with your non-admin account
- Open a bug and try "right click on the extension and choose "Account Preferences""
- Still doesn't work.
- Open this bug as well since now it seems the extension is not respecting the VSCode setting.
Additional context Initial report and more detailed writeup here: https://github.com/microsoft/vscode/issues/243220
@jons-bakerhill Sorry for your frustration, it's fully warranted. It's been confusing on our end, too, too many cooks.
The documentation for Bicep deployment is here (although it's not much, although it is supposed to be mentioning the Accounts icon in the side bar, not sure why that got left out): https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-vscode
First let's make sure you're able to succeed in deploying, then we can discuss improvements in experience and docs.
The options for extensions were somewhat limited when we needed to switch over, and multiple accounts weren't really supported. But you should be able to deploy to another account by signing out of your current account first. Click in the lower-left corner on the account icon to log out of an account:
Then try deploying again. You should see this:
Click allow and sign in to your other account. You should be able to deploy to the other account now.
If you have multiple tenants, you may need to install the "Azure Resources" extension and open the Azure toolbox from the sidebar to choose a tenant.
@alexweininger It looks like the multi-account support has improved in the Resource extension. Do you have guidelines as to how I can make the experience better in Bicep?
@jons-bakerhill Where would you be able to find these instructions?
That worked, although I had already gotten it to work with the az powershell command in the interim. I remember seeing the documentation you linked above so that would be one place I could find the instructions (https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-vscode). There are also a few links I put in a comment on the VSCode bug report that I think would be reasonable places to at least have pointers to how things are supposed to work now https://github.com/microsoft/vscode/issues/243220#issuecomment-2715634682
I'm on Cursor so I don't have that user icon on the bottom left. But honestly this is just way too vague and frustrating. I have just literally logged out of Azure on THREE different places WITHIN cursor (CLI, Azure through CTRL + Shift + P and some other extension I think Azure Resources on the left). And guess what, three unique locations to logout of the same account is not enough to actually log out of the account for Bicep to request a new login or use the account I actually want to use.
Stuff like this is such a waste of time and hugely frustrating.
I "Fixed" it for now is by finally switching back to VSCode JUST to deploy some dev Bicep file and then go back to Cursor...