Edit

Share via


New-AzNotificationHub

Creates a notification hub.

Syntax

InputFileParameterSet

New-AzNotificationHub
    [-ResourceGroup] <String>
    [-Namespace] <String>
    [-InputFile] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

NotificationHubParameterSet

New-AzNotificationHub
    [-ResourceGroup] <String>
    [-Namespace] <String>
    [-NotificationHubObj] <NotificationHubAttributes>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzNotificationHub cmdlet creates a notification hub. Notification hubs are used to send push notifications to multiple clients regardless of the platform used by those clients. Notification hubs are roughly equivalent to individual apps: each of your apps will typically have its own notification hub. The New-AzNotificationHub cmdlet provides two ways to create a new notification hub. You can create an instance of the NotificationHubAttributes object and then configure that object. You can then copy those property values to your new hub by through the NotificationHubObj parameter. Alternatively, you can create a JSON (JavaScript Object Notation) file containing the relevant configuration values and then apply those values by using the InputFile parameter. When used in conjunction with the New-AzNotificationHub cmdlet, the preceding JSON sample creates a notification hub named ContosoNotificationHub located on the West US datacenter.

Examples

Example 1: Create a notification hub

New-AzNotificationHub -Namespace "ContosoNamespace" -ResourceGroup "ContosoNotificationsGroup" -InputFile "C:\Configurations\InternalHub.json"

This command creates a notification hub in the namespace ContosoNamespace. The new hub will be assigned to the ContosoNotificationsGroup. You do not need to specify a name or any other configuration information for the hub; that information will be taken from the input file C:\Configurations\InternalHub.json.

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

-InputFile

Specifies the path to a JSON file containing configuration values for the new notification hub.

Parameter properties

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

Parameter sets

InputFileParameterSet
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Namespace

Specifies the namespace to which the notification hub will be assigned. Namespaces provide a way to group and categorize notification hubs. Notification hubs must be assigned to an existing namespace. The New-AzNotificationHub cmdlet cannot create a new namespace.

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

-NotificationHubObj

Specifies the NotificationHubAttributes object that contains configuration information for the new hub.

Parameter properties

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

Parameter sets

NotificationHubParameterSet
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroup

Specifies the resource group to which the notification hub will be assigned. Resource groups organize items such as namespaces, notification hubs, and authorization rules in ways that help simply inventory management and Azure administration. You must use an existing resource group. The New-AzNotificationHub cmdlet cannot create a new resource group.

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

-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

Outputs

NotificationHubAttributes