You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/concept-ai-configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.date: 04/18/2025
9
9
ms.collection: ce-skilling-ai-copilot
10
10
---
11
11
12
-
# AI configuration
12
+
##AI configuration
13
13
14
14
AI application development often requires rapid iteration of prompts and frequent tuning of model parameters to meet evolving goals such as quality, responsiveness, customer satisfaction, and cost efficiency. AI configuration in Azure App Configuration helps streamline this process by decoupling model settings from application code, enabling faster, safer, and more flexible iteration. Here are some key benefits:
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-chat-completion-config.md
+6-18Lines changed: 6 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,33 +11,21 @@ ms.date: 04/20/2025
11
11
12
12
# Chat Completion Configuration in Azure App Configuration
13
13
14
-
Chat completion is an AI capability that enables models to generate conversational responses based on a series of messages. Unlike simple text completion, chat completion maintains context across multiple exchanges, simulating a natural conversation. This capability powers many AI assistants, chatbots, and interactive applications. Azure App Configuration enhances this experience by providing built in validation for chat completion models, ensuring configurations meet required specifications. Additionaly, App Configuration facilitates the discoverability of new models making it easier for developers to find and implement the latest AI models while maintaining a centralized control over model configurations across their applications.
15
-
16
-
## Chat Completion Parameters
17
-
18
-
Azure OpenAI chat models support several [parameters](/azure/ai-services/openai/reference#request-body-2) that control how responses are generated. Common parameters include:
19
-
20
-
| Parameter | Description |
21
-
|-----------|-------------|
22
-
| max_tokens | Maximum number of tokens that can be generated in the chat completion. |
23
-
| temperature | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. |
24
-
| top_p | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. |
25
-
| frequency_penalty | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
26
-
| presence_penalty | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. |
27
-
| stop | Up to four sequences where the API will stop generating further tokens |
28
-
| response_format | Specifies the format that the model must output. |
29
-
30
-
## Create a chat completion configuration
14
+
Chat completion is an AI capability that enables models to generate conversational responses based on a series of messages. Unlike simple text completion, chat completion maintains context across multiple exchanges, simulating a natural conversation. Chat completion configuration allows you to define and manage how AI models generate responses in your application. A simple configuration includes the model selection and basic prompts. Azure OpenAI chat models support several [configuration options](/azure/ai-services/openai/reference#request-body-2) that control how responses are generated.
31
15
32
16
## Prerequisites
33
17
- An Azure account with an active subscription. [Create one for free](https://azure.microsoft.com/free)
34
18
- An App Configuration store. [Create a store](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store).
> This tutorial demonstrates chat completion configuration management using Azure OpenAI models. However the configuration management demonstrated in the tutorial can be applied to any AI model you choose to work with in your application. Users are not limited to using only Azure OpenAI models.
22
+
> This tutorial demonstrates chat completion configuration management using Azure OpenAI models. However the configuration management demonstrated in the tutorial can be applied to any AI model you choose to work with in your application.
39
23
>
40
24
25
+
## Create a chat completion configuration
26
+
27
+
In this section, we will create a chat completion configuration in Azure Portal using the GPT-4o model as our example.
28
+
41
29
1. In Azure portal, navigate to your App configuration store. From the **Operations** menu, select **Configuration explorer** > **Create**. Then select **AI configuration**.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-chat-completion-dotnet.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,15 +66,15 @@ In this quickstart you will create a .NET console app that retrieves chat comple
66
66
67
67
1. Connect to your App Configuration store by calling the `AddAzureAppConfiguration` method in the _Program.cs_ file.
68
68
69
-
You can connect to App Configuration using **Microsoft Entra ID (recommended)**, or a connection string. In this example, you use Microsoft Entra ID, the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
69
+
You can connect to App Configuration using **Microsoft Entra ID (recommended)**, or a connection string. In this example, you use Microsoft Entra ID, the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your user account the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
70
70
71
71
```csharp
72
72
var credential = new DefaultAzureCredential();
73
73
74
74
IConfiguration configuration = new ConfigurationBuilder()
@@ -85,7 +85,7 @@ In this quickstart you will create a .NET console app that retrieves chat comple
85
85
Console.WriteLine($"Hello, I am your AI assistant powered by Azure App Configuration ({model})");
86
86
```
87
87
88
-
1. Create an instance of the `AzureOpenAIClient`. Use the existing instance of `DefaultAzureCredential` we created in the previous step to authenticate to your Azure OpenAI resource. Assign your credential the [Cognitive Services OpenAI User](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-user) or [Cognitive Services OpenAI Contributor](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-contributor). For detailed steps, see [Role-based access control for Azure OpenAI service](/azure/ai-services/openai/how-to/role-based-access-control). Be sure to allow sufficient time for the permission to propagate before running your application.
88
+
1. Create an instance of the `AzureOpenAIClient`. Use the existing instance of `DefaultAzureCredential` we created in the previous step to authenticate to your Azure OpenAI resource. Assign your user account the [Cognitive Services OpenAI User](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-user) role or [Cognitive Services OpenAI Contributor](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-contributor) role. For detailed steps, see [Role-based access control for Azure OpenAI service](/azure/ai-services/openai/how-to/role-based-access-control). Be sure to allow sufficient time for the permission to propagate before running your application.
89
89
90
90
```csharp
91
91
// Existing code to connect to your App configuration store
@@ -162,7 +162,7 @@ In this quickstart you will create a .NET console app that retrieves chat comple
162
162
IConfiguration configuration = new ConfigurationBuilder()
@@ -215,22 +215,22 @@ In this quickstart you will create a .NET console app that retrieves chat comple
215
215
216
216
## Build and run the app locally
217
217
218
-
1. Set the environment variable named **AZURE_APPCONFIG_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
218
+
1. Set the environment variable named **AZURE_APPCONFIGURATION_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
219
219
220
220
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
1. Connect to your App Configuration store by calling the `load` method in the `app.js` file.
59
59
60
-
You can connect to App Configuration using **Microsoft Entra ID (recommended)**, or a connection string. In this example, you use Microsoft Entra ID, the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
60
+
You can connect to App Configuration using **Microsoft Entra ID (recommended)**, or a connection string. In this example, you use Microsoft Entra ID, the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your user account the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
@@ -80,7 +80,7 @@ In this quickstart you will create a Node js console app that retrieves chat com
80
80
}
81
81
```
82
82
83
-
1. Create an instance of the `AzureOpenAI` client. Use the existing instance of `DefaultAzureCredential` we created in the previous step to authenticate to your Azure OpenAI resource. Assign your credential the [Cognitive Services OpenAI User](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-user) or [Cognitive Services OpenAI Contributor](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-contributor). For detailed steps, see [Role-based access control for Azure OpenAI service](/azure/ai-services/openai/how-to/role-based-access-control). Be sure to allow sufficient time for the permission to propagate before running your application.
83
+
1. Create an instance of the `AzureOpenAI` client. Use the existing instance of `DefaultAzureCredential` we created in the previous step to authenticate to your Azure OpenAI resource. Assign your user account the [Cognitive Services OpenAI User](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-user) role or [Cognitive Services OpenAI Contributor](../role-based-access-control/built-in-roles/ai-machine-learning.md#cognitive-services-openai-contributor) role. For detailed steps, see [Role-based access control for Azure OpenAI service](/azure/ai-services/openai/how-to/role-based-access-control). Be sure to allow sufficient time for the permission to propagate before running your application.
84
84
85
85
```javascript
86
86
// Existing code to connect to your App configuration store
@@ -130,7 +130,7 @@ In this quickstart you will create a Node js console app that retrieves chat com
@@ -174,22 +174,22 @@ In this quickstart you will create a Node js console app that retrieves chat com
174
174
175
175
## Build and run the app locally
176
176
177
-
1. Set the environment variable named **AZURE_APPCONFIG_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
177
+
1. Set the environment variable named **AZURE_APPCONFIGURATION_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
178
178
179
179
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
0 commit comments