-
Notifications
You must be signed in to change notification settings - Fork 779
Bicep for Visual Studio cannot load modules from ACR after upgrading to Azure CLI 2.61 #14246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We are still investigating the root cause. Workaround is to use command line for building. |
Is there any update on this? |
@CloudCees Sorry, it's been hard getting time for it. Is this affecting you badly? |
We experience this occasionally, and it happened this time as well. After a few tries with |
@CloudCees Please note, this bug is referring to Visual Studio, not Visual Studio Code. If you're seeing problems in Visual Studio Code, please enter a new bug with repro steps. Thanks! @dozer75 Is this still affecting you? Thanks. |
Yes it still does, however it seems to work partially... I have 4 modules in my bicep, but 2 of them fails while 2 works... To reproduce this now I deleted the .bicep/br folder before I started Visual Studio. Otherwise I followed the steps described. |
This is quite confusing. Bicep uses AzureCliCredential, which makes a call to "az account get-access-token --output json --resource https://management.azure.com", which in turn calls into python via az.cmd: ..\python.exe -IBm azure.cli az account get-access-token --output json --resource https://management.azure.com python seems to take an inordinate amount of time starting up (but not when I run this from command line, only from within VS). From procmon: During the 1.5 min wait (it varies, sometimes it's much faster, sometimes even slower), there is no logging info from az, so I don't think the python code has even started running. Here's the start of the logging I get from az (starting at 14:56:25): So I don't think it's anything that az is doing (like waiting for user input). Currently AzureCliCredential has a timeout on waiting for az's get-access-token of 18 seconds. I can increase that to, say, 2 min, but it doesn't seem even that's guaranteed. |
From both "az bicep restore" CLI and vscode, the delay from starting python and the code running is only 1-2 seconds. |
|
Don't think it's waiting for user input because it generally succeeds after a while. Not a run-in-parallel issue like Azure/azure-sdk-for-net#27722 because it repros with only a single restore. Admin settings won't let me turn off Defender real-time to see if antivirus is the issue. Don't think it's Azure/azure-sdk-for-net#32993 because it does work after a random amount of time. Doesn't repro if I change az.cmd to call python as the argument to tee. Changing python's process priority doesn't change anything. Haven't tried downgrading to Az CLI < 2.61. Using CLI 2.71.0, python 3.12.8. |
It does seem pretty consistent that it does succeed, even if it's long. Longest I've seen so far is 160s (2.7min). I hate increasing timeout for that long if it's inconsistent and is timing out because the process is blocking on something, but since it seems consistent, I'll go ahead and increase to 3 or 4 minutes. |
Bicep version
az bicep version 0.28.1
Bicep for Visual Studio version 0.28.1.47646
azure CLI 2.61
Describe the bug
Visual Studio fails to load modules from ACR based registries. It gets the exception:
I suspect that this is due to the new (horrible) az login experience Azure CLI 2.61 implemented which requires UI based authentication.
To Reproduce
Steps to reproduce the behavior:
After a short period of time, the error will occur.
Additional context
Running
az bicep restore -file <file>.bicep
works.The text was updated successfully, but these errors were encountered: