Conversation
There was a problem hiding this comment.
Pull request overview
Updates the AI documentation and code snippets to use newer model names (primarily gpt-5) and removes the need to store model names in user-secrets.
Changes:
- Updated multiple docs and snippets from
gpt-4otogpt-5. - Removed
AZURE_OPENAI_GPT_NAMEuser-secrets instructions and switched several Azure OpenAI samples to hard-coded deployment names. - Updated tokenizer examples and a few OpenAI (non-Azure) defaults to
gpt-5.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/ai/quickstarts/text-to-image.md | Removes the model-name user-secret instruction for the text-to-image quickstart. |
| docs/ai/quickstarts/structured-output.md | Updates the structured-output quickstart to reference gpt-5 and removes the model-name user-secret instruction. |
| docs/ai/quickstarts/snippets/text-to-image/azure-openai/Program.cs | Hard-codes the image deployment name as gpt-image-1. |
| docs/ai/quickstarts/snippets/structured-output/Program.cs | Hard-codes the chat deployment name as gpt-5. |
| docs/ai/quickstarts/snippets/function-calling/openai/Program.cs | Updates the default OpenAI model fallback to gpt-5. |
| docs/ai/how-to/snippets/use-tokenizers/csharp/TokenizersExamples/TiktokenExample.cs | Updates tokenizer model selection to gpt-5. |
| docs/ai/how-to/snippets/handle-invalid-tool-input/csharp/StrictSchema.cs | Updates OpenAI model fallback and generalizes the compatibility comment. |
| docs/ai/how-to/snippets/handle-invalid-tool-input/csharp/IncludeDetailedErrors.cs | Updates OpenAI model fallback to gpt-5. |
| docs/ai/how-to/snippets/handle-invalid-tool-input/csharp/FunctionInvoker.cs | Updates OpenAI model fallback to gpt-5. |
| docs/ai/how-to/snippets/access-data/ArgumentsExample.cs | Hard-codes the Azure OpenAI deployment name as gpt-5. |
| docs/ai/evaluation/snippets/evaluate-with-reporting/MyTests.cs | Hard-codes the Azure OpenAI deployment name as gpt-5. |
| docs/ai/evaluation/snippets/evaluate-safety/MyTests.cs | Hard-codes the Azure OpenAI deployment name as gpt-5. |
| docs/ai/evaluation/snippets/evaluate-ai-responses/MyTests.cs | Hard-codes the Azure OpenAI deployment name as gpt-5. |
| docs/ai/evaluation/evaluate-with-reporting.md | Updates tutorial text to reference gpt-5 and removes the model-name user-secret instruction. |
| docs/ai/evaluation/evaluate-safety.md | Updates tutorial text to reference gpt-5 and removes the model-name user-secret instruction. |
| docs/ai/evaluation/evaluate-ai-response.md | Updates quickstart text to reference gpt-5 and removes the model-name user-secret instruction. |
| docs/ai/conceptual/data-ingestion.md | Updates tokenizer model selection example to gpt-5. |
Comments suppressed due to low confidence (2)
docs/ai/quickstarts/snippets/text-to-image/azure-openai/Program.cs:17
modelis hard-coded to "gpt-image-1" but is used as the Azure OpenAI deployment name (viaGetImageClient). This will break if the deployment name differs. Consider making the deployment name configurable and/or renaming the variable todeploymentNameto avoid implying it’s a model ID.
string model = "gpt-image-1";
// Create the Azure OpenAI client and convert to IImageGenerator.
AzureOpenAIClient azureClient = new(
new Uri(endpoint),
docs/ai/how-to/snippets/access-data/ArgumentsExample.cs:45
modelis hard-coded to "gpt-5" but is passed toAzureOpenAIClient.GetChatClient(...), which expects an Azure OpenAI deployment name. This will fail if the deployment name differs. Consider making the deployment name configurable (even if it isn’t secret) and/or renaming the variable todeploymentName.
string model = "gpt-5";
// <SnippetUseAdditionalProperties>
FunctionInvokingChatClient client = new FunctionInvokingChatClient(
new AzureOpenAIClient(new Uri(endpoint), new AzureKeyCredential(apiKey))
You can also share your feedback on Copilot code review. Take the survey.
| 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. In the "Deploy a model" step, select the `gpt-5` model. | ||
|
|
||
| ## Create the chat app | ||
|
|
||
| Complete the following steps to create a console app that connects to the `gpt-4o` AI model. | ||
| Complete the following steps to create a console app that connects to the `gpt-5` AI model. |
There was a problem hiding this comment.
This section tells readers to deploy/select the gpt-5 model, but the code snippet calls GetChatClient(deploymentName: ...) with a hard-coded value. Azure OpenAI uses a deployment name that can differ from the model name, so either instruct readers to set the deployment name to gpt-5 or keep the deployment name configurable in the sample.
| string endpoint = config["AZURE_OPENAI_ENDPOINT"]; | ||
| string model = config["AZURE_OPENAI_GPT_NAME"]; | ||
| string tenantId = config["AZURE_TENANT_ID"]; | ||
| string model = "gpt-5"; | ||
|
|
There was a problem hiding this comment.
model is hard-coded to "gpt-5" but is passed as deploymentName. This will fail if the user’s Azure OpenAI deployment name isn’t exactly "gpt-5". Consider reading the deployment name from configuration (even if it isn’t secret) and/or renaming the variable to deploymentName to match how it’s used.
| 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. In the "Deploy a model" step, select the `gpt-5` model. | ||
|
|
||
| ## Create the test app | ||
|
|
||
| Complete the following steps to create an MSTest project that connects to the `gpt-4o` AI model. | ||
| Complete the following steps to create an MSTest project that connects to the `gpt-5` AI model. |
There was a problem hiding this comment.
This section says to select the gpt-5 model, but the accompanying snippet hard-codes the Azure OpenAI deployment name to "gpt-5". Azure deployments can be named differently, so either document that the deployment name must be "gpt-5" or keep it configurable in the sample/tests.
| 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and tenant ID: | ||
|
|
||
| ```bash | ||
| dotnet user-secrets init | ||
| dotnet user-secrets set AZURE_OPENAI_ENDPOINT <your-Azure-OpenAI-endpoint> |
There was a problem hiding this comment.
The instructions say to add app secrets for the endpoint, model name, and tenant ID, but the commands no longer set any model/deployment name. Add a deployment-name setting (even if it isn’t secret) or update the wording so readers aren’t missing required configuration.
| 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and tenant ID: | ||
|
|
||
| ```bash | ||
| dotnet user-secrets init | ||
| dotnet user-secrets set AZURE_OPENAI_ENDPOINT <your-Azure-OpenAI-endpoint> |
There was a problem hiding this comment.
The instructions say to add app secrets for the endpoint, model name, and tenant ID, but the commands no longer set any model/deployment name. Add a deployment-name setting (even if it isn’t secret) or update the wording to match the code.
| string endpoint = config["AZURE_OPENAI_ENDPOINT"]; | ||
| string model = config["AZURE_OPENAI_GPT_NAME"]; | ||
| string tenantId = config["AZURE_TENANT_ID"]; | ||
| string model = "gpt-5"; | ||
|
|
||
| // Get an instance of Microsoft.Extensions.AI's <see cref="IChatClient"/> |
There was a problem hiding this comment.
model is hard-coded to "gpt-5" but is passed as the Azure OpenAI deploymentName later in the method. This makes the sample fail unless the deployment is named exactly "gpt-5". Consider reading the deployment name from configuration and/or renaming the variable to deploymentName to reflect how it’s used.
| 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and API key: | ||
|
|
||
| ```bash | ||
| dotnet user-secrets init | ||
| dotnet user-secrets set AZURE_OPENAI_ENDPOINT <your-Azure-OpenAI-endpoint> |
There was a problem hiding this comment.
The instructions say to add app secrets for the endpoint, model name, and API key, but the commands no longer set any model/deployment name. Update the text and/or add a config value for the image deployment name so the setup steps match the Program.cs snippet.
| 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. In the "Deploy a model" step, select the `gpt-5` model. | ||
|
|
||
| ## Create the test app | ||
|
|
||
| Complete the following steps to create an MSTest project that connects to the `gpt-4o` AI model. | ||
| Complete the following steps to create an MSTest project that connects to the `gpt-5` AI model. |
There was a problem hiding this comment.
This section tells readers to select the gpt-5 model, but the snippets use a fixed Azure OpenAI deployment name. Azure deployments can be named differently, so either specify that the deployment name must be "gpt-5" or keep the deployment name configurable in the sample.
| string endpoint = config["AZURE_OPENAI_ENDPOINT"]; | ||
| string model = config["AZURE_OPENAI_GPT_NAME"]; | ||
| string tenantId = config["AZURE_TENANT_ID"]; | ||
| string model = "gpt-5"; | ||
|
|
||
| // Get an instance of Microsoft.Extensions.AI's <see cref="IChatClient"/> |
There was a problem hiding this comment.
model is hard-coded to "gpt-5" but is used as the Azure OpenAI deploymentName later in the method. This will break if the deployment name differs. Make the deployment name configurable and/or rename the variable to deploymentName so it’s clear what value is required.
| 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and tenant ID: | ||
|
|
||
| ```bash | ||
| dotnet user-secrets init | ||
| dotnet user-secrets set AZURE_OPENAI_ENDPOINT <your-Azure-OpenAI-endpoint> |
There was a problem hiding this comment.
The instructions say to add app secrets for the endpoint, model name, and tenant ID, but the commands no longer set any model/deployment name. Either add a configuration value for the deployment name (even if it isn’t secret) or update the text to remove the model-name requirement so the setup steps match the snippet.
Internal previews