Modifier

Partager via


New-AzServiceBusAuthorizationRuleSASToken

Generates a SAS token for Azure servicebus authorization rule of namespace/queue/topic.

Syntax

New-AzServiceBusAuthorizationRuleSASToken
   [-AuthorizationRuleId] <String>
   [-KeyType] <String>
   [-ExpiryTime] <DateTime>
   [-StartTime <DateTime>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzServiceBusAuthorizationRuleSASToken cmdlet generates a Shared Access Signature (SAS) token for an Azure Eventhub Namesapce or Azure Eventhub

Examples

Example 1

$StartTime = Get-Date
$EndTime = $StartTime.AddHours(2.0)
$SasToken = New-AzServiceBusAuthorizationRuleSASToken -AuthorizationRuleId $updatedAuthRule.Id  -KeyType Primary -ExpiryTime $EndTime -StartTime $StartTime

Generate SAS token for the given authorization rule for Namespace with start and expiry time..

Example 2

$StartTime = Get-Date
$EndTime = $StartTime.AddHours(2.0)
$SasToken = New-AzServiceBusAuthorizationRuleSASToken -AuthorizationRuleId $updatedAuthRule.Id  -KeyType Primary -ExpiryTime $EndTime

Generate SAS token for the given authorization rule for Namespace with expiry time.

Parameters

-AuthorizationRuleId

ARM ResourceId of the Authorization Rule

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

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

-ExpiryTime

Expiry Time

Type:Nullable<T>[DateTime]
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-KeyType

Key Type

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

-StartTime

Start Time

Type:Nullable<T>[DateTime]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

Inputs

String

Nullable<T>[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

PSSharedAccessSignatureAttributes