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

DeviceManagementClient.DeleteDeploymentAsync 方法

定义

删除部署。

public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDeploymentAsync (string groupId, string deploymentId, Azure.RequestContext context = default);
abstract member DeleteDeploymentAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.DeleteDeploymentAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function DeleteDeploymentAsync (groupId As String, deploymentId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

参数

groupId
String

组标识符。

deploymentId
String

部署标识符。

context
RequestContext

请求上下文,它可以基于每个调用替代客户端管道的默认行为。

返回

从服务返回的响应。

例外

groupIddeploymentId 为 null。

groupIddeploymentId 是空字符串,预期为非空。

服务返回了不成功状态代码。

示例

此示例演示如何使用所需参数调用 DeleteDeploymentAsync。

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceManagementClient(endpoint, "<instanceId>", credential);

Response response = await client.DeleteDeploymentAsync("<groupId>", "<deploymentId>");
Console.WriteLine(response.Status);

注解

Response Error架构:

{
              error: {
                code: string,
                message: string,
                target: string,
                details: [Error],
                innererror: {
                  code: string,
                  message: string,
                  errorDetail: string,
                  innerError: InnerError
                },
                occurredDateTime: string (ISO 8601 Format)
              }
            }

适用于