New-AzureRmNotificationHubsNamespace

Creates a notification hub namespace.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

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

Description

The New-AzureRmNotificationHubsNamespace 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-AzureRmNotificationHubsNamespaceAuthorizationRules 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

PS C:\>New-AzureRmNotificationHubsNamespace -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

PS C:\>New-AzureRmNotificationHubsNamespace -ResourceGroup "ContosoNotificationsGroup" -Location "West US" -Namespace "ContosoPartners" -Tags @{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.

Type:SwitchParameter
Aliases:cf
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:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

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

-Namespace

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

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

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

-SkuTier

Sku tier of the namespace

Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters: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:

Type:Hashtable
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

Inputs

String

Hashtable

Outputs

NamespaceAttributes