你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzApiManagementLogger
修改 API 管理记录器。
语法
Set-AzApiManagementLogger
-Context <PsApiManagementContext>
-LoggerId <String>
[-Name <String>]
[-ConnectionString <String>]
[-Description <String>]
[-IsBuffered]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzApiManagementLogger
-Context <PsApiManagementContext>
-LoggerId <String>
[-InstrumentationKey <String>]
[-Description <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-AzApiManagementLogger cmdlet 修改 Azure API 管理 记录器的设置。
示例
示例 1:修改 EventHub 记录器
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Set-AzApiManagementLogger -Context $apimContext -LoggerId "Logger123" -Name "ContosoSdkEventHub" -ConnectionString "Endpoint=sb://ContosoSdkEventHubs.servicebus.windows.net/;SharedAccessKeyName=SendKey;SharedAccessKey=<key>" -Description "updated SDK event hub logger" -PassThru
此命令修改 ID 为 Logger123 的记录器。
示例 2
修改 API 管理记录器。 (自动生成)
Set-AzApiManagementLogger -Confirm -Context <PsApiManagementContext> -InstrumentationKey <String> -LoggerId 'Logger123'
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConnectionString
指定包含发送策略权限的 Azure 事件中心连接字符串。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Context
指定 PsApiManagementContext 对象。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Description
指定说明。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-InstrumentationKey
Application Insights 的检测密钥。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-IsBuffered
指定在发布之前缓冲记录器中的记录。 缓冲记录时,每 15 秒或缓冲区接收 256 KB 的消息时,它们每 15 秒发送到事件中心。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-LoggerId
指定要更新的记录器 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
从 Azure 经典门户指定事件中心的实体名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-PassThru
指示此 cmdlet 返回此 cmdlet 修改的 PsApiManagementLogger。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |