We recommend using Azure Native.
Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi
azure.devtest.getVirtualNetwork
Explore with Pulumi AI
Use this data source to access information about an existing Dev Test Lab Virtual Network.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.devtest.getVirtualNetwork({
name: "example-network",
labName: "examplelab",
resourceGroupName: "example-resource",
});
export const labSubnetName = example.then(example => example.allowedSubnets?.[0]?.labSubnetName);
import pulumi
import pulumi_azure as azure
example = azure.devtest.get_virtual_network(name="example-network",
lab_name="examplelab",
resource_group_name="example-resource")
pulumi.export("labSubnetName", example.allowed_subnets[0].lab_subnet_name)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devtest"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := devtest.LookupVirtualNetwork(ctx, &devtest.LookupVirtualNetworkArgs{
Name: "example-network",
LabName: "examplelab",
ResourceGroupName: "example-resource",
}, nil)
if err != nil {
return err
}
ctx.Export("labSubnetName", example.AllowedSubnets[0].LabSubnetName)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.DevTest.GetVirtualNetwork.Invoke(new()
{
Name = "example-network",
LabName = "examplelab",
ResourceGroupName = "example-resource",
});
return new Dictionary<string, object?>
{
["labSubnetName"] = example.Apply(getVirtualNetworkResult => getVirtualNetworkResult.AllowedSubnets[0]?.LabSubnetName),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.devtest.DevtestFunctions;
import com.pulumi.azure.devtest.inputs.GetVirtualNetworkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = DevtestFunctions.getVirtualNetwork(GetVirtualNetworkArgs.builder()
.name("example-network")
.labName("examplelab")
.resourceGroupName("example-resource")
.build());
ctx.export("labSubnetName", example.applyValue(getVirtualNetworkResult -> getVirtualNetworkResult.allowedSubnets()[0].labSubnetName()));
}
}
variables:
example:
fn::invoke:
function: azure:devtest:getVirtualNetwork
arguments:
name: example-network
labName: examplelab
resourceGroupName: example-resource
outputs:
labSubnetName: ${example.allowedSubnets[0].labSubnetName}
Using getVirtualNetwork
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVirtualNetwork(args: GetVirtualNetworkArgs, opts?: InvokeOptions): Promise<GetVirtualNetworkResult>
function getVirtualNetworkOutput(args: GetVirtualNetworkOutputArgs, opts?: InvokeOptions): Output<GetVirtualNetworkResult>
def get_virtual_network(lab_name: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVirtualNetworkResult
def get_virtual_network_output(lab_name: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVirtualNetworkResult]
func LookupVirtualNetwork(ctx *Context, args *LookupVirtualNetworkArgs, opts ...InvokeOption) (*LookupVirtualNetworkResult, error)
func LookupVirtualNetworkOutput(ctx *Context, args *LookupVirtualNetworkOutputArgs, opts ...InvokeOption) LookupVirtualNetworkResultOutput
> Note: This function is named LookupVirtualNetwork
in the Go SDK.
public static class GetVirtualNetwork
{
public static Task<GetVirtualNetworkResult> InvokeAsync(GetVirtualNetworkArgs args, InvokeOptions? opts = null)
public static Output<GetVirtualNetworkResult> Invoke(GetVirtualNetworkInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVirtualNetworkResult> getVirtualNetwork(GetVirtualNetworkArgs args, InvokeOptions options)
public static Output<GetVirtualNetworkResult> getVirtualNetwork(GetVirtualNetworkArgs args, InvokeOptions options)
fn::invoke:
function: azure:devtest/getVirtualNetwork:getVirtualNetwork
arguments:
# arguments dictionary
The following arguments are supported:
- Lab
Name This property is required. string - Specifies the name of the Dev Test Lab.
- Name
This property is required. string - Specifies the name of the Virtual Network.
- Resource
Group Name This property is required. string - Specifies the name of the resource group that contains the Virtual Network.
- Lab
Name This property is required. string - Specifies the name of the Dev Test Lab.
- Name
This property is required. string - Specifies the name of the Virtual Network.
- Resource
Group Name This property is required. string - Specifies the name of the resource group that contains the Virtual Network.
- lab
Name This property is required. String - Specifies the name of the Dev Test Lab.
- name
This property is required. String - Specifies the name of the Virtual Network.
- resource
Group Name This property is required. String - Specifies the name of the resource group that contains the Virtual Network.
- lab
Name This property is required. string - Specifies the name of the Dev Test Lab.
- name
This property is required. string - Specifies the name of the Virtual Network.
- resource
Group Name This property is required. string - Specifies the name of the resource group that contains the Virtual Network.
- lab_
name This property is required. str - Specifies the name of the Dev Test Lab.
- name
This property is required. str - Specifies the name of the Virtual Network.
- resource_
group_ name This property is required. str - Specifies the name of the resource group that contains the Virtual Network.
- lab
Name This property is required. String - Specifies the name of the Dev Test Lab.
- name
This property is required. String - Specifies the name of the Virtual Network.
- resource
Group Name This property is required. String - Specifies the name of the resource group that contains the Virtual Network.
getVirtualNetwork Result
The following output properties are available:
- Allowed
Subnets List<GetVirtual Network Allowed Subnet> - The list of subnets enabled for the virtual network as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Lab
Name string - Name string
- Resource
Group stringName - Subnet
Overrides List<GetVirtual Network Subnet Override> - The list of permission overrides for the subnets as defined below.
- Unique
Identifier string - The unique immutable identifier of the virtual network.
- Allowed
Subnets []GetVirtual Network Allowed Subnet - The list of subnets enabled for the virtual network as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Lab
Name string - Name string
- Resource
Group stringName - Subnet
Overrides []GetVirtual Network Subnet Override - The list of permission overrides for the subnets as defined below.
- Unique
Identifier string - The unique immutable identifier of the virtual network.
- allowed
Subnets List<GetVirtual Network Allowed Subnet> - The list of subnets enabled for the virtual network as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- lab
Name String - name String
- resource
Group StringName - subnet
Overrides List<GetVirtual Network Subnet Override> - The list of permission overrides for the subnets as defined below.
- unique
Identifier String - The unique immutable identifier of the virtual network.
- allowed
Subnets GetVirtual Network Allowed Subnet[] - The list of subnets enabled for the virtual network as defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- lab
Name string - name string
- resource
Group stringName - subnet
Overrides GetVirtual Network Subnet Override[] - The list of permission overrides for the subnets as defined below.
- unique
Identifier string - The unique immutable identifier of the virtual network.
- allowed_
subnets Sequence[GetVirtual Network Allowed Subnet] - The list of subnets enabled for the virtual network as defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- lab_
name str - name str
- resource_
group_ strname - subnet_
overrides Sequence[GetVirtual Network Subnet Override] - The list of permission overrides for the subnets as defined below.
- unique_
identifier str - The unique immutable identifier of the virtual network.
- allowed
Subnets List<Property Map> - The list of subnets enabled for the virtual network as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- lab
Name String - name String
- resource
Group StringName - subnet
Overrides List<Property Map> - The list of permission overrides for the subnets as defined below.
- unique
Identifier String - The unique immutable identifier of the virtual network.
Supporting Types
GetVirtualNetworkAllowedSubnet
- Allow
Public Ip This property is required. string - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - Lab
Subnet Name This property is required. string - The name of the subnet.
- Resource
Id This property is required. string - The resource identifier for the subnet.
- Allow
Public Ip This property is required. string - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - Lab
Subnet Name This property is required. string - The name of the subnet.
- Resource
Id This property is required. string - The resource identifier for the subnet.
- allow
Public Ip This property is required. String - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - lab
Subnet Name This property is required. String - The name of the subnet.
- resource
Id This property is required. String - The resource identifier for the subnet.
- allow
Public Ip This property is required. string - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - lab
Subnet Name This property is required. string - The name of the subnet.
- resource
Id This property is required. string - The resource identifier for the subnet.
- allow_
public_ ip This property is required. str - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - lab_
subnet_ name This property is required. str - The name of the subnet.
- resource_
id This property is required. str - The resource identifier for the subnet.
- allow
Public Ip This property is required. String - Indicates if this subnet allows public IP addresses. Possible values are
Allow
,Default
andDeny
. - lab
Subnet Name This property is required. String - The name of the subnet.
- resource
Id This property is required. String - The resource identifier for the subnet.
GetVirtualNetworkSubnetOverride
- Lab
Subnet Name This property is required. string - The name of the subnet.
- Resource
Id This property is required. string - The resource identifier for the subnet.
- Use
In Vm Creation Permission This property is required. string - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - Use
Public Ip Address Permission This property is required. string - Virtual
Network Pool Name This property is required. string - The virtual network pool associated with this subnet.
- Lab
Subnet Name This property is required. string - The name of the subnet.
- Resource
Id This property is required. string - The resource identifier for the subnet.
- Use
In Vm Creation Permission This property is required. string - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - Use
Public Ip Address Permission This property is required. string - Virtual
Network Pool Name This property is required. string - The virtual network pool associated with this subnet.
- lab
Subnet Name This property is required. String - The name of the subnet.
- resource
Id This property is required. String - The resource identifier for the subnet.
- use
In Vm Creation Permission This property is required. String - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - use
Public Ip Address Permission This property is required. String - virtual
Network Pool Name This property is required. String - The virtual network pool associated with this subnet.
- lab
Subnet Name This property is required. string - The name of the subnet.
- resource
Id This property is required. string - The resource identifier for the subnet.
- use
In Vm Creation Permission This property is required. string - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - use
Public Ip Address Permission This property is required. string - virtual
Network Pool Name This property is required. string - The virtual network pool associated with this subnet.
- lab_
subnet_ name This property is required. str - The name of the subnet.
- resource_
id This property is required. str - The resource identifier for the subnet.
- use_
in_ vm_ creation_ permission This property is required. str - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - use_
public_ ip_ address_ permission This property is required. str - virtual_
network_ pool_ name This property is required. str - The virtual network pool associated with this subnet.
- lab
Subnet Name This property is required. String - The name of the subnet.
- resource
Id This property is required. String - The resource identifier for the subnet.
- use
In Vm Creation Permission This property is required. String - Indicates if the subnet can be used for VM creation. Possible values are
Allow
,Default
andDeny
. - use
Public Ip Address Permission This property is required. String - virtual
Network Pool Name This property is required. String - The virtual network pool associated with this subnet.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.