azure-dev: `azd` extension <> Azure Tools don't share credentials
We need to figure out how we can leverage the same token/credentials for the azd extension in VS Code as the Azure Tools extension pack.
Right now, this inconsistency means that I can open a project/start a project in VS Code that leverages my work subscription via azd but Azure Tools is logged into my personal subscription. As such, I cannot “Show resource group” for my current project until I log out of my personal sub and reauthenticate with my work sub via the Azure Tools extension pack.

### Tasks
- [x] Define HTTP Based Prototcol to shuttle GetToken requests across processes
- [x] Implement client for protocol in `azd`
- [x] Implement server for protocol in VS Code extension
- [ ] Work through Multi-Tenant Auth Story
- [ ] Make `azd login` do "the right thing" when in integrated auth mode.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 23 (20 by maintainers)
Commits related to this issue
- WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authentication to an external process and teaches the VS Code extension to use... — committed to ellismg/azure-dev by ellismg 3 years ago
- WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authentication to an external process and teaches the VS Code extension to use... — committed to ellismg/azure-dev by ellismg 3 years ago
- WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authentication to an external process and teaches the VS Code extension to use... — committed to ellismg/azure-dev by ellismg 3 years ago
- WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authentication to an external process and teaches the VS Code extension to use... — committed to ellismg/azure-dev by ellismg 3 years ago
- WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authentication to an external process and teaches the VS Code extension to use... — committed to ellismg/azure-dev by ellismg 3 years ago
- WIP: Support fetching credentials from an external process (#2541) * WIP: Support fetching credentials from an external process This change sketches out a possible way for `azd` to delegate authe... — committed to Azure/azure-dev by ellismg 3 years ago
@bwateratmsft Following the steps you mentioned, it works.
The exact steps are a little different. The extension launches
azdprocesses with a nonce that gives access to the token server. So only processes launched by the extension can benefit from the shared authentication.azure-dev.auth.useIntegratedAuth:azd auth logoutin the terminal to ensure AZD is not signed in.azd upcommand, this should succeed. It has obtained auth information from the extension.@v-xuto can we test this and make sure it works?
Currently the feature is toggled off. Can be enabled from
vscode azd extensionsettings, I guess @bwateratmsft? Refer PR for more details https://github.com/Azure/azure-dev/pull/2541cc: @gkulin for capturing it in docs FAQ may be?