Capture VM Image


The Capture VM Image operation creates a copy of the operating system virtual hard disk (VHD) and all of the data VHDs that are associated with the Virtual Machine, saves the VHD copies in the same storage location as the original VHDs, and registers the copies as a VM Image in the image repository that is associated with the specified subscription.


The Capture VM Image request may be specified as follows. Replace <subscription-id> with the subscription ID, <cloudservice-name> with the name of the cloud service, <deployment-name> with the name of the deployment, and <role-name> with the name of the Virtual Machine.


Request URI


You must make sure that the request that is made to the management service is secure.

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 2014-02-01 or higher.

Request Body

The following example shows the format of the request body:

<CaptureRoleAsVMImageOperation xmlns="" xmlns:i="">

The following table describes the elements of the request body.

Element name



Required. Must be set to CaptureRoleAsVMImageOperation.


Required. Specifies the state of the operating system in the image.

Possible values are:

  • Generalized

  • Specialized

A Virtual Machine that is fully configured and running contains a Specialized operating system. A Virtual Machine on which the Sysprep command has been run with the generalize option contains a Generalized operating system. If you capture an image from a generalized Virtual Machine, the machine is deleted after the image is captured. It is recommended that all Virtual Machines are shut down before capturing an image.


Required. Specifies the name of the VM Image.


Required. Specifies the label of the VM Image.


Optional. Specifies the description of the VM Image.

The Description element is only available using version 2014-05-01 or higher.


Optional. Specifies the language of the VM Image.

The Language element is only available using version 2014-05-01 or higher.


Optional. Specifies a value that can be used to group VM Images.

The ImageFamily element is only available using version 2014-05-01 or higher.


Optional. Specifies the size to use for the Virtual Machine that is created from the VM Image.

The RecommendedVMSize element is only available using version 2014-05-01 or higher.


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

Status Code

A successful operation returns status code 201 (Created).

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