Azure OpenAI EntraID ConsoleApp is a console application written in C# that integrates with Azure OpenAI REST API and Entra ID services. The application demonstrates how to authenticate with Azure services and interact with an AI assistant via the command line.
- Authenticate with Azure using Tenant ID, Client ID, and Client Secret.
- Communicate with an AI assistant using the command line.
- Optionally include images in queries to the AI assistant.
- .NET SDK (version 6.0 or higher)
- Azure account with necessary permissions
- Configuration settings for Azure services
-
Clone the repository:
git clone https://github.com/ppiova/AzureOpenAI-EntraID-ConsoleApp.git cd AzureOpenAI-EntraID-ConsoleApp
-
Configure the application:
- Create a
appsettings.json
file in the root directory with the following content:{ "AzureSettings": { "TenantId": "<Your Tenant ID>", "ClientId": "<Your Client ID>", "ClientSecret": "<Your Client Secret>", "Resource": "<Your Resource>", "Endpoint": "<Your Endpoint>" } }
- Create a
-
Run the application:
dotnet run --project AOAI-EntraID-ConsoleApp
-
Follow the prompts to interact with the AI assistant and optionally include images in your queries.
[assistant]: Hello! How can I assist you today?
Do you want to include an image in the query? (y/n)
Enter your question (type 'exit' to end):
- How to configure Azure OpenAI Service with Microsoft Entra ID authentication
- Azure OpenAI Service REST API reference
If you wish to contribute to the project, please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License.
For any questions or inquiries, please contact the repository owner.