Skip to content

Dorcaz/snippet-of-C-code-to-create-an-Azure-VM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

snippet-of-C-code-to-create-an-Azure-VM

using the Microsoft.Azure.Management.Fluent NuGet package.

c# var azure = Azure .Configure() .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic) .Authenticate(credentials) .WithDefaultSubscription(); // ... var vmName = "test-wp1-eus-vm";

azure.VirtualMachines.Define(vmName) .WithRegion(Region.USEast) .WithExistingResourceGroup("TestResourceGroup") .WithExistingPrimaryNetworkInterface(networkInterface) .WithLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2012-R2-Datacenter") .WithAdminUsername("jonc") .WithAdminPassword("aReallyGoodPasswordHere") .WithComputerName(vmName) .WithSize(VirtualMachineSizeTypes.StandardDS1) .Create();

Azure Java SDK.
String vmName = "test-wp1-eus-vm";

// ... VirtualMachine virtualMachine = azure.virtualMachines() .define(vmName) .withRegion(Region.US_EAST) .withExistingResourceGroup("TestResourceGroup") .withExistingPrimaryNetworkInterface(networkInterface) .withLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2012-R2-Datacenter") .withAdminUsername("jonc") .withAdminPassword("aReallyGoodPasswordHere") .withComputerName(vmName) .withSize("Standard_DS1") .create();

About

using the Microsoft.Azure.Management.Fluent NuGet package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published