def METHOD_NAME(namespace_name: Optional[str] = None,
                                       resource_group_name: Optional[str] = None,
                                       virtual_network_rule_name: Optional[str] = None,
                                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNamespaceVirtualNetworkRuleResult:
    """
    Gets an VirtualNetworkRule for a Namespace by rule name.
    Azure REST API version: 2018-01-01-preview.
    :param str namespace_name: The namespace name
    :param str resource_group_name: Name of the Resource group within the Azure subscription.
    :param str virtual_network_rule_name: The Virtual Network Rule name.
    """
    __args__ = dict()
    __args__['namespaceName'] = namespace_name
    __args__['resourceGroupName'] = resource_group_name
    __args__['virtualNetworkRuleName'] = virtual_network_rule_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure-native:servicebus:getNamespaceVirtualNetworkRule', __args__, opts=opts, typ=GetNamespaceVirtualNetworkRuleResult).value
    return AwaitableGetNamespaceVirtualNetworkRuleResult(
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        type=pulumi.get(__ret__, 'type'),
        virtual_network_subnet_id=pulumi.get(__ret__, 'virtual_network_subnet_id'))