Edit

Share via


New-AzNotificationHubsNamespace

Creates a notification hub namespace.

Syntax

Default (Default)

New-AzNotificationHubsNamespace
    [-ResourceGroup] <String>
    [-Namespace] <String>
    [-Location] <String>
    [[-Tag] <Hashtable>]
    [[-SkuTier] <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzNotificationHubsNamespace cmdlet creates a notification hub namespace. Namespaces are logical containers that help you organize and manage your notification hubs. You must have at least one notification hub namespace. A single namespace can house multiple hubs. You can have multiple namespaces to organize your hubs, or to give specific individuals permission to manage a selected subset of your hubs. To create a namespace, make sure that you specify a unique name for the namespace; specify the datacenter where the namespace will be located; and, specify the resource group that the namespace will be assigned to. After the namespace has been created you can use the New-AzNotificationHubsNamespaceAuthorizationRules cmdlet to assign authorization rules to that namespace. Authorization rules are used to manage permissions to the namespace.

Examples

Example 1: Create a notification hub

New-AzNotificationHubsNamespace -ResourceGroup "ContosoNotificationsGroup" -Location "West US" -Namespace "ContosoPartners"

This command creates a notification hub named ContosoPartners. The namespace will be located in the West US datacenter and be assigned to the ContosoNotificationsGroup resource group.

Example 2: Create a notification hub with tags

New-AzNotificationHubsNamespace -ResourceGroup "ContosoNotificationsGroup" -Location "West US" -Namespace "ContosoPartners" -Tag @{Name="Audience";Value="PartnerOrganizations"}

This command creates a notification hub named ContosoPartners. The namespace will be located in the West US datacenter and be assigned to the ContosoNotificationsGroup resource group. In addition, this command creates a tag with the name Audience and the value PartnerOrganizations and is assigned to the namespace. This ensures that the namespace will be displayed any time you filter for items where the Audience tag is set to PartnerOrganizations.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

Specifies the display name of the datacenter that will host the Namespace. Although you can set this parameter to any valid location, for optimal performance you might want to use a datacenter located near the majority of your users.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Namespace

Specifies the name of the new namespace. Namespaces provide a way to group and categorize notification hubs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroup

Specifies the resource group to which the namespace will be assigned. Resource groups organize items such as namespaces, notification hubs, and authorization rules in ways that help simply inventory management and administration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkuTier

Sku tier of the namespace

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Tag

Specifies name-value pairs that can be used to categorize and organize Azure items. Tags function similar to keywords, and operate across a deployment. For example, if you search for all items with the tag Department:IT the search will return all the Azure items that have that tag, regardless of such things as item type, location, or resource group. An individual tag consists of two parts: the Name and, optionally, the Value. For instance, in Department:IT, the tag name is Department and the tag value is IT. To add a tag, use hash table syntax similar to this, which creates the tag CalendarYear:2016:

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Hashtable

Outputs

NamespaceAttributes