Share via


Deployments - Create Or Update Deployment

Creates or updates a deployment.

PUT https://{accountEndpoint}/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}

URI Parameters

Name In Required Type Description
accountEndpoint
path True

string

Account endpoint.

deploymentId
path True

string

Deployment identifier.

instanceId
path True

string

Account instance identifier.

Request Body

Name Required Type Description
deploymentId True

string

Gets or sets the deployment identifier.

deploymentType True

DeploymentType

Gets or sets the deployment type.

deviceGroupDefinition True

string[]

Gets or sets the device group definition.

deviceGroupType True

DeviceGroupType

Gets or sets the device group type.

startDateTime True

string (date-time)

Gets or sets the Deployment start datetime.

updateId True

UpdateId

Update identity.

deviceClassId

string

Gets or sets the device class identifier.

isCanceled

boolean

Boolean flag indicating whether the deployment was canceled.

isCompleted

boolean

Boolean flag indicating whether the deployment was completed.

isRetried

boolean

Boolean flag indicating whether the deployment has been retried.

Responses

Name Type Description
200 OK

Deployment

The deployment properties.

404 Not Found

Not found.

Security

azure_auth_implicit

Azure Active Directory OAuth2 Implicit Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Scopes

Name Description
user_impersonation impersonate your user account

azure_auth_code

Azure Active Directory OAuth2 AccessCode Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
user_impersonation impersonate your user account

azure_auth_application

Azure Active Directory OAuth2 Application Flow

Type: oauth2
Flow: application
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
.default client credential scope

azure_auth_password

Azure Active Directory OAuth2 Password Flow

Type: oauth2
Flow: password
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Deployments_CreateOrUpdateDeployment

Sample request

PUT https://contoso.api.adu.microsoft.com/deviceupdate/blue/v2/management/deployments/deploymentId

{
  "deploymentId": "deploymentId",
  "deploymentType": "Complete",
  "deviceClassId": "31ee8c56559847429fbe86e3e87f99b6",
  "startDateTime": "2020-04-22T12:12:12.0000000+00:00",
  "deviceGroupType": "Devices",
  "deviceGroupDefinition": [
    "device1",
    "device2"
  ],
  "updateId": {
    "provider": "provider",
    "name": "name",
    "version": "1.2.3.4"
  }
}

Sample response

{
  "deploymentId": "deploymentId",
  "deploymentType": "Complete",
  "deviceClassId": "31ee8c56559847429fbe86e3e87f99b6",
  "startDateTime": "2020-04-22T12:12:12.0000000+00:00",
  "deviceGroupType": "Devices",
  "deviceGroupDefinition": [
    "device1",
    "device2"
  ],
  "updateId": {
    "provider": "provider",
    "name": "name",
    "version": "1.2.3.4"
  }
}

Definitions

Name Description
Deployment

Deployment metadata.

DeploymentType

Supported deployment types.

DeviceGroupType

Supported deployment group types.

UpdateId

Update identifier.

Deployment

Deployment metadata.

Name Type Description
deploymentId

string

Gets or sets the deployment identifier.

deploymentType

DeploymentType

Gets or sets the deployment type.

deviceClassId

string

Gets or sets the device class identifier.

deviceGroupDefinition

string[]

Gets or sets the device group definition.

deviceGroupType

DeviceGroupType

Gets or sets the device group type.

isCanceled

boolean

Boolean flag indicating whether the deployment was canceled.

isCompleted

boolean

Boolean flag indicating whether the deployment was completed.

isRetried

boolean

Boolean flag indicating whether the deployment has been retried.

startDateTime

string (date-time)

Gets or sets the Deployment start datetime.

updateId

UpdateId

Update identity.

DeploymentType

Supported deployment types.

Value Description
Complete

A complete deployment including download, install, and apply actions.

Download

A download-only deployment that does not include any install or apply actions. Not currently supported.

Install

An install-only rollout that does not include any download actions, only install and complete. Not currently supported.

DeviceGroupType

Supported deployment group types.

Value Description
All

The deployment should be sent to all devices in the device class.

Devices

The deployment should be sent to the list of devices in the device group definition.

DeviceGroupDefinitions

The deployment should be sent to the list of devices returned by the union of all the device group definition queries.

UpdateId

Update identifier.

Name Type Description
name

string

Update name.

provider

string

Update provider.

version

string

Update version.