< Back

Set-AzureRmNotificationHubAuthorizationRules

Tue Jan 29, 2019 9:59 pm

NAME Set-AzureRmNotificationHubAuthorizationRules



SYNOPSIS

Sets authorization rules for a notification hub.





SYNTAX

Set-AzureRmNotificationHubAuthorizationRules [-ResourceGroup] <String> [-Namespace] <String> [-NotificationHub] <String> [-InputFile] <String>

[-DefaultProfile <IAzureContextContainer>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]



Set-AzureRmNotificationHubAuthorizationRules [-ResourceGroup] <String> [-Namespace] <String> [-NotificationHub] <String> [-SASRule]

<SharedAccessAuthorizationRuleAttributes> [-DefaultProfile <IAzureContextContainer>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmNotificationHubAuthorizationRules 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": "WE4qH0398AyXjlekt56gg1gMR3NHoMs29KkUnnpUk01Y=",

"Rights": [

"Listen",

"Send"

]

}

When used in conjunction with the New-AzureRmNotificationHubAuthorizationRules cmdlet, the preceding JSON sample modifies an authorization rule

named ContosoAuthorizationRule in order to give users Listen and Send rights to the hub.







PARAMETERS

-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Do not ask for confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InputFile <String>

Specifies the path to a JSON file containing configuration information for the new rule.



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Namespace <String>

Specifies the namespace to which the notification hub is assigned. Namespaces provide a way to group and categorize notification hubs.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NotificationHub <String>

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.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroup <String>

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.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SASRule <SharedAccessAuthorizationRuleAttributes>

Specifies the SharedAccessAuthorizationRuleAttributes object that contains configuration information for the authorization rules that are

modified.



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.NotificationHubs.Models.SharedAccessAuthorizationRuleAttributes







NOTES









Example 1: Modify an authorization rule assigned to a notification hub



PS C:\\>Set-AzureRmNotificationHubAuthorizationRules -Namespace "ContosoNamespace" -ResourceGroup "ContosoNotificationGroup" -NotificationHub

"ContosoExternalHub" -InputFile "C:\\Configuration\\AuthorizationRules.json"



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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ationrules

Get-AzureRmNotificationHubAuthorizationRules

New-AzureRmNotificationHubAuthorizationRules

Remove-AzureRmNotificationHubAuthorizationRules