你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzureRmEventGridSubscription
更新了事件网格事件订阅的属性。
警告
截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。
尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源。
语法
Update-AzureRmEventGridSubscription
[-EventSubscriptionName] <String>
[[-ResourceGroupName] <String>]
[-EndpointType <String>]
[-Endpoint <String>]
[-SubjectBeginsWith <String>]
[-SubjectEndsWith <String>]
[-IncludedEventType <String[]>]
[-Label <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmEventGridSubscription
[-ResourceId] <String>
[-EventSubscriptionName] <String>
[-EndpointType <String>]
[-Endpoint <String>]
[-SubjectBeginsWith <String>]
[-SubjectEndsWith <String>]
[-IncludedEventType <String[]>]
[-Label <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmEventGridSubscription
[-InputObject] <PSEventSubscription>
[-EndpointType <String>]
[-Endpoint <String>]
[-SubjectBeginsWith <String>]
[-SubjectEndsWith <String>]
[-IncludedEventType <String[]>]
[-Label <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmEventGridSubscription
[-EventSubscriptionName] <String>
[-ResourceGroupName] <String>
[-TopicName] <String>
[-EndpointType <String>]
[-Endpoint <String>]
[-SubjectBeginsWith <String>]
[-SubjectEndsWith <String>]
[-IncludedEventType <String[]>]
[-Label <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
更新了事件网格事件订阅的属性。 这可用于更新现有事件订阅的筛选器、目标或标签。
示例
示例 1
PS C:\> Update-AzureRmEventGridSubscription -EventSubscriptionName ES1 -TopicName Topic1 -ResourceGroup MyResourceGroupName -Endpoint https://requestb.in/1kxxoui1
汇报资源组“MyResourceGroupName”中主题“Topic1”的事件订阅“ES1”终结点到“https://requestb.in/1kxxoui1”
示例 2
PS C:\> Get-AzureRmEventGridSubscription -EventSubscriptionName ES1 -TopicName Topic1 -ResourceGroup MyResourceGroupName | Update-AzureRmEventGridSubscription -Endpoint https://requestb.in/1kxxoui1
汇报资源组“MyResourceGroupName”中主题“Topic1”的事件订阅“ES1”终结点到“https://requestb.in/1kxxoui1”
示例 3
PS C:\> Update-AzureRmEventGridSubscription -EventSubscriptionName ES1 -ResourceId "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace" -Endpoint https://requestb.in/1kxxoui1 -SubjectEndsWith "jpg"
汇报 EventHub 命名空间 ContosoNamespace 的事件订阅“ES1”属性,新终结点为“https://requestb.in/1kxxoui1”,新的 SubjectEndsWith 筛选器为“jpg”
示例 4
PS C:\> $labels = "Finance", "HR"
PS C:\> Update-AzureRmEventGridSubscription -EventSubscriptionName ES1 -ResourceGroup MyResourceGroupName -Label $labels
使用新标签$labels汇报资源组“MyResourceGroupName”的事件订阅“ES1”的属性。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Endpoint
事件订阅目标终结点。 可以是 Webhook URL 或 EventHub 的 Azure 资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EndpointType
终结点类型。 这可以是 Webhook 或 eventhub
类型: | String |
接受的值: | webhook, eventhub |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EventSubscriptionName
事件订阅的名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-IncludedEventType
指定要包含的事件类型的列表的筛选器。如果未指定,将包括所有事件类型。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
EventGridSubscription 对象。
类型: | PSEventSubscription |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Label
事件订阅的标签
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
主题的资源组。
类型: | String |
别名: | ResourceGroup |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceId
创建事件订阅的资源的标识符。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SubjectBeginsWith
指定仅包含与指定主题前缀匹配的事件的筛选器。 如果未指定,则包含所有主题前缀的事件。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SubjectEndsWith
指定仅包含与指定主题后缀匹配的事件的筛选器。 如果未指定,则包含所有主题后缀的事件。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TopicName
应向其创建事件订阅的主题的名称。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
参数:InputObject (ByValue)