Images - Create Or Update

Updates an image via PUT.
Updates an image resource via PUT. Creating new resources via PUT will not function.

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

URI Parameters

Name In Required Type Description
imageName
path True

string

The image name.

Regex pattern: ^[-\w\\._\\(\\)]+$

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 Required Type Description
properties.enabledState True

EnableState

Is the image enabled

properties.availableRegions

string[]

The available regions of the image in the shared gallery.

Responses

Name Type Description
200 OK

Image

The request was successful; the image is returned

Other Status Codes

ErrorResponse

The default error response.

Examples

putImage

Sample Request

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

{
  "properties": {
    "enabledState": "Enabled"
  }
}

Sample Response

{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan/images/image1",
  "name": "image1",
  "type": "Microsoft.LabServices/Image",
  "systemData": {
    "createdBy": "identity123",
    "createdByType": "User",
    "createdAt": "2020-05-01T10:00:00Z",
    "lastModifiedBy": "identity123",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2020-06-01T09:12:28Z"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "displayName": "Windows Server 2019 Datacenter",
    "description": "A description of the image",
    "osType": "Windows",
    "offer": "WindowsServer",
    "publisher": "Microsoft",
    "sku": "2019-Datacenter",
    "version": "2019.0.20190410",
    "enabledState": "Enabled"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

EnableState

The status of image terms of use (enabled = accepted, disabled = not accepted).

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

Image

Lab services virtual machine image

OsState

The OS State of the image.

OsType

The OS Type of the image.

ProvisioningState

Current provisioning state of the image.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

EnableState

The status of image terms of use (enabled = accepted, disabled = not accepted).

Name Type Description
Disabled

string

Enabled

string

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.

Image

Lab services virtual machine image

Name Type Default Value Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.author

string

The image author.

properties.availableRegions

string[]

The available regions of the image in the shared gallery.

properties.description

string

A description of the image.

properties.displayName

string

The image display name.

properties.enabledState

EnableState

Disabled

Is the image enabled

properties.iconUrl

string

URL of the image icon.

properties.offer

string

The ID of an offer associated with the image.

properties.osState

OsState

The OS State of the image.

properties.osType

OsType

The OS Type of the image.

properties.plan

string

The ID of marketplace plan associated with the image (optional).

properties.provisioningState

ProvisioningState

Current provisioning state of the image.

properties.publisher

string

The ID of the publisher of the image.

properties.sharedGalleryId

string

The ID for the image in the shared gallery.

properties.sku

string

The image SKU.

properties.termsStatus

EnableState

The status of image terms of use (enabled = accepted, disabled = not accepted).

properties.version

string

The image version.

systemData

systemData

Metadata pertaining to creation and last modification of the image.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

OsState

The OS State of the image.

Name Type Description
Generalized

string

Image does not contain any machine and user specific information.

Specialized

string

Image contains machine and user specific information.

OsType

The OS Type of the image.

Name Type Description
Linux

string

Windows

string

ProvisioningState

Current provisioning state of the image.

Name Type Description
Creating

string

Resource is in the process of being created.

Deleting

string

Resource is in the process of being deleted.

Failed

string

Previous operation on the resource has failed leaving resource in unhealthy state.

Locked

string

The resource is locked and changes are currently blocked. This could be due to maintenance or a scheduled operation. The state will go back to succeeded once the locking operation has finished.

Succeeded

string

Resource is in healthy state after creation or update operation.

Updating

string

New property values are being applied to the resource.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.