Conversation
| azCred, err = azidentity.NewAzureCLICredential(nil) | ||
| if err == nil { | ||
| // check token generation | ||
| _, err = azCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{"https://management.core.windows.net//.default"}}) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Ah, I'm reading the error message from the original issue more carefully now, and it suggests that the issue was that the az CLI wasn't found on the path. So what you're doing here is checking that we can auth using that method, and if not, falling through to environment variables. I see! I still think we may want to use a ChainedTokenCredential instead, so that the Azure SDK will go through all the auth options for us if one fails.
There was a problem hiding this comment.
@amanenk I also made an attempted fix here, using the default credential chain: cloudquery/cloudquery#1283
Let's chat about how we want to proceed: perhaps we can release your fix as a release here (the final one to be released on this repo), and the default credential one only on the monorepo, since that's also a breaking change.
Summary
closes cloudquery/cloudquery#1221
Use the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)go run ./docs/docs.goand committing the changes 📃