Düzenle

Aracılığıyla paylaş


Test-AzServiceBusName

Checks availability of a namespace name or disaster recovery alias.

Syntax

Test-AzServiceBusName
    -NamespaceName <String>
    [-SubscriptionId <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [<CommonParameters>]
Test-AzServiceBusName
    -NamespaceName <String>
    [-SubscriptionId <String>]
    -AliasName <String>
    -ResourceGroupName <String>
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [<CommonParameters>]

Description

Checks availability of a namespace name or disaster recovery alias.

Examples

Example 1: Check the availability of a ServiceBus namespace name

Test-AzServiceBusName -NamespaceName myNamespace

Message                                                                                                NameAvailable Reason
-------                                                                                                ------------- ------
The specified name is not available. For more information visit https://aka.ms/eventhubsarmexceptions.         False NameInUse

Checks the availability of namespace name myNamespace.

Example 2: Check the availability of a ServiceBus Geo Disaster Recovery Alias

Test-AzServiceBusName -NamespaceName myNamespace -ResourceGroupName myResourceGroup -AliasName myAlias

Message                                                                                                NameAvailable Reason
-------                                                                                                ------------- ------
The specified name is not available. For more information visit https://aka.ms/eventhubsarmexceptions.         False NameInUse

Checks the availability of alias name myAlias on namespace myNamepace.

Parameters

-AliasName

The name of Disaster Recovery Config alias.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NamespaceName

The name of ServiceBus namespace

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

ICheckNameAvailabilityResult