Great announcement by Microsoft yesterday. They provided the first developer preview release of the new, simplified Azure management libraries for .NET. Thanks to a fluent interface-inspired method chains in combination with IntelliSense it delivers an easy to use experience.
Here is an example:
I don’t think it can become any easier…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("Creating a Windows VM"); | |
var windowsVM = azure.VirtualMachines.Define("myWindowsVM") | |
.WithRegion(Region.US_EAST) | |
.WithNewResourceGroup(rgName) | |
.WithNewPrimaryNetwork("10.0.0.0/28") | |
.WithPrimaryPrivateIpAddressDynamic() | |
.WithNewPrimaryPublicIpAddress("mywindowsvmdns") | |
.WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) | |
.WithAdminUserName("tirekicker") | |
.WithPassword(password) | |
.WithSize(VirtualMachineSizeTypes.StandardD3V2) | |
.Create(); | |
Console.WriteLine("Created a Windows VM: " + windowsVM.Id); |
More information:
- The announcement: https://azure.microsoft.com/en-us/blog/simpler-azure-management-libraries-for-net/
- The related github site: https://github.com/Azure/azure-sdk-for-net/tree/Fluent