你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzEventHubAuthorizationRule
为命名空间或事件中心创建新的事件中心授权规则。
语法
New-AzEventHubAuthorizationRule
[-ResourceGroupName] <String>
[-Namespace] <String>
[-Name] <String>
-Rights <String[]>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzEventHubAuthorizationRule
[-ResourceGroupName] <String>
[-Namespace] <String>
[-EventHub] <String>
[-Name] <String>
-Rights <String[]>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzEventHubAuthorizationRule cmdlet 创建新的事件中心授权规则。
示例
示例 1
PS C:\> New-AzEventHubAuthorizationRule -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -AuthorizationRuleName MyAuthRuleName -Rights @("Listen","Send")
使用资源组“MyResourceGroupName”创建授权规则“MyAuthRuleName”,向命名空间“MyNamespaceName”授予侦听和发送权限。
示例 2
PS C:\> New-AzEventHubAuthorizationRule -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -EventHubName MyEventHubName -AuthorizationRuleName MyAuthRuleName -Rights @("Listen","Send")
使用资源组“MyResourceGroupName”创建授权规则“MyAuthRuleName”,向命名空间“MyNamespaceName”中的事件中心“MyEventHubName”授予侦听和发送权限。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EventHub
EventHub 名称
类型: | String |
别名: | EventHubName |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
AuthorizationRule 名称
类型: | String |
别名: | AuthorizationRuleName |
Position: | 3 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Namespace
命名空间名称
类型: | String |
别名: | NamespaceName |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
资源组名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Rights
权限,例如“侦听”、“发送”、“管理”
类型: | String[] |
接受的值: | Listen, Send, Manage |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
String[]