Azure OpenAI | LangChain SDK with MSI
Image from https://www.pexels.com/@tara-winstead/ In this blog, we show how to set up an Azure Function App to use Azure OpenAI Service with Managed Service Identity (MSI) with Python SDK Pre-requisite Create an Azure Function App and turn on its Managed Service Identity Create an Azure OpenAI Service and grant the function app MSI to the Cognitive Services OpenAI User role. These are the function app configurations, below is an example "OPENAI_API_TYPE": "azure_ad", "OPENAI_API_BASE": "https://sample.openai.azure.com/", "OPENAI_API_VERSION": "2023-03-15-preview", "COMPLETIONS_MODEL": "gpt-35-turbo" Your local.setttings.json looks like this { "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "", "FUNCTIONS_WORKER_RUNTIME": "python", "OPENAI_API_TYPE": "azur