예제 #1
0
        // TODO: create it through resource management, or we can instrutment ArmClient?
        private async Task <Response <VirtualNetwork> > createVirtualNetwork()
        {
            var name = Recording.GenerateAssetName("pe_vnet");
            var vnet = new VirtualNetworkData()
            {
                Location     = TestEnvironment.Location,
                AddressSpace = new AddressSpace()
                {
                    AddressPrefixes = { "10.0.0.0/16", }
                },
                DhcpOptions = new DhcpOptions()
                {
                    DnsServers = { "10.1.1.1", "10.1.2.4" }
                },
                Subnets = { new SubnetData()
                            {
                                Name          = "default",
                                AddressPrefix = "10.0.1.0/24",
                                PrivateEndpointNetworkPolicies = VirtualNetworkPrivateEndpointNetworkPolicies.Disabled
                            } }
            };

            return(await resourceGroup.GetVirtualNetworks().CreateOrUpdate(WaitUntil.Completed, name, vnet).WaitForCompletionAsync());
        }
 protected VirtualNetworkCollection GetVirtualNetworkCollection(Resources.ResourceGroup resourceGroup)
 {
     return(resourceGroup.GetVirtualNetworks());
 }
 protected VirtualNetworkContainer GetVirtualNetworkContainer(Resources.ResourceGroup resourceGroup)
 {
     return(resourceGroup.GetVirtualNetworks());
 }