Created
December 25, 2018 10:59
-
-
Save mayur-tendulkar/233ad535e2797450b8ba0e230fc5245f to your computer and use it in GitHub Desktop.
Create VM using Fluent API
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
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment