Edit

Share via


Set-AzNotificationHub

Sets property values for a notification hub.

Syntax

InputFileParameterSet

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

NotificationHubParameterSet

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

Description

The Set-AzNotificationHub cmdlet modifies the property values of a notification hub. You can modify a notification hub property value in two ways. For one, you can create an instance of the NotificationHubAttributes object and then configure that object with the property values you want the new hub to possess. This can be done through the .NET Framework. You can then copy those property values to your hub by through the NotificationHubObj parameter. Alternatively, you can create a JSON (JavaScript Object Notation) file that contains the relevant configuration values, then apply those values by through the InputFile parameter. A JSON file is a text file that uses syntax similar to the following: { "Name": "ContosoNotificationHub", "Location": "West US", } When used in conjunction with the Set-AzNotificationHub cmdlet, the preceding JSON sample sets the Location value of a notification hub named ContosoNotificationHub to West US.

Examples

Example 1: Modify the property values for a notification hub

Set-AzNotificationHub -Namespace "ContosoNamespace" -ResourceGroup "ContosoNotificationsGroup" -InputFile "C:\Configuration\Hubs.json"

This command modifies the property values for a notification hub found in the ContosoNamespace namespace and assigned it to the resource group ContosoNotificationsGroup. The property values, as well as the name of the hub to be modified, are not specified in the command. Instead, that information is contained in the input file C:\Configuration\Hubs.json.

Example 2

Sets property values for a notification hub. (autogenerated)

Set-AzNotificationHub -Namespace 'ContosoNamespace' -NotificationHubObj <NotificationHubAttributes> -ResourceGroup 'ContosoNotificationsGroup'

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

-Force

Do not ask for confirmation.

Parameter properties

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

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 that contains configuration information for the 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 is assigned. 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

-NotificationHubObj

Specifies the NotificationHubAttributes object that contains configuration information for the hub that this cmdlet modifies.

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 is assigned. Resource groups organize items such as namespaces, notification hubs, and authorization rules in ways that help simply inventory management and Azure 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

-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