-
Notifications
You must be signed in to change notification settings - Fork 272
Description
Output from azd version
azd version 1.23.2 (commit 83096ae)
What I hoped to accomplish
To set context, I'm hoping to delegate auth responsibilities to Azure CLI to gain access to the broker on Windows (WAM). Azure CLI supports this type of auth by default. See below for steps and thoughts as I attempted to accomplish this task.
To Reproduce
-
Ensure the latest version of Azure CLI is installed. I'm using v2.82.0.
-
Log out of Azure CLI via
az logout. Then runaz account showto ensure this message appears:Please run 'az login' to setup account. -
Log out of azd via
azd auth logout. -
Configure auth delegation to Azure CLI by running the following command:
azd config set auth.useAzCliAuth true -
Run
azd config showto ensure the setting was saved. Notice the following snippet in the JSON:{ "auth": { "useAzCliAuth": "true" }, -
Run
azd auth loginand answer "N" to the question "Do you want to switch back to azd built-in authentication?" Notice the following error appears:ERROR: log in is not supported on current mode: az cliAt this point, I'm confused for 2 reasons:
- The error message leads me to believe auth delegation isn't supported. If true, why does the
auth.useAzCliAuthsetting exist? - When
auth.useAzCliAuthhas been set totrue, I wouldn't expect to be prompted to switch back to azd built-in authN. My expectation was that azd would runaz loginon my behalf. That obviously didn't happen.
- The error message leads me to believe auth delegation isn't supported. If true, why does the
-
Run
azd auth statusfor kicks. The following output appears:fetching az cli account: exit code: 1, stdout: , stderr: ERROR: Please run 'az login' to setup account. Not logged in, run `azd auth login` to login to AzureNow I'm confused again because the error asks me to run
az login. Why can't azd run that command for me if I've setauth.useAzCliAuthtotrue? It's clearly aware of the command that needs to be run.
Additional notes
With Azure CLI auth delegation enabled, my expectation is that running azd auth login or azd auth logout would call az login or az logout on my behalf, respectively. Things don't appear to work that way today. If that's not the vision, some docs should be added to better explain the feature.
/cc: @kristenwomack @puicchan