Navigate to pascalvanderheiden/ais-apim-openai and login with your GitHub account.
Click the “Use this template” button, or click here.
Select a repository name and click “Create repository”.
You can choose to clone the repository locally, or create a codespace.
Note: If you opt to clone the repository locally, you will need to install the Azure Developer CLI.
Note: It can take up to 45 minutes to deploy Azure API Management. We recommend you start the deployment first and then spend some time familiarise yourself with the repository (see next section).
Initialize a new azd
environment. azd
will prompt you to provide a name that will later be used in the name of the deployed resources.
azd init
Authenticate to Azure
azd auth login
Provision and deploy all the resources
azd up
Note:
azd
will prompt you to login, pick a subscription, and provide a location (like “eastus”). You can find more information about the availability of Azure OpenAI here.
Note: Sometimes the DNS Zones for the Private Endpoints aren’t created correctly / in time. If you get an error when you deploy the resources, it may be required to redeploy.
azd up
The repository you have created is based on the Azure OpenAI Landing Zone reference architecture. We will leverage the Infrastructure-as-code (IaC) under the infra
folder to provision Azure OpenAI, Azure API Management, along with best practices for security, network isolation, monitoring, etc.
Review the solution architecture. Each component’s purpose is described here.
Review the Infrastructure-as-code (IaC).
Once the deployment has completed, navigate to the Azure Portal and open the resource group that was created by azd
. Spend some time familiarising yourself with the resources that were deployed.
Open the API Management instance and click on “APIs”.
Select the “Azure OpenAI Service API” API and open the “Creates a completion for the chat message” operation.
Navigate to the “Test” tab.
Enter the following values under “Template parameters”:
(optional) Under “Request body” update the prompt content to something like “Hello, my name is John. What is the capital of France?”
{"model":"gpt-35-turbo","messages":[{"role":"user","content":"Hello, my name is John. What is the capital of France?"}]}
Click “Send”.
Scroll down, you will find the “HTTP response” with the response from the Azure OpenAI Service.