你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ConfigurationsClient.ApplyConfigurationContentOnDeviceAsync 方法

定义

将配置内容应用于 Edge 设备。

public virtual System.Threading.Tasks.Task ApplyConfigurationContentOnDeviceAsync(string deviceId, Microsoft.Azure.Devices.ConfigurationContent content, System.Threading.CancellationToken cancellationToken = default);
abstract member ApplyConfigurationContentOnDeviceAsync : string * Microsoft.Azure.Devices.ConfigurationContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ApplyConfigurationContentOnDeviceAsync : string * Microsoft.Azure.Devices.ConfigurationContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function ApplyConfigurationContentOnDeviceAsync (deviceId As String, content As ConfigurationContent, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

deviceId
String

设备 ID。

content
ConfigurationContent

配置。

cancellationToken
CancellationToken

允许取消操作的标记。

返回

例外

当提供的 deviceIdcontent 为 null 时引发。

如果 为空或空格, deviceId 则引发。

如果 IoT 中心使用不成功的状态代码响应请求,则引发。 例如,如果提供的请求受到限制, IotHubServiceException 则会引发 和 ThrottlingException 。 有关可能的错误情况的完整列表,请参阅 IotHubServiceErrorCode

如果 HTTP 请求因网络连接、DNS 故障或服务器证书验证等根本问题而失败。

如果提供的 cancellationToken 已请求取消。

注解

需要 ModulesContentDeviceContent 是可选项。 ModuleContent 不适用。

适用于