In this tutorial you will learn how to use the Azure OpenAI Completion service from a server-side Blazor application using .NET 7.0.
- To use Azure OpenAI, you need to have an Azure subscription. This can be obtained by visiting https://azure.microsoft.com/free/cognitive-services.
- Currently, access to the Azure OpenAI service is granted by application. You can apply at https://aka.ms/oai/access.
Getting started with Azure OpenAI service
To follow this tutorial, you will need to create an Azure OpenAI service under your Azure subscription. Follow these steps:
Navigate to the Azure portal at https://portal.azure.com/.
Choose your subscription then create a new resource group. In my case (as shown above), I created a new resource group named “OpenAI-RG”.
Continue with the selection of a region, provide a instance name (mze-openai in the example above) and select the “Standard S0” pricing tier. Click on the Next button.
Accept the default (All networks, including the internet, can access this resource.) on the Network tab then click on the Next button.
Server-side Blazor application
In the above scenario, you start with a default statement “Four score and seven years ago”. Click on “Call Completion” and after about 20 seconds, you will experience CharGPT completing the statement.
This tutorial should help you explore all kinds of ways to incorporate the power of ChatGPT into your applications through the Azure OpenAPI service.