New-AzServiceBusNamespace
Creates a new Service Bus namespace.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzServiceBusNamespace
[-ResourceGroupName] <String>
[-Location] <String>
[-Name] <String>
[-SkuName <String>]
[-SkuCapacity <Int32>]
[-Tag <Hashtable>]
[-ZoneRedundant]
[-DisableLocalAuth]
[-IdentityType <String>]
[-IdentityId <String[]>]
[-EncryptionConfig <PSEncryptionConfigAttributes[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzServiceBusNamespace cmdlet creates a new Service Bus namespace. Once created, the namespace resource manifest is immutable. This operation is idempotent.
Examples
Example 1
New-AzServiceBusNamespace -ResourceGroupName Default-ServiceBus-WestUS -Name SB-Example1 -Location WestUS -SkuName "Standard" -Tag @{Tag1="Tag1Value"}
Name : SB-Example1
Id : /subscriptions/{SubscriptionId}/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.ServiceBus/namespaces/SB-Example1
ResourceGroupName : Default-ServiceBus-WestUS
Location : West US
Tags : {TesttingTags, TestingTagValue, TestTag, TestTagValue}
Sku : Name : Standard , Tier : Standard
ProvisioningState : Succeeded
CreatedAt : 1/20/2017 2:07:33 AM
UpdatedAt : 1/20/2017 2:07:56 AM
ServiceBusEndpoint : https://SB-Example1.servicebus.windows.net:443/
Creates a new Service Bus namespace within the specified resource group.
Example 2 - ZoneRedundant and DisableLocalAuth
New-AzServiceBusNamespace -ResourceGroupName Default-ServiceBus-WestUS -Name SB-Example1 -Location WestUS2 -SkuName "Premium" -Tag @{Tag1="Tag1Value"} -ZoneRedundant - DisableLocalAuth
Name : SB-Example1
Id : /subscriptions/{SubscriptionId}/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.ServiceBus/namespaces/SB-Example1
ResourceGroupName : Default-ServiceBus-WestUS
Location : West US
Tags : {TesttingTags, TestingTagValue, TestTag, TestTagValue}
Sku : Name : Premium , Tier : Premium
ProvisioningState : Succeeded
CreatedAt : 9/27/2021 2:07:33 AM
UpdatedAt : 9/27/2021 2:07:56 AM
ServiceBusEndpoint : https://SB-Example1.servicebus.windows.net:443/
Creates a new Service Bus namespace within the specified resource group.
Example 3 - Create namespace with user assigned identity encryption enabled
$config1 = New-AzServiceBusEncryptionConfig -KeyName key1 -KeyVaultUri https://myvaultname.vault.azure.net -UserAssignedIdentity /subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName
$config1 = New-AzServiceBusEncryptionConfig -KeyName key2 -KeyVaultUri https://myvaultname.vault.azure.net -UserAssignedIdentity /subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName
$id1 = '/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName'
$id2 = '/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName2'
New-AzServiceBusNamespace -ResourceGroupName Default-ServiceBus-WestUS -Name SB-Example1 -Location WestUS2 -SkuName "Premium" -IdentityType UserAssigned -IdentityId $id1,$id2 -EncryptionConfig $ec1,$ec2
Name : SB-Example1
Id : /subscriptions/{subscriptionId}/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.ServiceBus/namespaces/SB-Example1
ResourceGroupName : Default-ServiceBus-WestUS
Location : WestUS2
Sku : Name : Premium , Tier : Premium, Capacity : 1
Tags :
ProvisioningState : Succeeded
CreatedAt : 1/4/2022 7:36:35 AM
UpdatedAt : 2/5/2022 6:44:14 AM
ServiceBusEndpoint : https://SB-Example1.servicebus.windows.net:443/
ZoneRedundant : False
DisableLocalAuth : False
Identity : PrinicipalId : , TenantId:
IdentityType : UserAssigned
IdentityId : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName,
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName2
EncryptionConfigs : {{ KeyName: key1,
KeyVaultUri: https://myvaultname.vault.azure.net,
KeyVersion: ,
UserAssignedIdentity: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName
},
{
KeyName: key2,
KeyVaultUri: https://myvaultname.vault.azure.net,
KeyVersion: ,
UserAssignedIdentity: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName2
}}
Creates a new Service Bus namespace with UserAssigned Encryption Enabled. IdentityType can take values "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"
Example 4 - Create namespace with system assigned identity enabled.
New-AzServiceBusNamespace -ResourceGroupName Default-ServiceBus-WestUS -Name SB-Example1 -Location WestUS2 -SkuName "Premium" -IdentityType SystemAssigned
Name : SB-Example1
Id : /subscriptions/{subscriptionId}/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.ServiceBus/namespaces/SB-Example1
ResourceGroupName : Default-ServiceBus-WestUS
Location : WestUS2
Sku : Name : Premium , Tier : Premium, Capacity : 1
Tags :
ProvisioningState : Succeeded
CreatedAt : 1/4/2022 7:36:35 AM
UpdatedAt : 2/5/2022 6:44:14 AM
ServiceBusEndpoint : https://SB-Example1.servicebus.windows.net:443/
ZoneRedundant : False
DisableLocalAuth : False
Identity : PrinicipalId : 000000000, TenantId: 00000000
IdentityType : SystemAssigned
IdentityId :
EncryptionConfigs :
Creates a new Service Bus namespace with SystemAssigned identity enabled. IdentityType can take values "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
enabling or disabling SAS authentication for the Service Bus namespace
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Key Property
| Type: | PSEncryptionConfigAttributes[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
List of user assigned Identity Ids
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Identity Type
| Type: | String |
| Accepted values: | SystemAssigned, UserAssigned, SystemAssigned, UserAssigned, None |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
ServiceBus Namespace Location
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
ServiceBus Namespace Name
| Type: | String |
| Aliases: | NamespaceName |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Resource Group Name
| Type: | String |
| Aliases: | ResourceGroup |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The Service Bus premium namespace throughput units, allowed values 1 or 2 or 4
| Type: | Nullable<T>[Int32] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Namespace Sku Name
| Type: | String |
| Accepted values: | Basic, Standard, Premium |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Hashtables which represents resource Tags
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
enabling or disabling Zone Redundant for namespace
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Inputs
Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
String[]
PSEncryptionConfigAttributes[]