The Set-AzNotificationHubAuthorizationRule cmdlet modifies a Shared Access Signature (SAS) authorization rule assigned to a notification hub.
Authorization rules manage access to your notification hubs by the creation of links, as URIs, based on different permission levels.
Permission levels can be one of the following:
Listen
Send
Manage
Clients are directed to one of these URIs based on the appropriate permission level.
For example, a client given the Listen permission will be directed to the URI for that permission.
This cmdlet provides two ways to modify an authorization rule assigned to a notification hub.
For one, you can create an instance of the SharedAccessAuthorizationRuleAttributes object and then configure that object with the property values you want the rule to possess.
You can configure the object through the .NET Framework.
You can then copy those property values to your rule by using SASRule parameter.
Alternatively, you can create a JSON (JavaScript Object Notation) file containing the relevant configuration values and then apply those values through the InputFile parameter.
A JSON file is a text file that uses syntax similar to this:
{ "Name": "ContosoAuthorizationRule",
"PrimaryKey": "W******Y=",
"Rights": [
"Listen",
"Send"
]
}
When used in conjunction with the New-AzNotificationHubAuthorizationRule cmdlet, the preceding JSON sample modifies an authorization rule named ContosoAuthorizationRule in order to give users Listen and Send rights to the hub.
Examples
Example 1: Modify an authorization rule assigned to a notification hub
This command modifies an authorization rule assigned to the notification hub named ContosoExternalHub.
You must specify the namespace where the hub is located as well as the resource group that the hub is assigned.
Information about the rule that is modified is not included in the command itself.
Instead, that information is found in the input file C:\Configuration\AuthorizationRules.json.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Specifies the notification hub that this cmdlet assigns authorization rules to.
Notification hubs are used to send push notifications to multiple clients regardless of the used by those clients.
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.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.