Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/azure/sdk/protocol-convenience-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":::

---

Expand Down
13 changes: 7 additions & 6 deletions docs/azure/sdk/resource-management.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}`.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand All @@ -309,7 +310,7 @@ if (exists)
}
else
{
Console.WriteLine($"Resource Group {rgName} does not exist.");
Console.WriteLine($"Resource Group {resourceGroupName} does not exist.");
}
```

Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/azure/sdk/thread-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,7 +54,7 @@ foreach (var tag in tags)
{
newSecret.Properties.Tags[tag] = CalculateTagValue(tag);
}
);
});
}

client.UpdateSecretProperties(newSecret.Properties);
Expand Down
Loading