Lab Plans - Save Image

Save an image from a lab VM to the attached shared image gallery.
Saves an image from a lab VM to the attached shared image gallery.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/saveImage?api-version=2023-06-07

URI Parameters

Name In Required Type Description
labPlanName
path True

string

The name of the lab plan that uniquely identifies it within containing resource group. Used in resource URIs and in UI.

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Type Description
labVirtualMachineId

string

The ID of the lab virtual machine you want to save an image from.

name

string

The name for the image we create.

Responses

Name Type Description
200 OK

The request was successful.

202 Accepted

The request was accepted.

Other Status Codes

ErrorResponse

The default error response.

Examples

saveImageVirtualMachine

Sample Request

POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan/saveImage?api-version=2023-06-07

{
  "name": "Test Image",
  "labVirtualMachineId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/virtualMachines/template"
}

Sample Response

Location: https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.LabServices/operationresults/a64149d8-84cb-4566-ab8e-b4ee1a074174

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

SaveImageBody

Body for the save image POST

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

SaveImageBody

Body for the save image POST

Name Type Description
labVirtualMachineId

string

The ID of the lab virtual machine you want to save an image from.

name

string

The name for the image we create.