Virtual Machines - Capture

Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture?api-version=2018-06-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

The name of the resource group.

vmName
path True
  • string

The name of the virtual machine.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
destinationContainerName True
  • string

The destination container name.

overwriteVhds True
  • boolean

Specifies whether to overwrite the destination virtual hard disk, in case of conflict.

vhdPrefix True
  • string

The captured virtual hard disk's name prefix.

Responses

Name Type Description
200 OK

OK

202 Accepted

Accepted

Security

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

Name Description
user_impersonation impersonate your user account

Definitions

VirtualMachineCaptureParameters

Capture Virtual Machine parameters.

VirtualMachineCaptureResult

Output of virtual machine capture operation.

VirtualMachineCaptureParameters

Capture Virtual Machine parameters.

Name Type Description
destinationContainerName
  • string

The destination container name.

overwriteVhds
  • boolean

Specifies whether to overwrite the destination virtual hard disk, in case of conflict.

vhdPrefix
  • string

The captured virtual hard disk's name prefix.

VirtualMachineCaptureResult

Output of virtual machine capture operation.

Name Type Description
$schema
  • string

the schema of the captured virtual machine

contentVersion
  • string

the version of the content

id
  • string

Resource Id

parameters
  • object

parameters of the captured virtual machine

resources
  • object[]

a list of resource items of the captured virtual machine