We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Uses this data source to access information about an existing Virtual Hub.
Virtual Hub Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getVirtualHub({
name: "example-hub",
resourceGroupName: "example-resources",
});
export const virtualHubId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.network.get_virtual_hub(name="example-hub",
resource_group_name="example-resources")
pulumi.export("virtualHubId", example.id)
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.Network.GetVirtualHub.InvokeAsync(new Azure.Network.GetVirtualHubArgs
{
Name = "example-hub",
ResourceGroupName = "example-resources",
}));
this.VirtualHubId = example.Apply(example => example.Id);
}
[Output("virtualHubId")]
public Output<string> VirtualHubId { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := network.LookupVirtualHub(ctx, &network.LookupVirtualHubArgs{
Name: "example-hub",
ResourceGroupName: "example-resources",
}, nil)
if err != nil {
return err
}
ctx.Export("virtualHubId", example.Id)
return nil
})
}
Using getVirtualHub
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 getVirtualHub(args: GetVirtualHubArgs, opts?: InvokeOptions): Promise<GetVirtualHubResult>
function getVirtualHubOutput(args: GetVirtualHubOutputArgs, opts?: InvokeOptions): Output<GetVirtualHubResult>def get_virtual_hub(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVirtualHubResult
def get_virtual_hub_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVirtualHubResult]func LookupVirtualHub(ctx *Context, args *LookupVirtualHubArgs, opts ...InvokeOption) (*LookupVirtualHubResult, error)
func LookupVirtualHubOutput(ctx *Context, args *LookupVirtualHubOutputArgs, opts ...InvokeOption) LookupVirtualHubResultOutput> Note: This function is named LookupVirtualHub in the Go SDK.
public static class GetVirtualHub
{
public static Task<GetVirtualHubResult> InvokeAsync(GetVirtualHubArgs args, InvokeOptions? opts = null)
public static Output<GetVirtualHubResult> Invoke(GetVirtualHubInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVirtualHubResult> getVirtualHub(GetVirtualHubArgs args, InvokeOptions options)
public static Output<GetVirtualHubResult> getVirtualHub(GetVirtualHubArgs args, InvokeOptions options)
fn::invoke:
function: azure:network/getVirtualHub:getVirtualHub
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Virtual Hub.
- Resource
Group stringName - The Name of the Resource Group where the Virtual Hub exists.
- Name string
- The name of the Virtual Hub.
- Resource
Group stringName - The Name of the Resource Group where the Virtual Hub exists.
- name String
- The name of the Virtual Hub.
- resource
Group StringName - The Name of the Resource Group where the Virtual Hub exists.
- name string
- The name of the Virtual Hub.
- resource
Group stringName - The Name of the Resource Group where the Virtual Hub exists.
- name str
- The name of the Virtual Hub.
- resource_
group_ strname - The Name of the Resource Group where the Virtual Hub exists.
- name String
- The name of the Virtual Hub.
- resource
Group StringName - The Name of the Resource Group where the Virtual Hub exists.
getVirtualHub Result
The following output properties are available:
- Address
Prefix string - The Address Prefix used for this Virtual Hub.
- Default
Route stringTable Id - The ID of the default Route Table in the Virtual Hub.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the Virtual Hub exists.
- Name string
- Resource
Group stringName - Dictionary<string, string>
- A mapping of tags assigned to the Virtual Hub.
- Virtual
Wan stringId - The ID of the Virtual WAN within which the Virtual Hub exists.
- Address
Prefix string - The Address Prefix used for this Virtual Hub.
- Default
Route stringTable Id - The ID of the default Route Table in the Virtual Hub.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the Virtual Hub exists.
- Name string
- Resource
Group stringName - map[string]string
- A mapping of tags assigned to the Virtual Hub.
- Virtual
Wan stringId - The ID of the Virtual WAN within which the Virtual Hub exists.
- address
Prefix String - The Address Prefix used for this Virtual Hub.
- default
Route StringTable Id - The ID of the default Route Table in the Virtual Hub.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the Virtual Hub exists.
- name String
- resource
Group StringName - Map<String,String>
- A mapping of tags assigned to the Virtual Hub.
- virtual
Wan StringId - The ID of the Virtual WAN within which the Virtual Hub exists.
- address
Prefix string - The Address Prefix used for this Virtual Hub.
- default
Route stringTable Id - The ID of the default Route Table in the Virtual Hub.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region where the Virtual Hub exists.
- name string
- resource
Group stringName - {[key: string]: string}
- A mapping of tags assigned to the Virtual Hub.
- virtual
Wan stringId - The ID of the Virtual WAN within which the Virtual Hub exists.
- address_
prefix str - The Address Prefix used for this Virtual Hub.
- default_
route_ strtable_ id - The ID of the default Route Table in the Virtual Hub.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region where the Virtual Hub exists.
- name str
- resource_
group_ strname - Mapping[str, str]
- A mapping of tags assigned to the Virtual Hub.
- virtual_
wan_ strid - The ID of the Virtual WAN within which the Virtual Hub exists.
- address
Prefix String - The Address Prefix used for this Virtual Hub.
- default
Route StringTable Id - The ID of the default Route Table in the Virtual Hub.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the Virtual Hub exists.
- name String
- resource
Group StringName - Map<String>
- A mapping of tags assigned to the Virtual Hub.
- virtual
Wan StringId - The ID of the Virtual WAN within which the Virtual Hub exists.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
