Share via


New-AzNotificationHubAuthorizationRule

Hiermee maakt u een autorisatieregel en wijst u de regel toe aan een Notification Hub.

Syntax

New-AzNotificationHubAuthorizationRule
   [-ResourceGroup] <String>
   [-Namespace] <String>
   [-NotificationHub] <String>
   [-InputFile] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzNotificationHubAuthorizationRule
   [-ResourceGroup] <String>
   [-Namespace] <String>
   [-NotificationHub] <String>
   [-SASRule] <SharedAccessAuthorizationRuleAttributes>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Met de cmdlet New-AzNotificationHubAuthorizationRule maakt u een sas-autorisatieregel (Shared Access Signature) van de Notification Hub. Autorisatieregels worden gebruikt om de toegang tot uw Notification Hubs te beheren. Dit wordt gedaan door het maken van koppelingen, als URI's, op basis van verschillende machtigingsniveaus. Clients worden omgeleid naar een van deze URI's op basis van het juiste machtigingsniveau. Een client met de listen-machtiging wordt bijvoorbeeld omgeleid naar de URI voor die machtiging.

Voorbeelden

Voorbeeld 1: Een autorisatieregel voor de Notification Hub maken

New-AzNotificationHubAuthorizationRule -Namespace "ContosoNamespace" -NotificationHub "ContosoInternalHub" -ResourceGroup "ContosoNotificationsGroup" -InputFile "C:\Configuration\ExternalAccessRule.json"

Met deze opdracht maakt u een nieuwe autorisatieregel en wijst u deze toe aan de Notification Hub met de naam ContosoInternalHub. Deze hub bevindt zich in de naamruimte ContosoNamespace en wordt toegewezen aan de resourcegroep ContosoNotificationsGroup. Houd er rekening mee dat alle configuratiegegevens voor de regel, inclusief de regelnaam, worden opgehaald uit het invoerbestand C:\Configuration\ExternalAccessRule.json.

Parameters

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

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

-DefaultProfile

De referenties, het account, de tenant en het abonnement dat wordt gebruikt voor communicatie met Azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputFile

Hiermee geeft u het invoerbestand voor de autorisatieregel die door deze cmdlet wordt gemaakt.

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

-Namespace

Hiermee geeft u de naamruimte waaraan de autorisatieregels zijn toegewezen. Naamruimten bieden een manier om Notification Hubs te groeperen en te categoriseren.

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

-NotificationHub

Hiermee geeft u de Notification Hub op waaraan de autorisatieregels worden toegewezen. Notification Hubs worden gebruikt voor het verzenden van pushmeldingen naar meerdere clients, ongeacht het platform dat door deze clients wordt gebruikt. Houd er rekening mee dat u de naam van een bestaande Notification Hub moet opgeven. De cmdlet New-AzNotificationHubAuthorizationRule kan geen nieuwe Notification Hubs maken.

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

-ResourceGroup

Hiermee geeft u de resourcegroep aan waaraan de Notification Hub is toegewezen.

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

-SASRule

Hiermee geeft u het object SharedAccessAuthorizationRuleAttributes met configuratiegegevens voor de nieuwe regels op.

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

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

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

Invoerwaarden

String

Uitvoerwaarden

SharedAccessAuthorizationRuleAttributes