1. Packages
  2. Azure Native
  3. API Docs
  4. servicebus
  5. NamespaceVirtualNetworkRule
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

azure-native.servicebus.NamespaceVirtualNetworkRule

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

Single item in a List or Get VirtualNetworkRules operation

Uses Azure REST API version 2018-01-01-preview. In version 2.x of the Azure Native provider, it used API version 2018-01-01-preview.

Example Usage

NameSpaceVirtualNetworkRuleCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var namespaceVirtualNetworkRule = new AzureNative.ServiceBus.NamespaceVirtualNetworkRule("namespaceVirtualNetworkRule", new()
    {
        NamespaceName = "sdk-Namespace-6019",
        ResourceGroupName = "ResourceGroup",
        VirtualNetworkRuleName = "sdk-VirtualNetworkRules-9191",
        VirtualNetworkSubnetId = "/subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default",
    });

});
Copy
package main

import (
	servicebus "github.com/pulumi/pulumi-azure-native-sdk/servicebus/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := servicebus.NewNamespaceVirtualNetworkRule(ctx, "namespaceVirtualNetworkRule", &servicebus.NamespaceVirtualNetworkRuleArgs{
			NamespaceName:          pulumi.String("sdk-Namespace-6019"),
			ResourceGroupName:      pulumi.String("ResourceGroup"),
			VirtualNetworkRuleName: pulumi.String("sdk-VirtualNetworkRules-9191"),
			VirtualNetworkSubnetId: pulumi.String("/subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.servicebus.NamespaceVirtualNetworkRule;
import com.pulumi.azurenative.servicebus.NamespaceVirtualNetworkRuleArgs;
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) {
        var namespaceVirtualNetworkRule = new NamespaceVirtualNetworkRule("namespaceVirtualNetworkRule", NamespaceVirtualNetworkRuleArgs.builder()
            .namespaceName("sdk-Namespace-6019")
            .resourceGroupName("ResourceGroup")
            .virtualNetworkRuleName("sdk-VirtualNetworkRules-9191")
            .virtualNetworkSubnetId("/subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const namespaceVirtualNetworkRule = new azure_native.servicebus.NamespaceVirtualNetworkRule("namespaceVirtualNetworkRule", {
    namespaceName: "sdk-Namespace-6019",
    resourceGroupName: "ResourceGroup",
    virtualNetworkRuleName: "sdk-VirtualNetworkRules-9191",
    virtualNetworkSubnetId: "/subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

namespace_virtual_network_rule = azure_native.servicebus.NamespaceVirtualNetworkRule("namespaceVirtualNetworkRule",
    namespace_name="sdk-Namespace-6019",
    resource_group_name="ResourceGroup",
    virtual_network_rule_name="sdk-VirtualNetworkRules-9191",
    virtual_network_subnet_id="/subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default")
Copy
resources:
  namespaceVirtualNetworkRule:
    type: azure-native:servicebus:NamespaceVirtualNetworkRule
    properties:
      namespaceName: sdk-Namespace-6019
      resourceGroupName: ResourceGroup
      virtualNetworkRuleName: sdk-VirtualNetworkRules-9191
      virtualNetworkSubnetId: /subscriptions/Subscription/resourceGroups/sbehvnettest/providers/Microsoft.Network/virtualNetworks/sbehvnettest/subnets/default
Copy

Create NamespaceVirtualNetworkRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NamespaceVirtualNetworkRule(name: string, args: NamespaceVirtualNetworkRuleArgs, opts?: CustomResourceOptions);
@overload
def NamespaceVirtualNetworkRule(resource_name: str,
                                args: NamespaceVirtualNetworkRuleArgs,
                                opts: Optional[ResourceOptions] = None)

@overload
def NamespaceVirtualNetworkRule(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                namespace_name: Optional[str] = None,
                                resource_group_name: Optional[str] = None,
                                virtual_network_rule_name: Optional[str] = None,
                                virtual_network_subnet_id: Optional[str] = None)
func NewNamespaceVirtualNetworkRule(ctx *Context, name string, args NamespaceVirtualNetworkRuleArgs, opts ...ResourceOption) (*NamespaceVirtualNetworkRule, error)
public NamespaceVirtualNetworkRule(string name, NamespaceVirtualNetworkRuleArgs args, CustomResourceOptions? opts = null)
public NamespaceVirtualNetworkRule(String name, NamespaceVirtualNetworkRuleArgs args)
public NamespaceVirtualNetworkRule(String name, NamespaceVirtualNetworkRuleArgs args, CustomResourceOptions options)
type: azure-native:servicebus:NamespaceVirtualNetworkRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NamespaceVirtualNetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NamespaceVirtualNetworkRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceVirtualNetworkRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceVirtualNetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NamespaceVirtualNetworkRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var azure_nativeNamespaceVirtualNetworkRuleResource = new AzureNative.ServiceBus.NamespaceVirtualNetworkRule("azure-nativeNamespaceVirtualNetworkRuleResource", new()
{
    NamespaceName = "string",
    ResourceGroupName = "string",
    VirtualNetworkRuleName = "string",
    VirtualNetworkSubnetId = "string",
});
Copy
example, err := servicebus.NewNamespaceVirtualNetworkRule(ctx, "azure-nativeNamespaceVirtualNetworkRuleResource", &servicebus.NamespaceVirtualNetworkRuleArgs{
	NamespaceName:          pulumi.String("string"),
	ResourceGroupName:      pulumi.String("string"),
	VirtualNetworkRuleName: pulumi.String("string"),
	VirtualNetworkSubnetId: pulumi.String("string"),
})
Copy
var azure_nativeNamespaceVirtualNetworkRuleResource = new NamespaceVirtualNetworkRule("azure-nativeNamespaceVirtualNetworkRuleResource", NamespaceVirtualNetworkRuleArgs.builder()
    .namespaceName("string")
    .resourceGroupName("string")
    .virtualNetworkRuleName("string")
    .virtualNetworkSubnetId("string")
    .build());
Copy
azure_native_namespace_virtual_network_rule_resource = azure_native.servicebus.NamespaceVirtualNetworkRule("azure-nativeNamespaceVirtualNetworkRuleResource",
    namespace_name="string",
    resource_group_name="string",
    virtual_network_rule_name="string",
    virtual_network_subnet_id="string")
Copy
const azure_nativeNamespaceVirtualNetworkRuleResource = new azure_native.servicebus.NamespaceVirtualNetworkRule("azure-nativeNamespaceVirtualNetworkRuleResource", {
    namespaceName: "string",
    resourceGroupName: "string",
    virtualNetworkRuleName: "string",
    virtualNetworkSubnetId: "string",
});
Copy
type: azure-native:servicebus:NamespaceVirtualNetworkRule
properties:
    namespaceName: string
    resourceGroupName: string
    virtualNetworkRuleName: string
    virtualNetworkSubnetId: string
Copy

NamespaceVirtualNetworkRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NamespaceVirtualNetworkRule resource accepts the following input properties:

NamespaceName
This property is required.
Changes to this property will trigger replacement.
string
The namespace name
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the Resource group within the Azure subscription.
VirtualNetworkRuleName Changes to this property will trigger replacement. string
The Virtual Network Rule name.
VirtualNetworkSubnetId string
Resource ID of Virtual Network Subnet
NamespaceName
This property is required.
Changes to this property will trigger replacement.
string
The namespace name
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the Resource group within the Azure subscription.
VirtualNetworkRuleName Changes to this property will trigger replacement. string
The Virtual Network Rule name.
VirtualNetworkSubnetId string
Resource ID of Virtual Network Subnet
namespaceName
This property is required.
Changes to this property will trigger replacement.
String
The namespace name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the Resource group within the Azure subscription.
virtualNetworkRuleName Changes to this property will trigger replacement. String
The Virtual Network Rule name.
virtualNetworkSubnetId String
Resource ID of Virtual Network Subnet
namespaceName
This property is required.
Changes to this property will trigger replacement.
string
The namespace name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the Resource group within the Azure subscription.
virtualNetworkRuleName Changes to this property will trigger replacement. string
The Virtual Network Rule name.
virtualNetworkSubnetId string
Resource ID of Virtual Network Subnet
namespace_name
This property is required.
Changes to this property will trigger replacement.
str
The namespace name
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the Resource group within the Azure subscription.
virtual_network_rule_name Changes to this property will trigger replacement. str
The Virtual Network Rule name.
virtual_network_subnet_id str
Resource ID of Virtual Network Subnet
namespaceName
This property is required.
Changes to this property will trigger replacement.
String
The namespace name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the Resource group within the Azure subscription.
virtualNetworkRuleName Changes to this property will trigger replacement. String
The Virtual Network Rule name.
virtualNetworkSubnetId String
Resource ID of Virtual Network Subnet

Outputs

All input properties are implicitly available as output properties. Additionally, the NamespaceVirtualNetworkRule resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name
Type string
Resource type
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name
Type string
Resource type
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name
type String
Resource type
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name
type string
Resource type
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name
type str
Resource type
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name
type String
Resource type

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:servicebus:NamespaceVirtualNetworkRule sdk-VirtualNetworkRules-9191 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi