![]() |
VOOZH | about |
dotnet add package Azure.ResourceManager.Compute --version 1.14.0
NuGet\Install-Package Azure.ResourceManager.Compute -Version 1.14.0
<PackageReference Include="Azure.ResourceManager.Compute" Version="1.14.0" />
<PackageVersion Include="Azure.ResourceManager.Compute" Version="1.14.0" />Directory.Packages.props
<PackageReference Include="Azure.ResourceManager.Compute" />Project file
paket add Azure.ResourceManager.Compute --version 1.14.0
#r "nuget: Azure.ResourceManager.Compute, 1.14.0"
#:package Azure.ResourceManager.Compute@1.14.0
#addin nuget:?package=Azure.ResourceManager.Compute&version=1.14.0Install as a Cake Addin
#tool nuget:?package=Azure.ResourceManager.Compute&version=1.14.0Install as a Cake Tool
Microsoft Azure Compute provides the infrastructure to host apps. Tap in to compute capacity in the cloud and scale on demand. Containerize your applications, deploy Windows and Linux virtual machines (VMs), and take advantage of flexible options for migrating VMs to Azure. With comprehensive support for hybrid environments, deploy how and where you want to. Azure compute also includes a full-fledged identity solution, so you gain managed end-point protection, and Active Directory support that helps secure access to on-premises and cloud apps. Deploy great apps and save with pay-as-you-go pricing, and the Azure Hybrid Benefit.
This library supports managing Microsoft Azure Compute resources.
This library follows the new Azure SDK guidelines, and provides many core capabilities:
- Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
- Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
- HTTP pipeline with custom policies.
- Better error-handling.
- Support uniform telemetry across all languages.
Install the Microsoft Azure Compute management library for .NET with NuGet:
dotnet add package Azure.ResourceManager.Compute
The default option to create an authenticated client is to use DefaultAzureCredential. Since all management APIs go through the same endpoint, in order to interact with resources, only one top-level ArmClient has to be created.
To authenticate to Azure and create an ArmClient, do the following code:
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
More documentation for the Azure.Identity.DefaultAzureCredential class can be found in this document.
Key concepts of the Azure .NET SDK can be found here
Before creating an availability set, we need to have a resource group.
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
// With the collection, we can create a new resource group with an specific name
string rgName = "myRgName";
AzureLocation location = AzureLocation.WestUS2;
ArmOperation<ResourceGroupResource> lro = await rgCollection.CreateOrUpdateAsync(WaitUntil.Completed, rgName, new ResourceGroupData(location));
ResourceGroupResource resourceGroup = lro.Value;
AvailabilitySetCollection availabilitySetCollection = resourceGroup.GetAvailabilitySets();
string availabilitySetName = "myAvailabilitySet";
AvailabilitySetData input = new AvailabilitySetData(location);
ArmOperation<AvailabilitySetResource> lro = await availabilitySetCollection.CreateOrUpdateAsync(WaitUntil.Completed, availabilitySetName, input);
AvailabilitySetResource availabilitySet = lro.Value;
// First, initialize the ArmClient and get the default subscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
// Now we get a ResourceGroupResource collection for that subscription
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await rgCollection.GetAsync(rgName);
// First, we get the availability set collection from the resource group
AvailabilitySetCollection availabilitySetCollection = resourceGroup.GetAvailabilitySets();
// With GetAllAsync(), we can get a list of the availability sets in the collection
AsyncPageable<AvailabilitySetResource> response = availabilitySetCollection.GetAllAsync();
await foreach (AvailabilitySetResource availabilitySet in response)
{
Console.WriteLine(availabilitySet.Data.Name);
}
// First, initialize the ArmClient and get the default subscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
// Now we get a ResourceGroupResource collection for that subscription
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
// With the collection, we can create a new resource group with an specific name
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await rgCollection.GetAsync(rgName);
AvailabilitySetCollection availabilitySetCollection = resourceGroup.GetAvailabilitySets();
string availabilitySetName = "myAvailabilitySet";
AvailabilitySetResource availabilitySet = await availabilitySetCollection.GetAsync(availabilitySetName);
// availabilitySet is an AvailabilitySetResource instance created above
AvailabilitySetPatch update = new AvailabilitySetPatch()
{
PlatformFaultDomainCount = 3
};
AvailabilitySetResource updatedAvailabilitySet = await availabilitySet.UpdateAsync(update);
// First, initialize the ArmClient and get the default subscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
// Now we get a ResourceGroupResource collection for that subscription
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
// With the collection, we can create a new resource group with an specific name
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await rgCollection.GetAsync(rgName);
AvailabilitySetCollection availabilitySetCollection = resourceGroup.GetAvailabilitySets();
string availabilitySetName = "myAvailabilitySet";
AvailabilitySetResource availabilitySet = await availabilitySetCollection.GetAsync(availabilitySetName);
// delete the availability set
await availabilitySet.DeleteAsync(WaitUntil.Completed);
If you just want to verify if the availability set exists, you can use the function CheckIfExists.
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await rgCollection.GetAsync(rgName);
string availabilitySetName = "myAvailabilitySet";
bool exists = await resourceGroup.GetAvailabilitySets().ExistsAsync(availabilitySetName);
if (exists)
{
Console.WriteLine($"Availability Set {availabilitySetName} exists.");
}
else
{
Console.WriteLine($"Availability Set {availabilitySetName} does not exist.");
}
// First, initialize the ArmClient and get the default subscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
// Now we get a ResourceGroupResource collection for that subscription
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await rgCollection.GetAsync(rgName);
AvailabilitySetCollection availabilitySetCollection = resourceGroup.GetAvailabilitySets();
string availabilitySetName = "myAvailabilitySet";
AvailabilitySetResource availabilitySet = await availabilitySetCollection.GetAsync(availabilitySetName);
// add a tag on this availabilitySet
AvailabilitySetResource updatedAvailabilitySet = await availabilitySet.AddTagAsync("key", "value");
For more detailed examples, take a look at samples we have available.
For more information on Azure SDK, see this website.
For details on contributing to this repository, see the contributing guide.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (for example, label, comment). Follow the instructions provided by the bot. You'll only need to do this action once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact with any other questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Azure.ResourceManager.Compute:
| Package | Downloads |
|---|---|
|
Neon.Kube.Azure
INTERNAL USE ONLY: neonKUBE hosting manager for Azure |
|
|
ModularPipelines.Azure
Helpers for interacting with Azure. |
|
|
DotnetModularPipelines.Azure
Helpers for interacting with Azure. |
|
|
Ngs.Agent.AzureResources
Package Description |
|
|
Cloudlib
Package Description |
Showing the top 7 popular GitHub repositories that depend on Azure.ResourceManager.Compute:
| Repository | Stars |
|---|---|
|
microsoft/mcp
Catalog of official Microsoft MCP (Model Context Protocol) server implementations for AI-powered data access and tool integration
|
|
|
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
|
|
|
Azure/azure-mcp
The Azure MCP Server, bringing the power of Azure to your agents.
|
|
|
thomhurst/ModularPipelines
Write your pipelines in C# !
|
|
|
Stratus-Security/Subdominator
The Internets #1 Subdomain Takeover Tool
|
|
|
TheCloudTheory/arm-estimator
ACE (Azure Cost Estimator) - automated cost estimations for ARM Templates, Bicep and Terraform
|
|
|
microsoft/CromwellOnAzure
Microsoft Genomics implementation of the Broad Institute's Cromwell workflow engine on Azure
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.15.0-beta.1 | 276 | 4/24/2026 |
| 1.14.0 | 383,879 | 1/21/2026 |
| 1.13.0 | 164,095 | 11/17/2025 |
| 1.12.0 | 78,499 | 9/24/2025 |
| 1.11.0 | 282,236 | 8/12/2025 |
| 1.10.0 | 103,749 | 7/3/2025 |
| 1.9.0 | 508,475 | 4/2/2025 |
| 1.9.0-beta.1 | 1,379 | 2/25/2025 |
| 1.8.0 | 242,760 | 2/21/2025 |
| 1.7.0 | 429,887 | 12/24/2024 |
| 1.7.0-beta.2 | 573 | 12/12/2024 |
| 1.7.0-beta.1 | 22,949 | 10/15/2024 |
| 1.6.0 | 538,707 | 8/27/2024 |
| 1.5.0 | 463,830 | 5/10/2024 |
| 1.5.0-beta.1 | 576 | 4/26/2024 |
| 1.4.0 | 358,201 | 2/23/2024 |
| 1.4.0-beta.1 | 425 | 1/26/2024 |
| 1.3.0 | 128,041 | 1/2/2024 |
| 1.2.1 | 124,236 | 11/24/2023 |
| 1.2.0 | 251,858 | 9/15/2023 |