Skip to content

mattfeltonma/demo-azure-openai-authentication-code

Repository files navigation

Azure OpenAI Authentication Code Samples

Overview

This repository contains code samples of different methods to authenticate to the Azure OpenAI Service using the Python openai library, Python langchain-openai library, and Python requests library.

The samples assume the use of the python-dotenv library for storing sensitive variables.

The following authentication examples are provided:

  1. Service Principal with LangChain
  2. API Key with LangChain
  3. Service Principal with OpenAI SDK
  4. Managed Identity with OpenAI SDK
  5. API Key with OpenAI SDK
  6. Service Principal with REST API
  7. API Key with REST API

In each example you will find a requirements.txt file with the required libraries and a sample environmental variables file that can be used with the python-dotenv library. You will need to rename it from .env-sample to .env.

About

Python code samples for authenticating to Azure OpenAI using different interfaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages