---
title: "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage"
method: POST
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage"
---

# POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage

`POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage`
- Auth: OAuth 2
  - Implicit: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Scopes: `user_impersonation`

This feature is currently in preview.

Reimage one or more virtual machines. Reimaging is destructive and can replace operating system disk contents. Bulk Actions begins processing the request immediately and returns a Bulk Action Operation Id for each virtual machine. Use the returned IDs to get operation status updates.

## Path parameters

- `location` string, required

## Parameters

- `../../../../../../common-types/resource-management/v6/types.json#/components/parameters/ApiVersionParameter` (unresolved $ref)
- `../../../../../../common-types/resource-management/v6/types.json#/components/parameters/SubscriptionIdParameter` (unresolved $ref)
- `../../../../../../common-types/resource-management/v6/types.json#/components/parameters/ResourceGroupNameParameter` (unresolved $ref)

## Request body

- ExecuteReimageRequest: The virtual machines and configuration for a bulk reimage action.
  - `executionParameters` ExecutionParameters, required: The execution settings for a bulk action.
    - `retryPolicy` RetryPolicy: The retry settings for a bulk action.
      - `retryCount` integer: The maximum number of retry attempts.
      - `retryWindowInMinutes` integer: The period, in minutes, during which Bulk Actions can retry the operation.
      - `onFailureAction` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete': The type of operation performed by Bulk Actions.
  - `resources` Resources, required: The virtual machines targeted by a bulk action.
    - `ids` string[], required: The Azure resource IDs of the target virtual machines.
  - `reimageParameters` ReimagePayload: The shared and per-virtual-machine configuration for a bulk reimage action.
    - `baseProfile` VirtualMachineReimageParameters: The parameters for reimaging a virtual machine. The operating system disk is always reimaged.
      - `tempDisk` boolean: Indicates whether to reimage the temporary disk. The default value is `false`. This option is supported only for virtual machines or virtual machine scale sets that use an ephemeral operating system disk.
      - `exactVersion` string: The exact image version to use when reimaging the operating system disk. When omitted, the disk is reimaged to its current image version.
      - `osProfile` OSProfileProvisioningData: Additional parameters for reimaging a virtual machine that does not use an ephemeral operating system disk.
        - `adminPassword` string, password: The password for the virtual machine administrator account. The password must be 8 to 123 characters long for Windows virtual machines or 6 to 72 characters long for Linux virtual machines. It must contain characters from at least three of these categories: lowercase letters, uppercase letters, digits, and special characters. The following values are not allowed: `abc@123`, `P@$$w0rd`, `P@ssw0rd`, `P@ssword123`, `Pa$$word`, `pass@word1`, `Password!`, `Password1`, `Password22`, and `iloveyou!`. This secret is accepted only in the request and is not returned in responses.
        - `customData` string: Base64-encoded custom data provided to the virtual machine. The decoded data can contain up to 65,535 bytes. Do not include secrets or passwords.
    - `resourceOverrides` ReimageResourceOverride[]: The reimage configuration overrides for individual virtual machines.
      - `resourceId` string, arm-id, required: The Azure resource ID of the virtual machine to which the override applies.
      - `profile` VirtualMachineReimageParameters, required: The parameters for reimaging a virtual machine. The operating system disk is always reimaged.
        - `tempDisk` boolean: Indicates whether to reimage the temporary disk. The default value is `false`. This option is supported only for virtual machines or virtual machine scale sets that use an ephemeral operating system disk.
        - `exactVersion` string: The exact image version to use when reimaging the operating system disk. When omitted, the disk is reimaged to its current image version.
        - `osProfile` OSProfileProvisioningData: Additional parameters for reimaging a virtual machine that does not use an ephemeral operating system disk.
          - `adminPassword` string, password: The password for the virtual machine administrator account. The password must be 8 to 123 characters long for Windows virtual machines or 6 to 72 characters long for Linux virtual machines. It must contain characters from at least three of these categories: lowercase letters, uppercase letters, digits, and special characters. The following values are not allowed: `abc@123`, `P@$$w0rd`, `P@ssw0rd`, `P@ssword123`, `Pa$$word`, `pass@word1`, `Password!`, `Password1`, `Password22`, and `iloveyou!`. This secret is accepted only in the request and is not returned in responses.
          - `customData` string: Base64-encoded custom data provided to the virtual machine. The decoded data can contain up to 65,535 bytes. Do not include secrets or passwords.

