diff --git a/.github/workflows/cleanrepo-orphaned-articles.yml b/.github/workflows/cleanrepo-orphaned-articles.yml index d50c48205bb13..c485627972db1 100644 --- a/.github/workflows/cleanrepo-orphaned-articles.yml +++ b/.github/workflows/cleanrepo-orphaned-articles.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-orphaned-images.yml b/.github/workflows/cleanrepo-orphaned-images.yml index 7e73527eb176d..495d0925b4f83 100644 --- a/.github/workflows/cleanrepo-orphaned-images.yml +++ b/.github/workflows/cleanrepo-orphaned-images.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-orphaned-includes.yml b/.github/workflows/cleanrepo-orphaned-includes.yml index 4ab999628a1fc..7e558b87ca696 100644 --- a/.github/workflows/cleanrepo-orphaned-includes.yml +++ b/.github/workflows/cleanrepo-orphaned-includes.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-orphaned-snippets.yml b/.github/workflows/cleanrepo-orphaned-snippets.yml index 1b37f65028a59..a44eccfe06c99 100644 --- a/.github/workflows/cleanrepo-orphaned-snippets.yml +++ b/.github/workflows/cleanrepo-orphaned-snippets.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-redirect-hops.yml b/.github/workflows/cleanrepo-redirect-hops.yml index 215b56518fde6..79ae6759d664d 100644 --- a/.github/workflows/cleanrepo-redirect-hops.yml +++ b/.github/workflows/cleanrepo-redirect-hops.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-relative-links.yml b/.github/workflows/cleanrepo-relative-links.yml index e167a77ab5f88..9e3b48d66e9a3 100644 --- a/.github/workflows/cleanrepo-relative-links.yml +++ b/.github/workflows/cleanrepo-relative-links.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/cleanrepo-replace-redirects.yml b/.github/workflows/cleanrepo-replace-redirects.yml index c6ef4691547a3..681919541129a 100644 --- a/.github/workflows/cleanrepo-replace-redirects.yml +++ b/.github/workflows/cleanrepo-replace-redirects.yml @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # Call clean repo - name: Clean repo diff --git a/.github/workflows/dependabot-bot.yml b/.github/workflows/dependabot-bot.yml index 1d2155cca9b33..d73561ff95c68 100644 --- a/.github/workflows/dependabot-bot.yml +++ b/.github/workflows/dependabot-bot.yml @@ -30,7 +30,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - name: Setup .NET # uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0 # with: diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index d25751a5462b4..3eb2f162addb8 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -22,6 +22,6 @@ jobs: egress-policy: audit - name: 'Checkout Repository' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: 'Dependency Review' uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1 diff --git a/.github/workflows/docs-verifier.yml b/.github/workflows/docs-verifier.yml index 20d9b883b8c1d..4e18e2fc2119b 100644 --- a/.github/workflows/docs-verifier.yml +++ b/.github/workflows/docs-verifier.yml @@ -19,7 +19,7 @@ jobs: egress-policy: audit - name: Checkout the repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Validate uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 9c685bf4bf872..6ae99c973e50a 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -26,7 +26,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0 with: config: ".markdownlint-cli2.jsonc" diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index a0059a2e56383..e39788bb6b09e 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -36,7 +36,7 @@ jobs: egress-policy: audit - name: "Checkout code" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 + uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5 with: sarif_file: results.sarif diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml index 4d6d16c48b22a..e9aa457a8074a 100644 --- a/.github/workflows/snippets5000.yml +++ b/.github/workflows/snippets5000.yml @@ -36,7 +36,7 @@ jobs: egress-policy: audit - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #@v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #@v5.0.0 # Get the latest preview SDK (or sdk not installed by the runner) - name: Setup .NET diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md index 90d0009db1ab3..f8f40b9683618 100644 --- a/docs/azure/includes/dotnet-all.md +++ b/docs/azure/includes/dotnet-all.md @@ -1,6 +1,6 @@ | Name | Package | Docs | Source | | ---- | ------- | ---- | ------ | -| AI Agents Persistent | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Agents.Persistent-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.1.0/sdk/ai/Azure.AI.Agents.Persistent/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.2.0-beta.1/sdk/ai/Azure.AI.Agents.Persistent/) | +| AI Agents Persistent | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.1.0)
NuGet [1.2.0-beta.2](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.2.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Agents.Persistent-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.1.0/sdk/ai/Azure.AI.Agents.Persistent/)
GitHub [1.2.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.2.0-beta.2/sdk/ai/Azure.AI.Agents.Persistent/) | | AI Foundry | NuGet [1.0.0-beta.10](https://www.nuget.org/packages/Azure.AI.Projects/1.0.0-beta.10) | [docs](/dotnet/api/overview/azure/AI.Projects-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.10](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects_1.0.0-beta.10/sdk/ai/Azure.AI.Projects/) | | AI Model Inference | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.Inference/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.Inference-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Inference_1.0.0-beta.5/sdk/ai/Azure.AI.Inference/) | | Anomaly Detector | NuGet [3.0.0-preview.7](https://www.nuget.org/packages/Azure.AI.AnomalyDetector/3.0.0-preview.7) | [docs](/dotnet/api/overview/azure/AI.AnomalyDetector-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [3.0.0-preview.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AnomalyDetector_3.0.0-preview.7/sdk/anomalydetector/Azure.AI.AnomalyDetector/) | @@ -400,8 +400,8 @@ | Functions Worker Extension MySQL | NuGet [1.0.129](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.MySql/1.0.129) | | | | HTTP ASPNETCore Analyzers | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Analyzers/1.0.4) | | | | IoT Operations MQTT | NuGet [0.11.0](https://www.nuget.org/packages/Azure.Iot.Operations.Mqtt/0.11.0) | | | -| IoT Operations Protocol | NuGet [0.12.0](https://www.nuget.org/packages/Azure.Iot.Operations.Protocol/0.12.0) | | | -| IoT Operations Services | NuGet [0.13.0](https://www.nuget.org/packages/Azure.Iot.Operations.Services/0.13.0) | | | +| IoT Operations Protocol | NuGet [0.12.1](https://www.nuget.org/packages/Azure.Iot.Operations.Protocol/0.12.1) | | | +| IoT Operations Services | NuGet [0.14.0](https://www.nuget.org/packages/Azure.Iot.Operations.Services/0.14.0) | | | | Item Templates NetCore | NuGet [4.0.5212](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ItemTemplates.NetCore/4.0.5212) | | | | Item Templates NetFx | NuGet [4.0.5212](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ItemTemplates.NetFx/4.0.5212) | | | | Microsoft.Azure.DataFactoryTestingFramework.Expressions | NuGet [0.2.7](https://www.nuget.org/packages/Microsoft.Azure.DataFactoryTestingFramework.Expressions/0.2.7) | | | @@ -413,7 +413,7 @@ | Speech Extension ONNX Runtime | NuGet [1.45.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.ONNX.Runtime/1.45.0) | | | | Speech Extension Telemetry | NuGet [1.45.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Telemetry/1.45.0) | | | | System Net Client Model | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/System.Net.ClientModel/1.0.0-beta.1) | | | -| Unknown Display Name | NuGet [0.11.0](https://www.nuget.org/packages/Azure.Iot.Operations.Connector/0.11.0) | | | +| Unknown Display Name | NuGet [0.12.0](https://www.nuget.org/packages/Azure.Iot.Operations.Connector/0.12.0) | | | | Unknown Display Name | NuGet [1.1.2-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo/1.1.2-preview) | | | | Unknown Display Name | NuGet [1.45.0](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.MAS/1.45.0) | | | | Unknown Display Name | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Postgres/1.0.0) | | | @@ -438,7 +438,7 @@ | Common | NuGet [2.2.1](https://www.nuget.org/packages/Microsoft.Azure.Common/2.2.1) | | | | Common - Dependencies | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Common.Dependencies/1.0.0) | | | | Computer Vision | NuGet [7.0.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/7.0.1) | | GitHub [7.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ComputerVision_6.0.0-preview.1/sdk/cognitiveservices/Vision.ComputerVision) | -| Cosmos DB | NuGet [3.47.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.47.0)
NuGet [3.53.0-preview.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.53.0-preview.0) | [docs](/dotnet/api/overview/azure/cosmosdb) | GitHub [3.47.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | +| Cosmos DB | NuGet [3.47.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.47.0)
NuGet [3.54.0-preview.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.54.0-preview.0) | [docs](/dotnet/api/overview/azure/cosmosdb) | GitHub [3.47.0](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/3.12.0/Microsoft.Azure.Cosmos) | | Custom Vision Prediction | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction/2.0.0) | | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction_2.0.0/sdk/cognitiveservices/Vision.CustomVision.Prediction) | | Custom Vision Training | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training/2.0.0)
NuGet [2.1.0-preview](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training/2.1.0-preview) | | GitHub [2.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training_2.0.0/sdk/cognitiveservices/Vision.CustomVision.Training) | | Data Lake Analytics | NuGet [1.4.211011](https://www.nuget.org/packages/Microsoft.Azure.DataLake.USQL.SDK/1.4.211011) | | | @@ -508,8 +508,8 @@ | Functions extension for Azure SQL and SQL Server | NuGet [3.1.512](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.1.512) | | | | Functions extension for Cosmos DB | NuGet [4.9.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.CosmosDB/4.9.0) | | GitHub [4.9.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/cosmos-v3.0.7/src/WebJobs.Extensions.CosmosDB) | | Functions extension for DocumentDB | NuGet [1.3.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DocumentDB/1.3.0) | | GitHub [1.3.0](https://github.com/Azure/azure-webjobs-sdk-extensions) | -| Functions extension for Durable Task Framework | NuGet [3.4.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.4.0) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.4.0](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | -| Functions extension for Durable Task Framework - isolated worker | NuGet [1.7.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.7.0) | | | +| Functions extension for Durable Task Framework | NuGet [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/3.4.1) | [docs](/dotnet/api/overview/azure/functions) | GitHub [3.4.1](https://github.com/Azure/azure-functions-durable-extension/tree/v2.2.2/src/WebJobs.Extensions.DurableTask) | +| Functions extension for Durable Task Framework - isolated worker | NuGet [1.7.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.7.1) | | | | Functions extension for HTTP | NuGet [3.2.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Http/3.2.0) | | GitHub [3.2.0](https://github.com/Azure/azure-webjobs-sdk-extensions/tree/v3.0.2/src/WebJobs.Extensions.Http) | | Functions extension for IoT Edge | NuGet [1.0.7](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EdgeHub/1.0.7) | | GitHub [1.0.7](https://github.com/Azure/iotedge/tree/1.0.7/edge-hub) | | Functions extension for Kafka | NuGet [4.1.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Kafka/4.1.3) | | GitHub [4.1.3](https://github.com/Azure/azure-functions-kafka-extension/tree/3.0.0/src/Microsoft.Azure.WebJobs.Extensions.Kafka) | diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md index 77f646c42bfb1..e1f66207790e5 100644 --- a/docs/azure/includes/dotnet-new.md +++ b/docs/azure/includes/dotnet-new.md @@ -1,6 +1,6 @@ | Name | Package | Docs | Source | | ---- | ------- | ---- | ------ | -| AI Agents Persistent | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.1.0)
NuGet [1.2.0-beta.1](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.2.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Agents.Persistent-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.1.0/sdk/ai/Azure.AI.Agents.Persistent/)
GitHub [1.2.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.2.0-beta.1/sdk/ai/Azure.AI.Agents.Persistent/) | +| AI Agents Persistent | NuGet [1.1.0](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.1.0)
NuGet [1.2.0-beta.2](https://www.nuget.org/packages/Azure.AI.Agents.Persistent/1.2.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Agents.Persistent-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.1.0/sdk/ai/Azure.AI.Agents.Persistent/)
GitHub [1.2.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Agents.Persistent_1.2.0-beta.2/sdk/ai/Azure.AI.Agents.Persistent/) | | AI Foundry | NuGet [1.0.0-beta.10](https://www.nuget.org/packages/Azure.AI.Projects/1.0.0-beta.10) | [docs](/dotnet/api/overview/azure/AI.Projects-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.10](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects_1.0.0-beta.10/sdk/ai/Azure.AI.Projects/) | | AI Model Inference | NuGet [1.0.0-beta.5](https://www.nuget.org/packages/Azure.AI.Inference/1.0.0-beta.5) | [docs](/dotnet/api/overview/azure/AI.Inference-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.5](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Inference_1.0.0-beta.5/sdk/ai/Azure.AI.Inference/) | | Anomaly Detector | NuGet [3.0.0-preview.7](https://www.nuget.org/packages/Azure.AI.AnomalyDetector/3.0.0-preview.7) | [docs](/dotnet/api/overview/azure/AI.AnomalyDetector-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [3.0.0-preview.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AnomalyDetector_3.0.0-preview.7/sdk/anomalydetector/Azure.AI.AnomalyDetector/) | diff --git a/docs/azure/migration/appmod/faq.md b/docs/azure/migration/appmod/faq.md index ad2cd1ed3a631..36825cd0aa8fa 100644 --- a/docs/azure/migration/appmod/faq.md +++ b/docs/azure/migration/appmod/faq.md @@ -14,11 +14,11 @@ This page answers common questions about [GitHub Copilot app modernization for . ## Which version of Visual Studio should I use? -Upgrade to Visual Studio 2022 version 17.14.7 or later for the best experience with both GitHub Copilot and App Modernization for .NET (Preview). +Upgrade to Visual Studio 2022 version 17.14.11 or later for the best experience with both GitHub Copilot and App Modernization for .NET (Preview). ## Which model should I use in GitHub Copilot agent mode? -Based on our experience, GitHub Copilot and App Modernization for .NET work best with Claude Sonnet 3.7 and Claude Sonnet 4.0. +Based on our benchmark, GitHub Copilot and App Modernization for .NET work best with Claude Sonnet 4.0 then Claude Sonnet 3.7. ## What is the MCP Server, and why is there sometimes an initial delay when running a command? diff --git a/docs/azure/sdk/authentication/credential-chains.md b/docs/azure/sdk/authentication/credential-chains.md index 225a19390c9c5..a8edd152191ec 100644 --- a/docs/azure/sdk/authentication/credential-chains.md +++ b/docs/azure/sdk/authentication/credential-chains.md @@ -2,7 +2,7 @@ title: 'Credential chains in the Azure Identity library for .NET' description: 'This article describes the DefaultAzureCredential and ChainedTokenCredential classes in the Azure Identity library.' ms.topic: concept-article -ms.date: 05/30/2025 +ms.date: 08/13/2025 --- # Credential chains in the Azure Identity library for .NET @@ -13,7 +13,7 @@ The Azure Identity library provides *credentials*—public classes derived f At runtime, a credential chain attempts to authenticate using the sequence's first credential. If that credential fails to acquire an access token, the next credential in the sequence is attempted, and so on, until an access token is successfully obtained. The following sequence diagram illustrates this behavior: -:::image type="content" source="../media/mermaidjs/ChainSequence.svg" alt-text="Credential chain sequence diagram"::: +:::image type="content" source="../media/mermaidjs/chain-sequence.svg" alt-text="Credential chain sequence diagram"::: ## Why use credential chains @@ -37,7 +37,7 @@ There are two disparate philosophies to credential chaining: [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet&preserve-view=true) is an opinionated, preconfigured chain of credentials. It's designed to support many environments, along with the most common authentication flows and developer tools. In graphical form, the underlying chain looks like this: -:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialAuthFlow.svg" alt-text="DefaultAzureCredential auth flowchart"::: +:::image type="content" source="../media/mermaidjs/default-azure-credential-authentication-flow-inline.svg" alt-text="Diagram that shows DefaultAzureCredential authentication flow." lightbox="../media/mermaidjs/default-azure-credential-authentication-flow-expanded.png"::: The order in which `DefaultAzureCredential` attempts credentials follows. @@ -47,19 +47,24 @@ The order in which `DefaultAzureCredential` attempts credentials follows. | 2 | [Workload Identity][wi-cred] |If the app is deployed to an Azure host with Workload Identity enabled, authenticate that account. | Yes | | 3 | [Managed Identity][mi-cred] |If the app is deployed to an Azure host with Managed Identity enabled, authenticate the app to Azure using that Managed Identity. | Yes | | 4 | [Visual Studio][vs-cred] |If the developer authenticated to Azure by logging into Visual Studio, authenticate the app to Azure using that same account. | Yes | -| 5 | [Azure CLI][az-cred] |If the developer authenticated to Azure using Azure CLI's `az login` command, authenticate the app to Azure using that same account. | Yes | -| 6 | [Azure PowerShell][pwsh-cred] |If the developer authenticated to Azure using Azure PowerShell's `Connect-AzAccount` cmdlet, authenticate the app to Azure using that same account. | Yes | -| 7 | [Azure Developer CLI][azd-cred] |If the developer authenticated to Azure using Azure Developer CLI's `azd auth login` command, authenticate with that account. | Yes | -| 8 | [Interactive browser][int-cred] |If enabled, interactively authenticate the developer via the current system's default browser. | No | +| 5 | [Visual Studio Code][vsc-cred] |If the developer authenticated via Visual Studio Code's [Azure Resources extension][vsc-ext] and the [Azure.Identity.Broker package][broker-pkg] is installed, authenticate that account. | Yes | +| 6 | [Azure CLI][az-cred] |If the developer authenticated to Azure using Azure CLI's `az login` command, authenticate the app to Azure using that same account. | Yes | +| 7 | [Azure PowerShell][pwsh-cred] |If the developer authenticated to Azure using Azure PowerShell's `Connect-AzAccount` cmdlet, authenticate the app to Azure using that same account. | Yes | +| 8 | [Azure Developer CLI][azd-cred] |If the developer authenticated to Azure using Azure Developer CLI's `azd auth login` command, authenticate with that account. | Yes | +| 9 | [Interactive browser][int-cred] |If enabled, interactively authenticate the developer via the current system's default browser. | No | +| 10 | [Broker][int-cred] |Authenticates using the default account logged into the OS via a broker. Requires that the [Azure.Identity.Broker package][broker-pkg] is installed. | Yes | [env-cred]: /dotnet/api/azure.identity.environmentcredential?view=azure-dotnet&preserve-view=true [wi-cred]: /dotnet/api/azure.identity.workloadidentitycredential?view=azure-dotnet&preserve-view=true [mi-cred]: /dotnet/api/azure.identity.managedidentitycredential?view=azure-dotnet&preserve-view=true [vs-cred]: /dotnet/api/azure.identity.visualstudiocredential?view=azure-dotnet&preserve-view=true +[vsc-cred]: /dotnet/api/azure.identity.visualstudiocodecredential?view=azure-dotnet&preserve-view=true [az-cred]: /dotnet/api/azure.identity.azureclicredential?view=azure-dotnet&preserve-view=true [pwsh-cred]: /dotnet/api/azure.identity.azurepowershellcredential?view=azure-dotnet&preserve-view=true [azd-cred]: /dotnet/api/azure.identity.azuredeveloperclicredential?view=azure-dotnet&preserve-view=true [int-cred]: /dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet&preserve-view=true +[vsc-ext]: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups +[broker-pkg]: https://www.nuget.org/packages/Azure.Identity.Broker In its simplest form, you can use the parameterless version of `DefaultAzureCredential` as follows: @@ -70,7 +75,7 @@ In its simplest form, you can use the parameterless version of `DefaultAzureCred ### How to customize DefaultAzureCredential -The following sections describe strategies for omitting credentials from the chain. +The following sections describe strategies for controlling which credentials are included in the chain. #### Exclude an individual credential @@ -80,7 +85,7 @@ To exclude an individual credential from `DefaultAzureCredential`, use the corre In the preceding code sample, `EnvironmentCredential`, `ManagedIdentityCredential`, and `WorkloadIdentityCredential` are removed from the credential chain. As a result, the first credential to be attempted is `VisualStudioCredential`. The modified chain contains only development-time credentials and looks like this: -:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialExcludes.svg" alt-text="DefaultAzureCredential using Excludes properties"::: +:::image type="content" source="../media/mermaidjs/default-azure-credential-excludes.svg" alt-text="DefaultAzureCredential using Excludes properties"::: > [!NOTE] > `InteractiveBrowserCredential` is excluded by default and therefore isn't shown in the preceding diagram. To include `InteractiveBrowserCredential`, either pass `true` to constructor or set property to `false`. @@ -101,15 +106,33 @@ As more `Exclude`-prefixed properties are set to `true` (credential exclusions a To exclude all `Developer tool` or `Deployed service` credentials, set environment variable `AZURE_TOKEN_CREDENTIALS` to `prod` or `dev`, respectively. When a value of `prod` is used, the underlying credential chain looks as follows: -:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialEnvVarProd.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'prod'"::: +:::image type="content" source="../media/mermaidjs/default-azure-credential-environment-variable-production.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'prod'"::: When a value of `dev` is used, the chain looks as follows: -:::image type="content" source="../media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'dev'"::: +:::image type="content" source="../media/mermaidjs/default-azure-credential-environment-variable-development.svg" alt-text="DefaultAzureCredential with AZURE_TOKEN_CREDENTIALS set to 'dev'"::: > [!IMPORTANT] > The `AZURE_TOKEN_CREDENTIALS` environment variable is supported in `Azure.Identity` package versions 1.14.0 and later. +#### Use a specific credential + +To exclude all credentials except for one, set environment variable `AZURE_TOKEN_CREDENTIALS` to the credential name. For example, you can reduce the `DefaultAzureCredential` chain to `VisualStudioCredential` by setting `AZURE_TOKEN_CREDENTIALS` to `VisualStudioCredential`. The string comparison is performed in a case-insensitive manner. Valid string values for the environment variable include: + +- `AzureCliCredential` +- `AzureDeveloperCliCredential` +- `AzurePowerShellCredential` +- `BrokerCredential` +- `EnvironmentCredential` +- `InteractiveBrowserCredential` +- `ManagedIdentityCredential` +- `VisualStudioCredential` +- `VisualStudioCodeCredential` +- `WorkloadIdentityCredential` + +> [!IMPORTANT] +> The `AZURE_TOKEN_CREDENTIALS` environment variable supports individual credential names in `Azure.Identity` package versions 1.15.0 and later. + ## ChainedTokenCredential overview [ChainedTokenCredential](/dotnet/api/azure.identity.chainedtokencredential?view=azure-dotnet&preserve-view=true) is an empty chain to which you add credentials to suit your app's needs. For example: @@ -118,7 +141,7 @@ When a value of `dev` is used, the chain looks as follows: The preceding code sample creates a tailored credential chain comprised of two development-time credentials. `AzurePowerShellCredential` is attempted first, followed by `VisualStudioCredential`, if necessary. In graphical form, the chain looks like this: -:::image type="content" source="../media/mermaidjs/ChainedTokenCredentialAuthFlow.svg" alt-text="ChainedTokenCredential"::: +:::image type="content" source="../media/mermaidjs/chained-token-credential-authentication-flow.svg" alt-text="ChainedTokenCredential"::: > [!TIP] > For improved performance, optimize credential ordering in `ChainedTokenCredential` from most to least used credential. diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.svg b/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.svg deleted file mode 100644 index f60052a3a0662..0000000000000 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.svg +++ /dev/null @@ -1 +0,0 @@ -DefaultAzureCredential authentication flow;Flowchart showing the credential chain implemented by DefaultAzureCredential;
CREDENTIALS
Interactive browser
Environment
Workload Identity
Managed Identity
Visual Studio
Azure CLI
Azure PowerShell
Azure Developer CLI
CREDENTIAL TYPES
Interactive
Deployed service
Developer tool
\ No newline at end of file diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg b/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg deleted file mode 100644 index 026493af91987..0000000000000 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg +++ /dev/null @@ -1 +0,0 @@ -DefaultAzureCredential authentication flow without deployed service credentials;Flowchart showing the credential chain implemented by DefaultAzureCredential when AZURE_TOKEN_CREDENTIALS is set to "dev";
Visual Studio
Azure CLI
Azure PowerShell
Azure Developer CLI
\ No newline at end of file diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.svg b/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.svg deleted file mode 100644 index 00a06628cd569..0000000000000 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.svg +++ /dev/null @@ -1 +0,0 @@ -
Visual Studio
Azure CLI
Azure PowerShell
Azure Developer CLI
\ No newline at end of file diff --git a/docs/azure/sdk/media/mermaidjs/ChainSequence.md b/docs/azure/sdk/media/mermaidjs/chain-sequence.md similarity index 89% rename from docs/azure/sdk/media/mermaidjs/ChainSequence.md rename to docs/azure/sdk/media/mermaidjs/chain-sequence.md index 10982f7638ef1..34263ea94ebba 100644 --- a/docs/azure/sdk/media/mermaidjs/ChainSequence.md +++ b/docs/azure/sdk/media/mermaidjs/chain-sequence.md @@ -8,7 +8,7 @@ ms.date: 08/07/2024 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i ChainSequence.md -o ../../media/mermaidjs/ChainSequence.svg +%% 2. Run command: mmdc -i chain-sequence.md -o ../../media/mermaidjs/chain-sequence.svg sequenceDiagram autonumber; diff --git a/docs/azure/sdk/media/mermaidjs/ChainSequence.svg b/docs/azure/sdk/media/mermaidjs/chain-sequence.svg similarity index 100% rename from docs/azure/sdk/media/mermaidjs/ChainSequence.svg rename to docs/azure/sdk/media/mermaidjs/chain-sequence.svg diff --git a/docs/azure/sdk/media/mermaidjs/ChainedTokenCredentialAuthFlow.md b/docs/azure/sdk/media/mermaidjs/chained-token-credential-authentication-flow.md similarity index 80% rename from docs/azure/sdk/media/mermaidjs/ChainedTokenCredentialAuthFlow.md rename to docs/azure/sdk/media/mermaidjs/chained-token-credential-authentication-flow.md index 8c2309d589e15..c64cb398eeb94 100644 --- a/docs/azure/sdk/media/mermaidjs/ChainedTokenCredentialAuthFlow.md +++ b/docs/azure/sdk/media/mermaidjs/chained-token-credential-authentication-flow.md @@ -8,7 +8,7 @@ ms.date: 08/07/2024 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i ChainedTokenCredentialAuthFlow.md -o ../../media/mermaidjs/ChainedTokenCredentialAuthFlow.svg +%% 2. Run command: mmdc -i chained-token-credential-authentication-flow.md -o ../../media/mermaidjs/chained-token-credential-authentication-flow.svg %%{ init: { diff --git a/docs/azure/sdk/media/mermaidjs/ChainedTokenCredentialAuthFlow.svg b/docs/azure/sdk/media/mermaidjs/chained-token-credential-authentication-flow.svg similarity index 100% rename from docs/azure/sdk/media/mermaidjs/ChainedTokenCredentialAuthFlow.svg rename to docs/azure/sdk/media/mermaidjs/chained-token-credential-authentication-flow.svg diff --git a/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-expanded.png b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-expanded.png new file mode 100644 index 0000000000000..a23ccca289781 Binary files /dev/null and b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-expanded.png differ diff --git a/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-inline.svg b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-inline.svg new file mode 100644 index 0000000000000..1ae54d26a09b6 --- /dev/null +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow-inline.svg @@ -0,0 +1 @@ +DefaultAzureCredential authentication flow;Flowchart showing the credential chain implemented by DefaultAzureCredential;
CREDENTIALS
Broker
Environment
Workload Identity
Managed Identity
Visual Studio
Visual Studio Code
Azure CLI
Azure PowerShell
Azure Developer CLI
Interactive browser
CREDENTIAL TYPES
Interactive
Deployed service
Developer tool
\ No newline at end of file diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.md b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow.md similarity index 67% rename from docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.md rename to docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow.md index 377eb05685e99..4b5b98c6eeea9 100644 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialAuthFlow.md +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-authentication-flow.md @@ -1,6 +1,6 @@ --- ms.topic: include -ms.date: 08/07/2024 +ms.date: 08/13/2025 --- ```mermaid @@ -8,7 +8,9 @@ ms.date: 08/07/2024 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i DefaultAzureCredentialAuthFlow.md -o ../../media/mermaidjs/DefaultAzureCredentialAuthFlow.svg +%% 2. Run commands: +%% mmdc -i default-azure-credential-authentication-flow.md -o ../../media/mermaidjs/default-azure-credential-authentication-flow-inline.svg +%% mmdc -i default-azure-credential-authentication-flow.md -o ../../media/mermaidjs/default-azure-credential-authentication-flow-expanded.png -w 1156 %%{ init: { @@ -31,7 +33,16 @@ flowchart LR; subgraph CREDENTIALS; direction LR; - A(Environment):::deployed --> B(Workload Identity):::deployed --> C(Managed Identity):::deployed --> D(Visual Studio):::developer --> E(Azure CLI):::developer --> F(Azure PowerShell):::developer --> G(Azure Developer CLI):::developer --> H(Interactive browser):::interactive; + A(Environment):::deployed --> + B(Workload Identity):::deployed --> + C(Managed Identity):::deployed --> + D(Visual Studio):::developer --> + E(Visual Studio Code):::developer --> + F(Azure CLI):::developer --> + G(Azure PowerShell):::developer --> + H(Azure Developer CLI):::developer --> + I(Interactive browser):::interactive --> + J(Broker):::developer; end; %% Define styles for credential type boxes @@ -44,8 +55,10 @@ flowchart LR; click B "https://learn.microsoft.com/dotnet/api/azure.identity.workloadidentitycredential?view=azure-dotnet" _blank; click C "https://learn.microsoft.com/dotnet/api/azure.identity.managedidentitycredential?view=azure-dotnet" _blank; click D "https://learn.microsoft.com/dotnet/api/azure.identity.visualstudiocredential?view=azure-dotnet" _blank; - click E "https://learn.microsoft.com/dotnet/api/azure.identity.azureclicredential?view=azure-dotnet" _blank; - click F "https://learn.microsoft.com/dotnet/api/azure.identity.azurepowershellcredential?view=azure-dotnet" _blank; - click G "https://learn.microsoft.com/dotnet/api/azure.identity.azuredeveloperclicredential?view=azure-dotnet" _blank - click H "https://learn.microsoft.com/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet" _blank; + click E "https://learn.microsoft.com/dotnet/api/azure.identity.visualstudiocodecredential?view=azure-dotnet" _blank; + click F "https://learn.microsoft.com/dotnet/api/azure.identity.azureclicredential?view=azure-dotnet" _blank; + click G "https://learn.microsoft.com/dotnet/api/azure.identity.azurepowershellcredential?view=azure-dotnet" _blank; + click H "https://learn.microsoft.com/dotnet/api/azure.identity.azuredeveloperclicredential?view=azure-dotnet" _blank + click I "https://learn.microsoft.com/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet" _blank; + click J "https://learn.microsoft.com/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet" _blank; ``` diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.md b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.md similarity index 66% rename from docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.md rename to docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.md index 000a536963b79..3407e948165d8 100644 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarDev.md +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.md @@ -1,6 +1,6 @@ --- ms.topic: include -ms.date: 05/30/2025 +ms.date: 08/13/2025 --- ```mermaid @@ -8,7 +8,7 @@ ms.date: 05/30/2025 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i DefaultAzureCredentialEnvVarDev.md -o ../../media/mermaidjs/DefaultAzureCredentialEnvVarDev.svg +%% 2. Run command: mmdc -i default-azure-credential-environment-variable-development.md -o ../../media/mermaidjs/default-azure-credential-environment-variable-development.svg %%{ init: { @@ -24,7 +24,11 @@ flowchart LR; accTitle: DefaultAzureCredential authentication flow without deployed service credentials; accDescr: Flowchart showing the credential chain implemented by DefaultAzureCredential when AZURE_TOKEN_CREDENTIALS is set to "dev"; - D(Visual Studio):::developer --> E(Azure CLI):::developer --> F(Azure PowerShell):::developer --> G(Azure Developer CLI):::developer; + D(Visual Studio):::developer --> + E(Visual Studio Code):::developer --> + F(Azure CLI):::developer --> + G(Azure PowerShell):::developer --> + H(Azure Developer CLI):::developer; %% Define styles for credential type boxes classDef developer fill:#F5AF6F, stroke:#EB7C39, stroke-width:2px; diff --git a/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.svg b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.svg new file mode 100644 index 0000000000000..37abe7a4cd41d --- /dev/null +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-development.svg @@ -0,0 +1 @@ +DefaultAzureCredential authentication flow without deployed service credentials;Flowchart showing the credential chain implemented by DefaultAzureCredential when AZURE_TOKEN_CREDENTIALS is set to "dev";
Visual Studio
Visual Studio Code
Azure CLI
Azure PowerShell
Azure Developer CLI
\ No newline at end of file diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarProd.md b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-production.md similarity index 83% rename from docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarProd.md rename to docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-production.md index ad6b7a68ca6b7..38dc715d8b354 100644 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarProd.md +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-production.md @@ -8,7 +8,7 @@ ms.date: 05/30/2025 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i DefaultAzureCredentialEnvVarProd.md -o ../../media/mermaidjs/DefaultAzureCredentialEnvVarProd.svg +%% 2. Run command: mmdc -i default-azure-credential-environment-variable-production.md -o ../../media/mermaidjs/default-azure-credential-environment-variable-production.svg %%{ init: { diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarProd.svg b/docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-production.svg similarity index 100% rename from docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialEnvVarProd.svg rename to docs/azure/sdk/media/mermaidjs/default-azure-credential-environment-variable-production.svg diff --git a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.md b/docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.md similarity index 58% rename from docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.md rename to docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.md index 2d4c4075bbdf8..09a08604e4f03 100644 --- a/docs/azure/sdk/media/mermaidjs/DefaultAzureCredentialExcludes.md +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.md @@ -1,6 +1,6 @@ --- ms.topic: include -ms.date: 08/07/2024 +ms.date: 08/13/2025 --- ```mermaid @@ -8,7 +8,7 @@ ms.date: 08/07/2024 %% ======================= %% 1. Install mermaid CLI v10.9.1 (see https://github.com/mermaid-js/mermaid-cli/blob/master/README.md): %% npm i -g @mermaid-js/mermaid-cli@10.9.1 -%% 2. Run command: mmdc -i DefaultAzureCredentialExcludes.md -o ../../media/mermaidjs/DefaultAzureCredentialExcludes.svg +%% 2. Run command: mmdc -i default-azure-credential-excludes.md -o ../../media/mermaidjs/default-azure-credential-excludes.svg %%{ init: { @@ -21,7 +21,12 @@ ms.date: 08/07/2024 }%% flowchart LR; - D(Visual Studio):::developer --> E(Azure CLI):::developer --> F(Azure PowerShell):::developer --> G(Azure Developer CLI):::developer; + D(Visual Studio):::developer --> + E(Visual Studio Code):::developer --> + F(Azure CLI):::developer --> + G(Azure PowerShell):::developer --> + H(Azure Developer CLI):::developer --> + I(Broker):::developer; %% Define styles for credential type boxes classDef developer fill:#F5AF6F, stroke:#EB7C39, stroke-width:2px; diff --git a/docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.svg b/docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.svg new file mode 100644 index 0000000000000..2977fac7f0d16 --- /dev/null +++ b/docs/azure/sdk/media/mermaidjs/default-azure-credential-excludes.svg @@ -0,0 +1 @@ +
Visual Studio
Visual Studio Code
Azure CLI
Azure PowerShell
Azure Developer CLI
Broker
\ No newline at end of file diff --git a/docs/azure/sdk/snippets/authentication/Directory.Packages.props b/docs/azure/sdk/snippets/authentication/Directory.Packages.props index 395eed4ec48fc..3f5eeca58a0e7 100644 --- a/docs/azure/sdk/snippets/authentication/Directory.Packages.props +++ b/docs/azure/sdk/snippets/authentication/Directory.Packages.props @@ -8,7 +8,7 @@ - + @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/docs/azure/sdk/snippets/authentication/credential-chains/Program.cs b/docs/azure/sdk/snippets/authentication/credential-chains/Program.cs index 819ac45d1411d..81b83a5efccda 100644 --- a/docs/azure/sdk/snippets/authentication/credential-chains/Program.cs +++ b/docs/azure/sdk/snippets/authentication/credential-chains/Program.cs @@ -92,8 +92,10 @@ ExcludeEnvironmentCredential = true, ExcludeWorkloadIdentityCredential = true, ExcludeManagedIdentityCredential = true, + ExcludeVisualStudioCodeCredential = true, ExcludeAzurePowerShellCredential = true, ExcludeAzureDeveloperCliCredential = true, + ExcludeBrokerCredential = true, }); #endregion diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 977850788700c..1dde5f41d1b7a 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -48,6 +48,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | [LDAP DirectoryControl parsing is now more stringent](core-libraries/10.0/ldap-directorycontrol-parsing.md) | Behavioral change | Preview 1 | | [MacCatalyst version normalization](core-libraries/10.0/maccatalyst-version-normalization.md) | Behavioral change | Preview 1 | | [.NET runtime no longer provides default SIGTERM signal handler](core-libraries/10.0/sigterm-signal-handler.md) | Behavioral change | Preview 5 | +| [Explicit struct Size disallowed with InlineArray](core-libraries/10.0/inlinearray-explicit-size-disallowed.md) | Binary incompatible | Preview 7 | | [System.Linq.AsyncEnumerable included in core libraries](core-libraries/10.0/asyncenumerable.md) | Source incompatible | Preview 1 | | [YMM embedded rounding removed from AVX10.2](core-libraries/10.0/ymm-embedded-rounding.md) | Behavioral change | Preview 5 | @@ -101,6 +102,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | Title | Type of change | Introduced version | |-------|-------------------|--------------------| | [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 | +| [.NET tool packaging invokes Publish instead of Build](sdk/10.0/dotnet-tool-pack-publish.md) | Behavioral change | Preview 6 | | [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 | | [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | Preview 4 | | [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 | diff --git a/docs/core/compatibility/core-libraries/10.0/inlinearray-explicit-size-disallowed.md b/docs/core/compatibility/core-libraries/10.0/inlinearray-explicit-size-disallowed.md new file mode 100644 index 0000000000000..1ef24bce82d94 --- /dev/null +++ b/docs/core/compatibility/core-libraries/10.0/inlinearray-explicit-size-disallowed.md @@ -0,0 +1,47 @@ +--- +title: "Breaking change: Specifying explicit struct Size disallowed with InlineArray" +description: "Learn about the breaking change in .NET 10 where specifying explicit Size to a struct decorated with InlineArrayAttribute now throws TypeLoadException." +ms.date: 08/08/2025 +ai-usage: ai-assisted +--- + +# Specifying explicit struct Size disallowed with InlineArray + +Applying explicit `Size` to a struct decorated with is ambiguous and no longer supported in the type loader. Previously, specifying explicit `Size` would result in implementation-specific behavior that might or might not match user expectations. + +## Version introduced + +.NET 10 Preview 7 + +## Previous behavior + +Previously, specifying on a struct decorated with was allowed, but resulted in implementation-specific behavior that might or might not match user expectations. + +```csharp +[InlineArray(8)] +[StructLayout(LayoutKind.Explicit, Size=32)] +struct Int8InlineArray +{ + private int _value; +} +``` + +## New behavior + +Starting in .NET 10, specifying on a struct decorated with is disallowed. If you attempt to create an instance of such a struct, you'll get a . + +## Type of breaking change + +This change can affect [binary compatibility](../../categories.md#binary-compatibility). + +## Reason for change + +Specifying for an inline array struct is ambiguous and any interpretation would contradict the specification. + +## Recommended action + +In the unlikely case you need to specify explicit size either for the array element or for the whole inline array, introduce a struct wrapping the element type or the whole array type. In the layout of the wrapper, specify accordingly. + +## Affected APIs + +- Type loader diff --git a/docs/core/compatibility/sdk/10.0/dotnet-tool-pack-publish.md b/docs/core/compatibility/sdk/10.0/dotnet-tool-pack-publish.md new file mode 100644 index 0000000000000..6263d81483d88 --- /dev/null +++ b/docs/core/compatibility/sdk/10.0/dotnet-tool-pack-publish.md @@ -0,0 +1,43 @@ +--- +title: "Breaking change: .NET tool packaging invokes Publish instead of Build" +description: "Learn about the breaking change in the .NET 10 SDK where .NET tool packaging changed from invoking Build to Publish, affecting included assets." +ms.date: 08/11/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/47916 +--- + +# .NET tool packaging invokes Publish instead of Build + +The .NET tool packaging process changed from invoking the MSBuild `Build` target to the `Publish` target (logically, not precisely). This means that assets that are included in `Publish` but not in `Build`, like WebSDK StaticWebAssets, now appear in tool packages by default. If you explicitly copied those files into place, you might begin to receive build diagnostics warning of duplicate copies. + +## Version introduced + +.NET 10 Preview 6 + +## Previous behavior + +Previously when you ran `dotnet pack` on a project with `PackAsTool` set to `true`, it invoked the `Build` target, and only `Build`-created assets were included in the package. + +## New behavior + +Starting in .NET 10, the tool packaging process invokes the `Publish` target, which means `Publish`-created assets are included in the package. This includes StaticWebAssets and minified and trimmed application assets. + +## Type of breaking change + +This is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +This change enables the creation of optimized, platform-specific .NET Tool packages, and supports use cases like: + +- Self-contained tools. +- Trimmed and AOT tools. +- Tools that can eventually be used on platforms without an SDK or runtime installed. + +## Recommended action + +If your project is impacted, remove any explicit file copy customizations. + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 12ac61b9f56bb..c4574a3003604 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -54,6 +54,8 @@ items: href: core-libraries/10.0/maccatalyst-version-normalization.md - name: No default SIGTERM signal handler href: core-libraries/10.0/sigterm-signal-handler.md + - name: Explicit struct Size disallowed with InlineArray + href: core-libraries/10.0/inlinearray-explicit-size-disallowed.md - name: System.Linq.AsyncEnumerable included in core libraries href: core-libraries/10.0/asyncenumerable.md - name: YMM embedded rounding removed from AVX10.2 @@ -106,6 +108,8 @@ items: items: - name: .NET CLI `--interactive` defaults to `true` in user scenarios href: sdk/10.0/dotnet-cli-interactive.md + - name: .NET tool packaging invokes Publish instead of Build + href: sdk/10.0/dotnet-tool-pack-publish.md - name: "`dotnet restore` audits transitive packages" href: sdk/10.0/nugetaudit-transitive-packages.md - name: Default workload configuration from 'loose manifests' to 'workload sets' mode diff --git a/docs/orleans/grains/transactions.md b/docs/orleans/grains/transactions.md index c37236993e58b..16692735105db 100644 --- a/docs/orleans/grains/transactions.md +++ b/docs/orleans/grains/transactions.md @@ -20,7 +20,7 @@ Orleans transactions are opt-in. Both the silo and the client must be configured ```csharp var builder = Host.CreateDefaultBuilder(args) - UseOrleans((context, siloBuilder) => + .UseOrleans((context, siloBuilder) => { siloBuilder.UseTransactions(); }); @@ -30,7 +30,7 @@ Likewise, to enable transactions on the client, call + .UseOrleansClient((context, clientBuilder) => { clientBuilder.UseTransactions(); }); diff --git a/docs/standard/commandline/get-started-tutorial.md b/docs/standard/commandline/get-started-tutorial.md index 0621c07245f7a..807d88f7f5f9e 100644 --- a/docs/standard/commandline/get-started-tutorial.md +++ b/docs/standard/commandline/get-started-tutorial.md @@ -1,7 +1,7 @@ --- title: "Tutorial: Get started with System.CommandLine" description: Learn how to use the System.CommandLine library for command-line apps. -ms.date: 04/07/2022 +ms.date: 08/13/2025 ms.topic: tutorial no-loc: [System.CommandLine] helpviewer_keywords: @@ -166,7 +166,7 @@ Options: --file The file to read and display on the conso ``` - by default provides [Help option](how-to-customize-help.md#customize-help-output), [Version option](syntax.md#version-option), and [Suggest directive](syntax.md#suggest-directive). The method is responsible for invoking the action of parsed symbol. It could be the action explicitly defined for the command, or the help action defined by `System.CommandLine` for `System.CommandLine.Help.HelpOption`. Moreover, when it detects any parse errors, it prints them to the standard error, prints help to standard output, and returns `1` as the exit code: + by default provides [Help option](how-to-customize-help.md#customize-help-output), [Version option](syntax.md#version-option), and [Suggest directive](syntax.md#suggest-directive). The method is responsible for invoking the action of parsed symbol. It could be the action explicitly defined for the command, or the help action defined by `System.CommandLine` for `System.CommandLine.Help.HelpOption`. Moreover, when it detects any parse errors, it prints them to the standard error, prints help to standard output, and returns `1` as the exit code: ```console scl --invalid bla diff --git a/docs/standard/commandline/how-to-configure-the-parser.md b/docs/standard/commandline/how-to-configure-the-parser.md index 2d82fc3f87edd..c7d2bd35a0edb 100644 --- a/docs/standard/commandline/how-to-configure-the-parser.md +++ b/docs/standard/commandline/how-to-configure-the-parser.md @@ -14,41 +14,41 @@ ms.topic: how-to [!INCLUDE [scl-preview](./includes/preview.md)] - is a class that provides properties to configure the parser. It is an optional argument for every `Parse` method, such as and . When it isn't provided, the default configuration is used. + is a class that provides properties to configure the parser. It is an optional argument for every `Parse` method, such as and . When it isn't provided, the default configuration is used. has a property that returns the configuration used for parsing. ## Standard output and error -`CommandLineConfiguration` makes testing, as well as many extensibility scenarios, easier than using `System.Console`. It exposes two `TextWriter` properties: `Output` and `Error`. These can be set to any `TextWriter` instance, such as a `StringWriter`, which can be used to capture output for testing. + makes testing, as well as many extensibility scenarios, easier than using `System.Console`. It exposes two `TextWriter` properties: and . You can set these properties to any `TextWriter` instance, such as a `StringWriter`, which you can use to capture output for testing. Define a simple command that writes to standard output: :::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="rootcommand"::: -Now, use `CommandLineConfiguration` to capture the output: +Now, use to capture the output: :::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="captureoutput"::: ## EnablePosixBundling -[Bundling](syntax.md#option-bundling) of single-character options is enabled by default, but you can disable it by setting the `System.CommandLine.CommandLineConfiguration.EnablePosixBundling` property to `false`. +[Bundling](syntax.md#option-bundling) of single-character options is enabled by default, but you can disable it by setting the property to `false`. ## ProcessTerminationTimeout -[Process termination timeout](how-to-parse-and-invoke.md#process-termination-timeout) can be configured via the `System.CommandLine.CommandLineConfiguration.ProcessTerminationTimeout` property. The default value is 2 seconds. +[Process termination timeout](how-to-parse-and-invoke.md#process-termination-timeout) can be configured via the property. The default value is 2 seconds. ## ResponseFileTokenReplacer -[Response files](syntax.md#response-files) are enabled by default, but you can disable them by setting the `System.CommandLine.CommandLineConfiguration.ResponseFileTokenReplacer` property to `null`. You can also provide a custom implementation to customize how response files are processed. +[Response files](syntax.md#response-files) are enabled by default, but you can disable them by setting the property to `null`. You can also provide a custom implementation to customize how response files are processed. ## EnableDefaultExceptionHandler -By default, all unhandled exceptions thrown during the invocation of a command are caught and reported to the user. This behavior can be disabled by setting the `System.CommandLine.CommandLineConfiguration.EnableDefaultExceptionHandler` property to `false`. This is useful when you want to handle exceptions in a custom way, such as logging them or providing a different user experience. +By default, all unhandled exceptions thrown during the invocation of a command are caught and reported to the user. You can disable this behavior by setting the property to `false`. This is useful when you want to handle exceptions in a custom way, such as logging them or providing a different user experience. ## Derived classes -`System.CommandLine.CommandLineConfiguration` is not sealed, so you can derive from it to add custom properties or methods. This is useful when you want to provide additional configuration options specific to your application. + is not sealed, so you can derive from it to add custom properties or methods. This is useful when you want to provide additional configuration options specific to your application. ## See also diff --git a/docs/standard/commandline/how-to-parse-and-invoke.md b/docs/standard/commandline/how-to-parse-and-invoke.md index 8992e22c7df3d..b346f31794555 100644 --- a/docs/standard/commandline/how-to-parse-and-invoke.md +++ b/docs/standard/commandline/how-to-parse-and-invoke.md @@ -53,7 +53,7 @@ This overload of `GetValue` gets the parsed or default value for the specified s The property contains a list of parse errors that occurred during the parsing process. Each error is represented by a object, which contains information about the error, such as the error message and the token that caused the error. -When you call the method, it returns an exit code that indicates whether the parsing was successful or not. If there were any parse errors, the exit code is non-zero, and all the parse errors are printed to the standard error. +When you call the method, it returns an exit code that indicates whether the parsing was successful or not. If there were any parse errors, the exit code is non-zero, and all the parse errors are printed to the standard error. If you don't call the `ParseResult.Invoke` method, you need to handle the errors on your own, for example, by printing them: @@ -85,7 +85,7 @@ You don't need to create a derived type to define an action. You can use the ` exit code. Moreover, the that's passed to the action delegate needs to be passed further to all the methods that can be canceled, such as file I/O operations or network requests. -You also need to ensure that the method is used instead of `Invoke`. This method is asynchronous and returns a `Task` exit code. It also accepts an optional parameter that can be used to cancel the action. +You also need to ensure that the method is used instead of `Invoke`. This method is asynchronous and returns a `Task` exit code. It also accepts an optional parameter that can be used to cancel the action. The following code uses a `SetAction` overload that gets a [ParseResult](#parseresult) and a rather than just `ParseResult`: @@ -93,7 +93,7 @@ The following code uses a `SetAction` overload that gets a [ParseResult](#parser #### Process termination timeout - enables signaling and handling of process termination (Ctrl+C, `SIGINT`, `SIGTERM`) via a that's passed to every async action during invocation. It's enabled by default (2 seconds), but you can set it to `null` to disable it. + enables signaling and handling of process termination (Ctrl+C, `SIGINT`, `SIGTERM`) via a that's passed to every async action during invocation. It's enabled by default (2 seconds), but you can set it to `null` to disable it. When enabled, if the action doesn't complete within the specified timeout, the process will be terminated. This is useful for handling the termination gracefully, for example, by saving the state before the process is terminated. diff --git a/docs/standard/commandline/migration-guide-2.0.0-beta5.md b/docs/standard/commandline/migration-guide-2.0.0-beta5.md index 0b1b07ae07052..db04358698e38 100644 --- a/docs/standard/commandline/migration-guide-2.0.0-beta5.md +++ b/docs/standard/commandline/migration-guide-2.0.0-beta5.md @@ -1,7 +1,7 @@ --- -title: System.CommandLine migration guide to 2.0.0-beta5 -description: "Learn about how to migrate to System.CommandLine 2.0.0-beta5." -ms.date: 06/19/2025 +title: System.CommandLine migration guide to 2.0.0-beta5+ +description: "Learn about how to migrate to System.CommandLine 2.0.0-beta5+." +ms.date: 08/13/2025 no-loc: [System.CommandLine] helpviewer_keywords: - "command line interface" @@ -9,15 +9,15 @@ helpviewer_keywords: - "System.CommandLine" --- -# System.CommandLine 2.0.0-beta5 migration guide +# System.CommandLine 2.0.0-beta5+ migration guide [!INCLUDE [scl-preview](./includes/preview.md)] -The main focus for the 2.0.0-beta5 release was to improve the APIs and take a step toward releasing a stable version of System.CommandLine. The APIs have been simplified and made more coherent and consistent with the [Framework design guidelines](../design-guidelines/index.md). This article describes the breaking changes that were made in 2.0.0-beta5 and the reasoning behind them. +The main focus for the 2.0.0-beta5 release was to improve the APIs and take a step toward releasing a stable version of System.CommandLine. The APIs have been simplified and made more coherent and consistent with the [Framework design guidelines](../design-guidelines/index.md). This article describes the breaking changes that were made in 2.0.0-beta5 and 2.0.0-beta7, and the reasoning behind them. ## Renaming -In 2.0.0-beta4, not all types and members followed the [naming guidelines](../design-guidelines/naming-guidelines.md). Some were not consistent with the naming conventions, such as using the `Is` prefix for Boolean properties. In 2.0.0-beta5, some types and members have been renamed. The following table shows the old and new names: +In 2.0.0-beta4, not all types and members followed the [naming guidelines](../design-guidelines/naming-guidelines.md). Some weren't consistent with the naming conventions, such as using the `Is` prefix for Boolean properties. In 2.0.0-beta5, some types and members have been renamed. The following table shows the old and new names: | Old name | New name | |--------------------------------------------------------|----------------------------------------------------------------| @@ -56,14 +56,14 @@ The `RemoveAlias` and `HasAlias` methods were also removed, as the `Aliases` pro ## Names and aliases -Before 2.0.0-beta5, there was no clear separation between the name and [aliases](syntax.md#aliases) of a symbol. When `name` was not provided for the `Option` constructor, the symbol reported its name as the longest alias with prefixes like `--`, `-`, or `/` removed. That was confusing. +Before 2.0.0-beta5, there was no clear separation between the name and [aliases](syntax.md#aliases) of a symbol. When `name` wasn't provided for the `Option` constructor, the symbol reported its name as the longest alias with prefixes like `--`, `-`, or `/` removed. That was confusing. -Moreover, to get the parsed value, users had to store a reference to an option or an argument and then use it to get the value from `ParseResult`. +Moreover, to get the parsed value, you had to store a reference to an option or an argument and then use it to get the value from `ParseResult`. To promote simplicity and explicitness, the name of a symbol is now a mandatory parameter for every symbol constructor (including `Argument`). The concept of a name and aliases is now separate: aliases are just aliases and don't include the name of the symbol. Of course, they're optional. As a result, the following changes were made: - `name` is now a mandatory argument for every public constructor of , , and . In the case of `Argument`, it isn't used for parsing, but to generate the help. In the case of `Option` and `Command`, it's used to identify the symbol during parsing and also for help and completions. -- The `Symbol.Name` property is no longer `virtual`; it's now read-only and returns the name as it was provided when the symbol was created. Because of that, `Symbol.DefaultName` was removed and `Option.Name` no longer removes the `--`, `-`, or `/` or any other prefix from the longest alias. +- The property is no longer `virtual`; it's now read-only and returns the name as it was provided when the symbol was created. Because of that, `Symbol.DefaultName` was removed and no longer removes the `--`, `-`, or `/` or any other prefix from the longest alias. - The `Aliases` property exposed by [`Option`](xref:System.CommandLine.Option.Aliases) and [`Command`](xref:System.CommandLine.Command.Aliases) is now a mutable collection. This collection no longer includes the name of the symbol. - `System.CommandLine.Parsing.IdentifierSymbol` was removed (it was a base type for both `Command` and `Option`). @@ -81,11 +81,11 @@ int number = parseResult.GetValue("--number"); ### Creating options with aliases -In the past, `Option` exposed many constructors, some of which accepted the name. Since the name is now mandatory and aliases will frequently be provided for `Option`, there's only a single constructor. It accepts the name and a `params` array of aliases. +In the past, exposed many constructors, some of which accepted the name. Since the name is now mandatory and aliases will frequently be provided for `Option`, there's only a single constructor. It accepts the name and a `params` array of aliases. Before 2.0.0-beta5, `Option` had a constructor that took a name and a description. Because of that, the second argument might now be treated as an alias rather than a description. It's the only known breaking change in the API that doesn't cause a compiler error. -Old code that used the constructor with a description should be updated to use the new constructor that takes a name and aliases, and then set the `Description` property separately. For example: +Update any code that passed a description to the constructor to use the new constructor that takes a name and aliases, and then set the `Description` property separately. For example: ```csharp Option beta4 = new("--help", "An option with aliases."); @@ -100,16 +100,17 @@ Option beta5 = new("--help", "-h", "/h") ## Default values and custom parsing -In 2.0.0-beta4, you could set default values for options and arguments by using the `SetDefaultValue` methods. Those methods accepted an `object` value, which wasn't type-safe and could lead to run-time errors if the value was not compatible with the option or argument type: +In 2.0.0-beta4, you could set default values for options and arguments by using the `SetDefaultValue` methods. Those methods accepted an `object` value, which wasn't type safe and could lead to run-time errors if the value wasn't compatible with the option or argument type: ```csharp Option option = new("--number"); -option.SetDefaultValue("text"); // This is not type-safe, as the value is a string, not an int. +// This is not type safe, as the value is a string, not an int: +option.SetDefaultValue("text"); ``` -Moreover, some of the `Option` and `Argument` constructors accepted a parse delegate and a Boolean indicating whether the delegate was a custom parser or a default value provider. This was confusing. +Moreover, some of the `Option` and `Argument` constructors accepted a parse delegate and a Boolean indicating whether the delegate was a custom parser or a default value provider, which was confusing. -`Option` and `Argument` classes now have a property that can be used to set a delegate that can be called to get the default value for the option or argument. This delegate is invoked when the option or argument is not found in the parsed command line input. +`Option` and `Argument` classes now have a property that you can use to set a delegate that can be called to get the default value for the option or argument. This delegate is invoked when the option or argument isn't found in the parsed command-line input. ```csharp Option number = new("--number") @@ -118,7 +119,7 @@ Option number = new("--number") }; ``` -`Argument` and `Option` also come with a property that can be used to set a custom parser for the symbol: +`Argument` and `Option` also come with a property that you can use to set a custom parser for the symbol: ```csharp Argument uri = new("arg") @@ -140,34 +141,34 @@ Moreover, `CustomParser` accepts a delegate of type `Func`, rathe For more examples of how to use `DefaultValueFactory` and `CustomParser`, see [How to customize parsing and validation in System.CommandLine](how-to-customize-parsing-and-validation.md). -## The separation of parsing and invocation +## Separation of parsing and invocation -In 2.0.0-beta4, it was possible to separate the parsing and invoking of commands, but it wasn't clear how to do it. `Command` did not expose a `Parse` method, but `CommandExtensions` provided `Parse`, `Invoke`, and `InvokeAsync` extension methods for `Command`. This was confusing, as it was not clear which method to use and when. The following changes were made to simplify the API: +In 2.0.0-beta4, it was possible to separate the parsing and invoking of commands, but it wasn't clear how to do it. `Command` didn't expose a `Parse` method, but `CommandExtensions` provided `Parse`, `Invoke`, and `InvokeAsync` extension methods for `Command`. This was confusing, as it wasn't clear which method to use and when. The following changes were made to simplify the API: -- `Command` now exposes a `Parse` method that returns a `ParseResult` object. This method is used to parse the command line input and return the result of the parse operation. Moreover, it makes it clear that the command is not invoked, but only parsed and only in synchronous manner. -- `ParseResult` now exposes both `Invoke` and `InvokeAsync` methods that can be used to invoke the command. This makes it clear that the command is invoked after parsing, and allows for both synchronous and asynchronous invocation. +- now exposes a `Parse` method that returns a `ParseResult` object. This method is used to parse the command-line input and return the result of the parse operation. Moreover, it makes it clear that the command isn't invoked but parsed, and only in synchronous manner. +- `ParseResult` now exposes both `Invoke` and `InvokeAsync` methods that you can use to invoke the command. This pattern makes it clear that the command is invoked after parsing, and allows for both synchronous and asynchronous invocation. - The `CommandExtensions` class was removed, as it's no longer needed. ### Configuration Before 2.0.0-beta5, it was possible to customize the parsing, but only with some of the public `Parse` methods. There was a `Parser` class that exposed two public constructors: one accepting a `Command` and another accepting a `CommandLineConfiguration`. `CommandLineConfiguration` was immutable, and to create it, you had to use a builder pattern exposed by the `CommandLineBuilder` class. The following changes were made to simplify the API: -- `CommandLineConfiguration` was made mutable and `CommandLineBuilder` was removed. Creating a configuration is now as simple as creating an instance of `CommandLineConfiguration` and setting the properties you want to customize. Moreover, creating a new instance of configuration is the equivalent of calling `CommandLineBuilder`'s `UseDefaults` method. -- Every `Parse` method now accepts an optional `CommandLineConfiguration` parameter that can be used to customize the parsing. When it's not provided, the default configuration is used. -- `Parser` was renamed to `CommandLineParser` to disambiguate from other parser types to avoid name conflicts. Since it's stateless, it's now a static class with only static methods. It exposes two `Parse` parse methods: one accepting a `IReadOnlyList args` and another accepting a `string args`. The latter uses `CommandLineParser.SplitCommandLine` (also public) to split the command line input into [tokens](syntax.md#tokens) before parsing it. +- `CommandLineConfiguration` was split into two *mutable* classes (in 2.0.0-beta7): and . Creating an invocation configuration is now as simple as creating an instance of `InvocationConfiguration` and setting the properties you want to customize. +- Every `Parse` method now accepts an optional parameter that you can use to customize the parsing. When it isn't provided, the default configuration is used. +- To avoid name conflicts, `Parser` was renamed to to disambiguate from other parser types. Since it's stateless, it's now a static class with only static methods. It exposes two `Parse` parse methods: one accepting an `IReadOnlyList args` and another accepting a `string args`. The latter uses (also public) to split the command line input into [tokens](syntax.md#tokens) before parsing it. `CommandLineBuilderExtensions` was also removed. Here is how you can map its methods to the new APIs: -- `CancelOnProcessTermination` is now a property of `CommandLineConfiguration` called [ProcessTerminationTimeout](how-to-parse-and-invoke.md#process-termination-timeout). It's enabled by default, with a 2s timeout. Set it to `null` to disable it. -- `EnableDirectives`, `UseEnvironmentVariableDirective`, `UseParseDirective`, and `UseSuggestDirective` were removed. A new [Directive](syntax.md#directives) type was introduced and the [RootCommand](syntax.md#root-command) now exposes `System.CommandLine.RootCommand.Directives` property. You can add, remove, and iterate directives by using this collection. [Suggest directive](syntax.md#suggest-directive) is included by default; you can also use other directives like [DiagramDirective](syntax.md#the-diagram-directive) or `EnvironmentVariablesDirective`. -- `EnableLegacyDoubleDashBehavior` was removed. All unmatched tokens are now exposed by the [ParseResult.UnmatchedTokens](how-to-parse-and-invoke.md#unmatched-tokens) property. -- `EnablePosixBundling` was removed. The bundling is now enabled by default, you can disable it by setting the [CommandLineConfiguration.EnableBundling](how-to-configure-the-parser.md#enableposixbundling) property to `false`. +- `CancelOnProcessTermination` is now a property of called . It's enabled by default, with a 2 second timeout. To disable it, set it to `null`. For more information, see [Process termination timeout](how-to-parse-and-invoke.md#process-termination-timeout). +- `EnableDirectives`, `UseEnvironmentVariableDirective`, `UseParseDirective`, and `UseSuggestDirective` were removed. A new [Directive](syntax.md#directives) type was introduced and [RootCommand](syntax.md#root-command) now exposes a property. You can add, remove, and iterate directives by using this collection. [Suggest directive](syntax.md#suggest-directive) is included by default; you can also use other directives like [DiagramDirective](syntax.md#the-diagram-directive) or . +- `EnableLegacyDoubleDashBehavior` was removed. All unmatched tokens are now exposed by the property. For more information, see [Unmatched tokens](how-to-parse-and-invoke.md#unmatched-tokens). +- `EnablePosixBundling` was removed. The bundling is now enabled by default, you can disable it by setting the property to `false`. For more information, see [EnablePosixBundling](how-to-configure-the-parser.md#enableposixbundling). - `RegisterWithDotnetSuggest` was removed as it performed an expensive operation, typically during application startup. Now you must register commands with `dotnet suggest` [manually](how-to-enable-tab-completion.md#enable-tab-completion). -- `UseExceptionHandler` was removed. The default exception handler is now enabled by default, you can disable it by setting the [CommandLineConfiguration.EnableDefaultExceptionHandler](how-to-configure-the-parser.md#enabledefaultexceptionhandler) property to `false`. This is useful when you want to handle exceptions in a custom way, by just wrapping the `Invoke` or `InvokeAsync` methods in a try-catch block. -- `UseHelp` and `UseVersion` were removed. The help and version are now exposed by the [HelpOption](how-to-customize-help.md#customize-help-output) and [VersionOption](syntax.md#version-option) public types. They are both included by default in the options defined by [RootCommand](syntax.md#root-command). +- `UseExceptionHandler` was removed. The default exception handler is now enabled by default; you can disable it by setting the property to `false`. This is useful when you want to handle exceptions in a custom way, by just wrapping the `Invoke` or `InvokeAsync` methods in a try-catch block. For more information, see [EnableDefaultExceptionHandler](how-to-configure-the-parser.md#enabledefaultexceptionhandler). +- `UseHelp` and `UseVersion` were removed. The help and version are now exposed by the and public types. They are both included by default in the options defined by [RootCommand](syntax.md#root-command). For more information, see [Customize help output](how-to-customize-help.md#customize-help-output) and [Version option](syntax.md#version-option). - `UseHelpBuilder` was removed. For more information on how to customize the help output, see [How to customize help in System.CommandLine](how-to-customize-help.md). - `AddMiddleware` was removed. It slowed down the application startup, and features can be expressed without it. -- `UseParseErrorReporting` and `UseTypoCorrections` were removed. The parse errors are now reported by default when invoking `ParseResult`. You can configure it by using the action exposed by `ParseResult.Action` property. +- `UseParseErrorReporting` and `UseTypoCorrections` were removed. The parse errors are now reported by default when invoking `ParseResult`. You can configure it by using the action exposed by the property. ```csharp ParseResult result = rootCommand.Parse("myArgs", config); @@ -179,9 +180,9 @@ Before 2.0.0-beta5, it was possible to customize the parsing, but only with some ``` - `UseLocalizationResources` and `LocalizationResources` were removed. This feature was used mostly by the `dotnet` CLI to add missing translations to `System.CommandLine`. All those translations were moved to the System.CommandLine itself, so this feature is no longer needed. If support for your language is missing, please [report an issue](https://github.com/dotnet/command-line-api/issues/new/choose). -- `UseTokenReplacer` was removed. [Response files](syntax.md#response-files) are enabled by default, but you can disable them by setting the property to `null`. You can also provide a custom implementation to customize how response files are processed. +- `UseTokenReplacer` was removed. [Response files](syntax.md#response-files) are enabled by default, but you can disable them by setting the property to `null`. You can also provide a custom implementation to customize how response files are processed. -Last but not least, the `IConsole` and all related interfaces (`IStandardOut`, `IStandardError`, `IStandardIn`) were removed. exposes two `TextWriter` properties: and . You can set these properties to any instance, such as a `StringWriter`, which can be used to capture output for testing. The motivation for this change was to expose fewer types and reuse existing abstractions. +Last but not least, the `IConsole` and all related interfaces (`IStandardOut`, `IStandardError`, `IStandardIn`) were removed. exposes two `TextWriter` properties: and . You can set these properties to any instance, such as a `StringWriter`, which you can use to capture output for testing. The motivation for this change was to expose fewer types and reuse existing abstractions. ### Invocation @@ -225,8 +226,8 @@ As a result of these and other aforementioned changes, the `InvocationContext` c To summarize these changes: - The `ICommandHandler` interface was removed. `SynchronousCommandLineAction` and `AsynchronousCommandLineAction` were introduced. -- The `Command.SetHandler` method was renamed to `SetAction`. -- The `Command.Handler` property was renamed to `Command.Action`. `Option` was extended with `Option.Action`. +- The `Command.SetHandler` method was renamed to . +- The `Command.Handler` property was renamed to . `Option` was extended with . - `InvocationContext` was removed. The `ParseResult` is now passed directly to the action. For more details about how to use actions, see [How to parse and invoke commands in System.CommandLine](how-to-parse-and-invoke.md). @@ -254,49 +255,7 @@ System.Runtime - System.Threading ``` -It allowed us to reduce the size of the library by 32% and the size of the following NativeAOT app by 20%: - -```csharp -Option boolOption = new Option(new[] { "--bool", "-b" }, "Bool option"); -Option stringOption = new Option(new[] { "--string", "-s" }, "String option"); - -RootCommand command = new RootCommand -{ - boolOption, - stringOption -}; - -command.SetHandler(Run, boolOption, stringOption); - -return new CommandLineBuilder(command).UseDefaults().Build().Invoke(args); - -static void Run(bool boolean, string text) -{ - Console.WriteLine($"Bool option: {text}"); - Console.WriteLine($"String option: {boolean}"); -} -``` - -```csharp -Option boolOption = new Option("--bool", "-b") { Description = "Bool option" }; -Option stringOption = new Option("--string", "-s") { Description = "String option" }; - -RootCommand command = new () -{ - boolOption, - stringOption, -}; - -command.SetAction(parseResult => Run(parseResult.GetValue(boolOption), parseResult.GetValue(stringOption))); - -return new CommandLineConfiguration(command).Invoke(args); - -static void Run(bool boolean, string text) -{ - Console.WriteLine($"Bool option: {text}"); - Console.WriteLine($"String option: {boolean}"); -} -``` +The size of the library is reduced (by 32%) and so is the size of NativeAOT apps that use the library. Simplicity has also improved the performance of the library (it's a side effect of the work, not the main goal of it). The [benchmarks](https://github.com/adamsitnik/commandline-perf/tree/update) show that the parsing and invoking of commands is now faster than in 2.0.0-beta4, especially for large commands with many options and arguments. The performance improvements are visible in both synchronous and asynchronous scenarios. diff --git a/docs/standard/commandline/snippets/configuration/csharp/Program.cs b/docs/standard/commandline/snippets/configuration/csharp/Program.cs index ba0bc8947fc7e..6897b72089be3 100644 --- a/docs/standard/commandline/snippets/configuration/csharp/Program.cs +++ b/docs/standard/commandline/snippets/configuration/csharp/Program.cs @@ -20,19 +20,15 @@ static void Main(string[] args) rootCommand.SetAction((parseResult) => { FileInfo? fileOptionValue = parseResult.GetValue(fileOption); - parseResult.Configuration.Output.WriteLine($"File option value: {fileOptionValue?.FullName}"); + parseResult.InvocationConfiguration.Output.WriteLine( + $"File option value: {fileOptionValue?.FullName}" + ); }); // // StringWriter output = new(); - CommandLineConfiguration configuration = new(rootCommand) - { - Output = output, - Error = TextWriter.Null - }; - - configuration.Parse("-h").Invoke(); + rootCommand.Parse("-h").Invoke(new() { Output = output }); Debug.Assert(output.ToString().Contains("Configuration sample")); // } diff --git a/docs/standard/commandline/snippets/configuration/csharp/scl.csproj b/docs/standard/commandline/snippets/configuration/csharp/scl.csproj index 3fa68e1bda8bd..16f8e10d4dda2 100644 --- a/docs/standard/commandline/snippets/configuration/csharp/scl.csproj +++ b/docs/standard/commandline/snippets/configuration/csharp/scl.csproj @@ -2,13 +2,13 @@ Exe - net8.0 + net9.0 enable enable - +