Share via

Add Data Disk


The Add Data Disk operation adds a data disk to a Virtual Machine.


The Add Data Disk request may be specified as follows. Replace <subscription-id> with the subscription ID, <service-name> with the name of the cloud service, <deployment-name> with the name of the deployment, and <role-name> with the name of the role to which the data disk is to be added.


Request URI


URI Parameters


Request Headers

The following table describes the request headers.

Request Header



Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01 or higher.

Request Body

The format of the request body is as follows:

<DataVirtualHardDisk xmlns="" xmlns:i="">

The following table describes the elements of the request body

Element name



Optional. Specifies the caching behavior of data disk.

Possible values are:

  • None

  • ReadOnly

  • ReadWrite

The default vault is None.


Optional. Specifies the identifier of the data disk. This value is only available programmatically and is not shown in the Management Portal.


Optional. Specifies the name of the disk. If this value matches an existing registered disk, the existing disk is attached to the Virtual Machine. If this element is not specified, a name is automatically generated.


Optional when adding the first data disk to a Virtual Machine. Specifies the Logical Unit Number (LUN) for the disk. The LUN specifies the slot in which the data drive appears when mounted for usage by the Virtual Machine. Valid LUN values are 0 through 31.


Optional. Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. If SourceMediaLink is specified or DiskName refers to an existing disk in the subscription, then this element is ignored.


Required. Specifies the location of the blob in storage where the vhd file for the disk is located. The storage account where the vhd is located must be associated with the specified subscription. If SourceMediaLink is not specified, an empty disk is created at the location specified by this element.


If DiskName refers to an existing registered disk, this element is ignored.


Optional. Specifies the location of a blob in storage which where a vhd file is located that is imported and registered as a disk. If this element is specified, MediaLink is not used.


The response includes an HTTP status code and a set of response headers.

Status Code

A successful operation returns status code 202 (Accepted).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers.

Response Header



A value that uniquely identifies a request made against the management service.

Response Body