## Response `200`

Azure operation completed successfully.

- ReimageResourceOperationResponse: The result of a bulk reimage action.
  - `description` string, required: A description of the bulk action result.
  - `type` string, required: The type of resources targeted by the bulk action.
  - `location` string, required: Represents an Azure geography region where supported resource providers live.
  - `results` ResourceOperation[]: The result for each virtual machine.
    - `resourceId` string, arm-id: The virtual machine Azure resource ID.
    - `errorCode` string: A code that identifies the error for the virtual machine operation.
    - `errorDetails` string: A message that describes the error for the virtual machine operation.
    - `operation` ResourceOperationDetails: The status and settings for an operation on one virtual machine.
      - `operationId` string, required: The operation ID used to track the action for this virtual machine.
      - `resourceId` string, arm-id: The virtual machine's Azure resource ID.
      - `opType` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete': The type of operation performed on the virtual machine.
      - `subscriptionId` string: The subscription ID associated with the bulk action.
      - `deadline` string, date-time: The requested deadline for the operation.
      - `deadlineType` 'Unknown' | 'InitiateAt' | 'CompleteBy': Specifies whether the deadline time indicates the time at which the operation should start or should be complete.
      - `state` 'Unknown' | 'PendingScheduling' | 'Scheduled' | 'PendingExecution' | 'Executing' | 'Succeeded' | 'Failed' | 'Cancelled' | 'Blocked': The current state of the operation.
      - `timezone` string: The time zone used to interpret the operation deadline.
      - `resourceOperationError` ResourceOperationError: An error that occurred while processing one virtual machine.
        - `errorCode` string, required: A code that identifies the error.
        - `errorDetails` string, required: A message that describes the error.
      - `fallbackOperationInfo` FallbackOperationInfo: Information about the fallback operation attempted after the requested operation did not succeed.
        - `lastOpType` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete', required: The type of operation performed by Bulk Actions.
        - `status` string, required: The status of the additional operation.
        - `error` ResourceOperationError: An error that occurred while processing one virtual machine.
          - `errorCode` string, required: A code that identifies the error.
          - `errorDetails` string, required: A message that describes the error.
      - `completedAt` string, date-time: The date and time when the operation completed.
      - `retryPolicy` RetryPolicy: The retry settings for a bulk action.
        - `retryCount` integer: The maximum number of retry attempts.
        - `retryWindowInMinutes` integer: The period, in minutes, during which Bulk Actions can retry the operation.
        - `onFailureAction` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete': The type of operation performed by Bulk Actions.

## Other responses

- `default`: An unexpected error response.

## Changes

- **2026-09-09** (2026-04-06-preview) `ec20e1928d2a`: 1 info
  - endpoint added
- **2026-07-13** (2026-04-06-preview) `a9a046e3af4e`: 1 breaking
  - api path removed without deprecation
- **2026-05-29** (2026-04-06-preview) `0af182ed1338`: 1 info
  - endpoint added
- **2026-04-16** (2026-04-06-preview) `1d3b494600fa`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/azure/apis/compute-microsoft-compute-bulkactions/changes/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Compute/locations/:location/virtualMachinesBulkReimage/post.md)

---

[API](https://skmtc.dev/azure/apis/compute-microsoft-compute-bulkactions.md) - [All operations](https://skmtc.dev/azure/apis/compute-microsoft-compute-bulkactions/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/compute-microsoft-compute-bulkactions/revisions/057e794e9c55?raw)
