Use the Azure Developer CLI to deploy resources for Azure OpenAI On Your Data
Use this article to learn how to automate resource deployment for Azure OpenAI Service On Your Data. The Azure Developer CLI (azd
) is an open-source command-line tool that streamlines provisioning and deploying resources to Azure by using a template system. The template contains infrastructure files to provision the necessary Azure OpenAI resources and configurations. It also includes the completed sample app code.
- An Azure subscription. Create one for free.
- The Azure Developer CLI installed on your machine.
For the steps ahead, clone and initialize the template:
azd init --template openai-chat-your-own-data
The
azd init
command prompts you to create an environment name. This value is used as a prefix for all Azure resources that Azure Developer CLI creates. The name:- Must be unique across all Azure subscriptions.
- Must be 3 to 24 characters.
- Can contain numbers and lowercase letters only.
Sign in to Azure:
azd auth login
Provision and deploy the Azure OpenAI resource to Azure:
azd up
The Azure Developer CLI prompts you for the following information:
Subscription
: The Azure subscription that your resources are deployed to.Location
: The Azure region where your resources are deployed.
Note
The sample
azd
template uses thegpt-35-turbo-16k
model. A recommended region for this template is East US, because different Azure regions support different OpenAI models. For more details about model support by region, go to the Azure OpenAI Service Models support page.The provisioning process might take several minutes. Wait for the task to finish before you proceed to the next steps.
Select the link in the
azd
outputs to go to the new resource group in the Azure portal. The following top-level resources should appear:- An Azure OpenAI service with a deployed model
- An Azure Storage account that you can use to upload your own data files
- An Azure AI Search service configured with the proper indexes and data sources
The azd
template provisioned all of the required resources for you to chat with your own data, but you still need to upload the data files that you want to make available to your AI service:
- Go to the new storage account in the Azure portal.
- On the left menu, select Storage browser.
- Select Blob containers, and then go to the File uploads container.
- Select the Upload button at the top of the pane.
- In the flyout menu that opens, upload your data.
Note
The search indexer is set to run every five minutes to index the data in the storage account. You can wait a few minutes for the uploaded data to be indexed, or you can manually run the indexer from the search service page.
After you run the azd
template and upload your data, you're ready to start using Azure OpenAI On Your Data. For code samples that you can use to build your applications, see the quickstart article.