diff --git a/docs/azure/sdk/protocol-convenience-methods.md b/docs/azure/sdk/protocol-convenience-methods.md index dee3cac7b5be0..c85acd4bb9763 100644 --- a/docs/azure/sdk/protocol-convenience-methods.md +++ b/docs/azure/sdk/protocol-convenience-methods.md @@ -3,7 +3,8 @@ title: Understand Azure SDK client library method types description: Learn about the key differences between protocol and convenience methods in the Azure SDK client libraries for .NET. ms.topic: concept-article ms.custom: devx-track-dotnet, engagement-fy23, devx-track-arm-template -ms.date: 04/25/2025 +ms.date: 08/04/2026 +ai-usage: ai-assisted --- # Azure SDK for .NET protocol and convenience methods overview @@ -135,11 +136,11 @@ When a service call fails, the service client throws an exception that exposes t # [System.ClientModel exceptions](#tab/system-clientmodel) -:::code source="snippets/protocol-convenience-methods/AzureCore/ExceptionHandling/Program.cs" highlight="21-24"::: +:::code source="snippets/protocol-convenience-methods/SCM/ExceptionHandling/Program.cs" highlight="17-20"::: # [Azure.Core exceptions](#tab/azure-core) -:::code source="snippets/protocol-convenience-methods/SCM/ExceptionHandling/Program.cs" highlight="17-20"::: +:::code source="snippets/protocol-convenience-methods/AzureCore/ExceptionHandling/Program.cs" highlight="21-24"::: --- diff --git a/docs/azure/sdk/resource-management.md b/docs/azure/sdk/resource-management.md index 890b094f7cb5d..cb7c8b0aaae64 100644 --- a/docs/azure/sdk/resource-management.md +++ b/docs/azure/sdk/resource-management.md @@ -1,7 +1,8 @@ --- title: Resource management description: Learn how to use the Azure SDK for .NET to manage Azure resources. -ms.date: 04/25/2025 +ms.date: 08/04/2026 +ai-usage: ai-assisted --- # Resource management using the Azure SDK for .NET @@ -98,7 +99,7 @@ ResourceGroupResource resourceGroup = | Index | `resourceGroup.GetServiceBusNamespace(string servicebusNamespaceName)` | | Add/Update | `resourceGroup.GetServiceBusNamespaces().CreateOrUpdate(Azure.WaitUntil waitUntil, string name, ServiceBusNamespaceData data)` | | Contains | `resourceGroup.GetServiceBusNamespaces().Exists(string servicebusNamespaceName)` | -| Delete | `client.GetServiceBusQueueResource(ResourceIdentifior resourceIdentifior).Delete()` or `resourceGroup.GetServiceBusNamespace(string servicebusNamespaceName).Delete()`| +| Delete | `client.GetServiceBusQueueResource(ResourceIdentifier resourceIdentifier).Delete()` or `resourceGroup.GetServiceBusNamespace(string servicebusNamespaceName).Delete()`| Remember, all the Azure resources, including the resource group itself, can be managed by their corresponding management SDK using code similar to the above example. To find the correct Azure management SDK package, look for packages named with the following pattern `Azure.ResourceManager.{ResourceProviderName}`. @@ -164,7 +165,7 @@ ResourceGroupResource resourceGroup = // Next we get the collection for the virtual machines // vmCollection is a {ResourceName}Collection object from above -VirtualMachineCollection virtualMachineCollection = await resourceGroup.GetVirtualMachines(); +VirtualMachineCollection virtualMachineCollection = resourceGroup.GetVirtualMachines(); // Next we loop over all vms in the collection // Each vm is a {ResourceName}Resource object from above @@ -297,7 +298,7 @@ ArmClient client = new ArmClient(new DefaultAzureCredential()); SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync(); string resourceGroupName = "myRgName"; -bool exists = await subscription.GetResourceGroups().ExistsAsync(resourceGroupName).Value; +bool exists = (await subscription.GetResourceGroups().ExistsAsync(resourceGroupName)).Value; if (exists) { @@ -309,7 +310,7 @@ if (exists) } else { - Console.WriteLine($"Resource Group {rgName} does not exist."); + Console.WriteLine($"Resource Group {resourceGroupName} does not exist."); } ``` @@ -328,7 +329,7 @@ ResourceGroupCollection resourceGroupCollection = subscription.GetResourceGroups string resourceGroupName = "myRgName"; AzureLocation location = AzureLocation.WestUS2; ResourceGroupData resourceGroupData = new ResourceGroupData(location); -ResourceGroupResource resourceGroup = (await resourceGroupCollection.CreateOrUpdateAsync(resourceGroupName, resourceGroupData)).Value; +ResourceGroupResource resourceGroup = (await resourceGroupCollection.CreateOrUpdateAsync(WaitUntil.Completed, resourceGroupName, resourceGroupData)).Value; ``` ### List all resource groups diff --git a/docs/azure/sdk/thread-safety.md b/docs/azure/sdk/thread-safety.md index f82372e55ae96..44df9add713f0 100644 --- a/docs/azure/sdk/thread-safety.md +++ b/docs/azure/sdk/thread-safety.md @@ -2,7 +2,8 @@ title: Thread safety with the Azure SDK for .NET description: Learn about thread safety in Azure SDK client objects and how this design impacts client lifetime management. ms.custom: devx-track-dotnet, engagement-fy23 -ms.date: 04/25/2025 +ms.date: 08/04/2026 +ai-usage: ai-assisted --- # Thread safety and client lifetime management for Azure SDK objects @@ -53,7 +54,7 @@ foreach (var tag in tags) { newSecret.Properties.Tags[tag] = CalculateTagValue(tag); } - ); + }); } client.UpdateSecretProperties(newSecret.Properties);