New-AzureSBAuthorizationRule
Creates new Service Bus authorization rule.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
EntitySAS
New-AzureSBAuthorizationRule
-Name <String>
-Namespace <String>
-EntityName <String>
-EntityType <ServiceBusEntityType>
[-Permission <AccessRights[]>]
[-PrimaryKey <String>]
[-SecondaryKey <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
NamespaceSAS
New-AzureSBAuthorizationRule
-Name <String>
-Namespace <String>
[-Permission <AccessRights[]>]
[-PrimaryKey <String>]
[-SecondaryKey <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
The New-AzureSBAuthorizationRule cmdlet creates a Service Bus authorization rule.
Important
The Service Management REST API for Service Bus will be retired by November 1, 2021. Go to the deprecation of Azure Service Manager for more information about the retirement of the API. This Azure Service Management PowerShell cmdlet for Service Bus will no longer be supported as of November 1, 2021. Please migrate to the new Azure PowerShell cmdlets
Examples
Example 1: Create an authorization rule with generated primary key
PS C:\> New-AzureSBAuthorizationRule -Name MyRule -Namespace MyNamespace -Permission $("Send")
Creates new authorization rule on namespace level with Send permission.
Example 2: Creates an authorization rule by providing the primary key
PS C:\> New-AzureSBAuthorizationRule -Name MyRule -Namespace MyNamespace -Permission $("Manage", "Listen", "Send") -EntityName MyEntity -EntityType Queue -PrimaryKey P+lL/Mnd2Z9sj5hwMrRyAxQDdX8RHfbdqU2eIAqs1rc=
Creates new authorization rule on MyEntity Queue level with all permissions.
Parameters
-EntityName
Specifies the entity name to apply rule at.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
EntitySAS
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-EntityType
Specifies the entity type. Valid values are:
- Queue
- Topic
- Relay
- NotificationHub
Parameter properties
Type: | ServiceBusEntityType |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
EntitySAS
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specifies the unique authorization rule name.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Namespace
Specifies the namespace name to apply the authorization rule. If no EntityName provided the rule will be on the namespace level.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Permission
The authorization permissions (Send, Manage, Listen).
Parameter properties
Type: | AccessRights[] |
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 |
-PrimaryKey
Specifies the Shared Access Signature primary key. Will be generated if not provided.
Parameter properties
Type: | String |
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 |
-Profile
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Parameter properties
Type: | AzureSMProfile |
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 |
-SecondaryKey
Specifies the Shared Access Signature secondary key.
Parameter properties
Type: | String |
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 |
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.