[Issue] `azd show` reports app not provisioned when it actually is
I run azd show on an app that has been provisioned and I get this:
I looked through the azd code and it looks like it will return this message if it can't find the subid or rgName in the env.
I do see those values in my current env .env file, so not sure why I'm getting the error.
You should be able to repro by running azd provision and then azd show
Hi, @jongio - We used a repo that already supports azd for testing. After executing azd provision, the error cannot be reproduced by executing azd show (provided that we have not deleted any parameters in the .azure/<env_name>/.env file).
I looked through the azd code and it looks like it will return this message if it can't find the subid or rgName in the env.
We also tried this. Since there is no rgName parameter in our .env file, we just remove the subid and then executed azd show, which can reproduce the error.
As far as I know, AZURE_SUBSCRIPTION_ID is automatically set in the .env file after the user executes azd provision and selects sub. (At the same time, the other two parameters AZURE_LOCATION and AZURE_ENV_NAME will also be set). So normally the AZURE_SUBSCRIPTION_ID parameter should exist. I'm not sure if it's reasonable for us to manually remove it (or in what scenario is it not set)?
Since resource group or even service with the same name can be created in different subs, I think subid is used to determine uniqueness. But at present, it seems that this error message: Application is not yet provisioned appears after provisioning is indeed a problem. Maybe we can optimize the error message after not finding the subid but finding the relevant parameters of other services? (just my thoughts)
Tested repo: todo-csharp-sql
azd version 1.7.0 (commit 49d6adc2efb178083f61822e6b4715258560803d)
I discovered that there was a provisioning problem. Can you do this:
- Provision the application successfully.
- Get the template in a state where provisoining will fail. For example, Update the bicep file to have a syntax error.
- Then call
azd show. to see if the above message appears
That will tell us if we get that generic message when AZD provisioning has a problem, and we can maybe improve that error message.
@jongio - We tried this and the results were surprising, there is no expected error message:
Steps to repro:
-
azd provision(succeed) - Updated
main.bicepto have a syntax error. -
azd provision(fail) -
azd show(without error message)
Can you please try it with https://github.com/jongio/hello-ai and see if you can figure out why it doesn't show the portal link?