azure-dev: "Azd init" failed for todo-java-postgresql-terraform on CodeSpace
Describe the issue:
Authentication failed for todo-java-postgresql-terraform when run azd init
The error message as follows:
Repro steps:
- Run
azd auth login
- Run
azd init -t todo-java-postgresql-terraform
Environment: OS: CodeSpace in VS Code. Template: https://github.com/Azure-Samples/todo-java-postgresql-terraform Azd version: 0.9.0-beta.2-daily.2772915 (commit https://github.com/Azure/azure-dev/commit/08ff66607eb70b25d189aefce0d21070fe84630d)
Expected behavior:
Run command azd init -t todo-java-postgresql-terraform
success.
@rajeshkamal5050 for notification.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 26 (24 by maintainers)
Repo is now public and codespaces can be created from it
@v-xuto , I created this PR: https://github.com/Azure/azure-dev/pull/2597
This should push a new version for https://github.com/Azure-Samples/todo-java-postgresql-terraform (on stagging branch) which you can test
Thanks @vhvb1989 , we don’t have any terraform templates out of azure-dev.
Could you pls help to apply the modifications on https://github.com/Azure/azure-dev/blob/main/templates/common/.github/workflows/java/terraform/azure-dev.yml in your PR, I think it may no need for me to create a new PR to fix this.
@fangjian0423 , you need to make sure that
az
andazd
are both using the same subscription/account.Looking at the error you are getting,
az
is using the sub:I don’t recognize this sub-id.
Run
az account show
to see more about that subscription. (az sets the subscription/account when you log in). Then runaz account set --subscription xxxxxx-xxxxxx-xxx
to match the same sub thatazd
is using. That should resolve this issue.@v-xuto I created a PR https://github.com/Azure/azure-dev/pull/2556 to update java-postgresql template, could you please help to test it, thanks!
Before you test it, I have a question about all the terraform templates. I notice that https://github.com/Azure/azure-dev/pull/2034 disable basic auth, and the pipeline runs successful in my postgresql update PR, but the templates run failed in my local or GHA action.
Did I miss something (When I remove the code of basic auth in my local, it runs successful)?
sure, we will continue work on them @rajeshkamal5050
@fangjian0423 @yiliuTo before making the repo public and make it work for CodeSpaces.
For any help with testing or making adjustments w.r.t to GHA action and Azd DevContainer feature. You can work with @v-xuto