This extension provides a seamless Single Sign-On (SSO) experience for accessing Azure OpenAI services from Visual Studio Code, using the Azure Identity library.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
This extension provides a seamless Single Sign-On (SSO) experience for accessing Azure OpenAI services from Visual Studio Code, using the Azure Identity library.
Features
Azure Active Directory Authentication: Easily authenticate with Azure services using the extension's SSO feature.
Token Generation for OpenAI API: Fetch and inject the OpenAI API key into your workspace for a simplified development experience.
Requirements
Visual Studio Code
An Azure account with an active subscription
installed "azure-openai-sso" extension
Extension Activation
The extension is activated the first time you execute the command it provides. Upon activation, it logs a confirmation message indicating that it is now active.
Commands
azure-openai-sso.login: This command initializes the SSO process to fetch an OpenAI API key and creates a new .env file in your workspace with this token.
Getting Started
Install the extension through the Visual Studio Code Marketplace.
Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.
Type Azure OpenAI SSO: Login and press Enter to run the command.
Follow the prompted sign-in process to authenticate with Azure.
Once authenticated, the OpenAI API key will be retrieved and stored in a .env file within your workspace.
Extension API Usage
Upon activation, the extension uses DefaultAzureCredential from @azure/identity to perform authentication and retrieve a token scoped appropriately for your needs.
Development
To develop and test this extension:
Clone the repository to your local machine.
Run npm install to install dependencies.
Press F5 to open a new window with the extension loaded.
Run the azure-openai-sso.login command from the Command Palette to test the functionality.
Feedback
If you encounter any issues or have suggestions for improvements, please submit them to the repository's Issues section.
License
This project is licensed under MIT license
Enjoy using the Azure OpenAI SSO extension for Visual Studio Code!