Skip to content

Commit 3d581f7

Browse files
author
Jill Grant
authored
Merge pull request #271142 from aahill/azd
Azure developer CLI article
2 parents 89fbf21 + bf86b27 commit 3d581f7

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: 'Use the Azure Developer CLI to deploy resources for Azure OpenAI On Your Data'
3+
titleSuffix: Azure OpenAI
4+
description: Use this article to learn how to automate resource deployment for Azure OpenAI On Your Data.
5+
manager: nitinme
6+
ms.service: azure-ai-openai
7+
ms.topic: quickstart
8+
author: aahill
9+
ms.author: aahi
10+
ms.date: 04/09/2024
11+
recommendations: false
12+
---
13+
14+
# Use the Azure Developer CLI to deploy resources for Azure OpenAI On Your Data
15+
16+
Use this article to learn how to automate resource deployment for Azure OpenAI On Your Data. The Azure Developer CLI (`azd`) is an open-source, command-line tool that streamlines provisioning and deploying resources to Azure using a template system. The template contains infrastructure files to provision the necessary Azure OpenAI resources and configurations and includes the completed sample app code.
17+
18+
## Prerequisites
19+
20+
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
21+
- Access granted to Azure OpenAI in the desired Azure subscription.
22+
23+
Azure OpenAI requires registration and is currently only available to approved enterprise customers and partners. [See Limited access to Azure OpenAI Service](/legal/cognitive-services/openai/limited-access?context=/azure/ai-services/openai/context/context) for more information. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Open an issue on this repo to contact us if you have an issue.
24+
25+
- The Azure Developer CLI [installed](/azure/developer/azure-developer-cli/install-azd) on your machine
26+
27+
## Clone and initialize the Azure Developer CLI template
28+
29+
30+
31+
1. For the steps ahead, clone and initialize the template.
32+
33+
```bash
34+
azd init --template openai-chat-your-own-data
35+
```
36+
37+
2. The `azd init` command prompts you for the following information:
38+
39+
* Environment name: This value is used as a prefix for all Azure resources created by Azure Developer CLI. The name must be unique across all Azure subscriptions and must be between 3 and 24 characters long. The name can contain numbers and lowercase letters only.
40+
41+
## Use the template to deploy resources
42+
43+
1. Sign-in to Azure:
44+
45+
```bash
46+
azd auth login
47+
```
48+
49+
1. Provision and deploy the OpenAI resource to Azure:
50+
51+
```bash
52+
azd up
53+
```
54+
55+
`azd` prompts you for the following information:
56+
57+
* Subscription: The Azure subscription that your resources are deployed to.
58+
* Location: The Azure region where your resources are deployed.
59+
60+
> [!NOTE]
61+
> The sample `azd` template uses the `gpt-35-turbo-16k` model. A recommended region for this template is East US, since different Azure regions support different OpenAI models. You can visit the [Azure OpenAI Service Models](/azure/ai-services/openai/concepts/models) support page for more details about model support by region.
62+
63+
> [!NOTE]
64+
> The provisioning process may take several minutes to complete. Wait for the task to finish before you proceed to the next steps.
65+
66+
1. Click the link `azd` outputs to navigate to the new resource group in the Azure portal. You should see the following top level resources:
67+
68+
* An Azure OpenAI service with a deployed model
69+
* An Azure Storage account you can use to upload your own data files
70+
* An Azure AI Search service configured with the proper indexes and data sources
71+
72+
## Upload data to the storage account
73+
74+
`azd` provisioned all of the required resources for you to chat with your own data, but you still need to upload the data files you want to make available to your AI service.
75+
76+
1. Navigate to the new storage account in the Azure portal.
77+
1. On the left navigation, select **Storage browser**.
78+
1. Select **Blob containers** and then navigate into the **File uploads** container.
79+
1. Click the **Upload** button at the top of the screen.
80+
1. In the flyout menu that opens, upload _contoso_benefits_document_example.pdf_ file in the root `documents` folder of the example repo.
81+
82+
> [!NOTE]
83+
> The search indexer is set to run every 5 minutes to index the data in the storage account. You can either wait a few minutes for the uploaded data to be indexed, or you can manually run the indexer from the search service page.
84+
85+
## Connect or create an application
86+
87+
After running the `azd` template and uploading your data, you're ready to start using Azure OpenAI on Your Data. See the [quickstart article](../use-your-data-quickstart.md) for code samples you can use to build your applications.

articles/ai-services/openai/includes/connect-your-data-studio.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ recommendations: false
1212

1313
## Add your data using Azure OpenAI Studio
1414

15+
> [!TIP]
16+
> You can [use the Azure Developer CLI](../how-to/azure-developer-cli.md) to programmatically create the resources needed for Azure OpenAI On Your Data
17+
1518
Navigate to [Azure OpenAI Studio](https://oai.azure.com/) and sign-in with credentials that have access to your Azure OpenAI resource. During or after the sign-in workflow, select the appropriate directory, Azure subscription, and Azure OpenAI resource.
1619

1720
1. Select the **Bring your own data** tile

articles/ai-services/openai/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ items:
145145
href: ./how-to/use-your-data-securely.md
146146
- name: Deploy and use web apps
147147
href: ./how-to/use-web-app.md
148+
- name: Use the Azure Developer CLI
149+
href: ./how-to/azure-developer-cli.md
148150
- name: Migrate to OpenAI Python v1.x
149151
href: ./how-to/migration.md
150152
- name: Models

0 commit comments

Comments
 (0)