|
1 | 1 | ## Create the AI service |
2 | 2 |
|
3 | | -# [Azure OpenAI](#tab/azure-openai) |
4 | | - |
5 | | -Choose of the options below to create an Azure OpenAI service. |
6 | | - |
7 | | -### Use the Azure Developer CLI |
| 3 | +# [Use the Azure Developer CLI](#tab/azd) |
8 | 4 |
|
9 | 5 | [!INCLUDE [deploy-azd](deploy-azd.md)] |
10 | 6 |
|
11 | | -### Use the Azure portal or Azure CLI |
| 7 | +# [Azure CLI](#tab/azure-cli) |
12 | 8 |
|
13 | | -1. To provision an Azure OpenAI service using another tool such as the Azure portal or Azure CLI, complete the steps in the [Create and deploy an Azure OpenAI Service resource](/azure/ai-services/openai/how-to/create-resource?pivots=cli) article. |
| 9 | +1. To provision an Azure OpenAI service and model using the Azure CLI, complete the steps in the [Create and deploy an Azure OpenAI Service resource](/azure/ai-services/openai/how-to/create-resource?pivots=cli) article. |
14 | 10 |
|
15 | | -1. Assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI. The sample app uses a secretless approach to connect to the Azure OpenAI service using Microsoft Entra ID and `DefaultAzureCredential`. |
| 11 | +1. From a terminal or command prompt, navigate to the `src\quickstarts\azure-openai\01-HikeBenefitsSummary` directory. |
16 | 12 |
|
17 | | -1. In your project directory, set the Azure OpenAI deployment model name and endpoint as user secrets: |
| 13 | +1. Run the following commands to configure your OpenAI API key as a secret for the sample app: |
18 | 14 |
|
19 | | - ```csharp |
| 15 | + ```bash |
20 | 16 | dotnet user-secrets init |
21 | | - dotnet user-secrets set AZURE_OPENAI_ENDPOINT <your-openai-key> |
22 | | - dotnet user-secrets set AZURE_OPENAI_GPT_NAME <your-openai-gpt-name> |
| 17 | + dotnet user-secrets set OpenAIKey <your-openai-key> |
23 | 18 | ``` |
24 | 19 |
|
25 | | -# [OpenAI](#tab/openai) |
| 20 | +# [Azure Portal](#tab/azure-portal) |
| 21 | + |
| 22 | +1. To provision an Azure OpenAI service and model using the Azure portal, complete the steps in the [Create and deploy an Azure OpenAI Service resource](/azure/ai-services/openai/how-to/create-resource?pivots=web-portal) article. |
| 23 | + |
| 24 | +1. From a terminal or command prompt, navigate to the `src\quickstarts\azure-openai\01-HikeBenefitsSummary` directory. |
26 | 25 |
|
27 | | -If you plan to use an OpenAI Model, this quickstart assumes you already have a service setup and available. You'll need the access key and AI service endpoint to connect your code. |
| 26 | +1. Run the following commands to configure your OpenAI API key as a secret for the sample app: |
| 27 | + |
| 28 | + ```bash |
| 29 | + dotnet user-secrets init |
| 30 | + dotnet user-secrets set OpenAIKey <your-openai-key> |
| 31 | + ``` |
28 | 32 |
|
29 | 33 | --- |
0 commit comments