在使用Azure管理Fluent API创建VM时,如何指定具有2个子网的新vnet

时间:2018-01-15 07:07:11

标签: azure-management-api

使用Azure Management Fluent API如何创建具有2个子网的新VNet并创建2个VM,每个vm是一个单独的子网?

    var windowsVM = azure.VirtualMachines.Define("myWindowsVM")
        .WithRegion(Region.USWest)
        .WithNewResourceGroup(rgName)
        .WithNewPrimaryNetwork("10.0.0.0/28")
        .WithPrimaryPrivateIPAddressDynamic()
        .WithNewPrimaryPublicIPAddress("mywindowsvmdns")
        .WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WindowsServer2012R2Datacenter)
        .WithAdminUsername("tirekicker")
        .WithAdminPassword(password)
        .WithSize(VirtualMachineSizeTypes.StandardD3V2)
        .Create();

0 个答案:

没有答案