你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzureSBAuthorizationRule
获取服务总线授权规则。
注意
本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用。
Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。
语法
Get-AzureSBAuthorizationRule
[-Name <String>]
[-Permission <AccessRights[]>]
-Namespace <String>
-EntityName <String>
-EntityType <ServiceBusEntityType>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Get-AzureSBAuthorizationRule
[-Name <String>]
[-Permission <AccessRights[]>]
-Namespace <String>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
说明
获取服务总线授权规则。
重要
服务总线的服务管理 REST API 将于 2021 年 11 月 1 日停用。 有关 API 停用的详细信息,请转到 弃用 Azure Service Manager 。 自 2021 年 11 月 1 日起,将不再支持适用于 服务总线的 Azure 服务管理 PowerShell cmdlet。 请迁移到新的 Azure PowerShell cmdlet
示例
示例 1:在命名空间级别获取授权规则
PS C:\> Get-AzureSBAuthorizationRule -Namespace MyNamespace
获取 MyNamespace 上的所有可用授权规则。
示例 2:获取队列的授权规则
PS C:\> Get-AzureSBAuthorizationRule -Namespace MyNamespace -EntityName MyEntity -EntityType Queue
获取 MyNamespace 上 MyEntity 队列的所有可用授权规则。
示例 3:按名称获取授权规则
PS C:\> Get-AzureSBAuthorizationRule -Name MyRule -Namespace MyNamespace
获取 MyNamespace 级别的名为 MyRule 的授权规则。
示例 4:按权限获取授权规则
PS C:\> Get-AzureSBAuthorizationRule -Namespace MyNamespace -Permission $("Send")
获取对命名空间级别具有发送权限的所有授权规则。
参数
-EntityName
要应用规则的实体名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-EntityType
实体类型(队列、主题、中继、NotificationHub)。
类型: | ServiceBusEntityType |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
唯一的授权规则名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Namespace
要应用授权规则的命名空间名称。 如果未提供 EntityName,规则将位于命名空间级别。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Permission
筛选的授权权限(发送、管理、侦听)。 这使用完全匹配。
类型: | AccessRights[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Profile
指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。
类型: | AzureSMProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |