public void CreateVm() { var vm = new SubscriptionManager("82f8e1cd-ee8d-414e-b6a5-be7b18a1fa89") .GetVirtualMachinesManager() .AddPublishSettingsFromXml(Publishsettings) .CreateVirtualMachineDeployment() .AddToExistingCloudServiceWithName("CloudServiceName") .WithAdminPassword("Password") .WithDeploymentType(Commands.VirtualMachines.VirtualMachineTemplates.SqlServer2012) .WithMachineName("ServerName") .WithRoleName("NewRole") .WithStorageAccountForVhds("StorageAccount") .WithVmOfSize(Types.VmSize.ExtraLarge); var result = vm.ToString(); result.Should().NotBeNullOrEmpty(); Console.WriteLine(result); }
public void CreateCustomImage() { var result = new SubscriptionManager("82f8e1cd-ee8d-414e-b6a5-be7b18a1fa89") .GetVirtualMachinesManager() .AddPublishSettingsFromXml(Publishsettings) .CreateVirtualMachineDeployment() .WithDeploymentType("ImageShortName") .AddInputEndpoint("Web2", Types.VirtualMachines.Protocol.TCP, 8080, 8080) .AddInputEndpoint(InputEndpoint.GetDefaultWebSettings()) .AddToExistingCloudServiceWithName("CloudService") .WithAdminPassword("Password") .WithMachineName("NewMachine") .WithRoleName("NewRole") .WithStorageAccountForVhds("accountName") .WithVmOfSize(Types.VmSize.ExtraLarge); result.ToString().Should().NotBeNullOrEmpty(); Console.WriteLine(result); }