microsoft / vscode-azuretools

Common packages for building Azure extensions for VS Code
MIT License
105 stars 66 forks source link

sample using @microsoft/vscode-azext-azureauth to access a Azure Open AI deployment in Visual Studio Code #1745

Open pelikhan opened 3 months ago

pelikhan commented 3 months ago

Is there a sample that shows how to successfully make a chat completion request to a Azure Open AI deployment from Visual Studio Code and using VSCodeAzureSubscriptionProvider ?

pelikhan commented 3 months ago

It turns out that scopes are ignored in getToken (https://github.com/microsoft/vscode-azuretools/blob/main/auth/src/VSCodeAzureSubscriptionProvider.ts#L248) and there is no way to provide the required scopews in the constructor to access an AOAI instance

alexweininger commented 3 months ago

Ignoring the scopes is a known issue, we don't have a great solution for it yet unfortunately.

What scopes do you need to access an AOAI instance? Are you creating a new extension? Feel free to reach out to me on Teams/email if you'd like to sync.

For now, I suggest using the VS Code authentication API until I can understand your use case better.

pelikhan commented 3 months ago

Yes we are adding support to genaiscript.

The scopes are at https://github.com/microsoft/genaiscript/blob/main/packages/core/src/constants.ts#L8-L11