Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant switching #29

Open
07JP27 opened this issue Jul 1, 2024 · 6 comments
Open

Tenant switching #29

07JP27 opened this issue Jul 1, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@07JP27
Copy link

07JP27 commented Jul 1, 2024

Hi team,

I have joined multiple tenants. When I try to run a prompty file in VS Code, the default tenant is selected automatically.
However, the Azure OpenAI model I am trying to use is deployed in another tenant, so I cannot authenticate with AAD.

Is there any way to switch tenants when running a prompt or a workaround for this issue?

@sethjuarez
Copy link
Member

Great question - the extension relies on the underlying system settings when it comes to identity. My go to approach is to use the az login approach to sign in to the right places. Let me know what you think.

@07JP27
Copy link
Author

07JP27 commented Jul 4, 2024

I also confirmed that vscode.authentication.getSession() is used in the prompty extension's code.

Creating and using the CLI is a good idea to realize this issue, and it allows execution in other IDEs or shells.
If you still keep the VS Code extension, you can emit the CLI command behind the GUI action.

The CLI command I hope:

prompty login --tenant xxxxxxxxxxxxxx (-> Browser poping up)
prompty create --file xxxxx.prompty
prompty run --file xxxxx.prompty
prompty generate --lang-chain --file xxxxx.prompty
prompty generate --semantic-kernel --file xxxxx.prompty
prompty generate --prompt-flow --file xxxxx.prompty

@sethjuarez
Copy link
Member

Interesting idea!! I will label this as a feature request.

@sethjuarez sethjuarez added the enhancement New feature or request label Jul 7, 2024
@pelikhan
Copy link
Member

pelikhan commented Sep 6, 2024

vscode 1.93 added support for choosing accounts when getting a session

@DavidBurela
Copy link
Member

I am stuck at this point now. I did my auth login for prompty, but it is not using my correct tenant.
I've tried authenticating with az login but Prompty still tries to run against the wrong tenant.

@sethjuarez
Copy link
Member

Ugh - I am sorry! In general the AOAI prompty executor uses the currently logged in tenant if the key is not specified. Usually something like:

az login

sould fix the issue. You can also switch the tenant using:

az login --tenant <tenant_id>

Hopefully this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants