Permalink
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (57 sloc) 2.67 KB
title description keywords author ms.author manager ms.date ms.topic ms.prod ms.technology ms.devlang ms.service
Azure compute libraries for .NET
Reference for Azure compute libraries for .NET
Azure, .NET, SDK, API, VM, virtual machines, compute
camsoper
casoper
douge
06/20/2017
article
azure
azure
dotnet
multiple

Azure virtual machine libraries for .NET

Overview

On-demand, scalable computing resources running Linux or Windows.

To get started with Azure virtual machines, see Create a Linux virtual machine with the Azure portal.

Management APIs

Create, configure, and scale out Windows and Linux virtual machines in Azure from your code with the management API.

Install the NuGet package directly from the Visual Studio Package Manager console or with the .NET Core CLI.

Visual Studio Package Manager

Install-Package Microsoft.Azure.Management.Compute.Fluent

.NET Core CLI

dotnet add package Microsoft.Azure.Management.Compute.Fluent

Code Example

Create a Windows VM.

/* Include these "using" directives...
using Microsoft.Azure.Management.Compute.Fluent;
using Microsoft.Azure.Management.Compute.Fluent.Models;
using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
*/

IVirtualMachine windowsVM = azure.VirtualMachines.Define("MyVirtualMachine")
    .WithRegion(Region.USEast)
    .WithNewResourceGroup("MyResourceGroup")
    .WithNewPrimaryNetwork("10.0.0.0/28")
    .WithPrimaryPrivateIPAddressDynamic()
    .WithNewPrimaryPublicIPAddress("MyIPAddressLabel")
    .WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WindowsServer2012R2Datacenter)
    .WithAdminUsername("UserName")
    .WithAdminPassword("Password")
    .WithSize(VirtualMachineSizeTypes.StandardD3V2)
    .Create();

[!div class="nextstepaction"] Explore the management APIs

Samples

View the complete list of virtual machine samples.