| title | cloudPCSnapshot: importSnapshot |
|---|---|
| description | Import the snapshot from the customer-managed storage account using the provided information, and store it in the Azure storage account within the Cloud PC service on behalf of the customer. |
| author | hyc3z |
| ms.localizationpriority | medium |
| ms.subservice | cloud-pc |
| doc_type | apiPageType |
| ms.date | 10/10/2025 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Import the snapshot from the customer-managed storage account using the provided information, and store it in the Azure storage account within the Cloud PC service on behalf of the customer.
To provision a new Cloud PC for a licensed user, import a valid .vhd snapshot from a customer-managed storage account into the Azure storage account used by the Cloud PC service.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
POST /deviceManagement/virtualEndpoint/snapshots/importSnapshot| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that can be used with this method.
| Parameter | Type | Description |
|---|---|---|
| assignedUserId | String | The unique identifier of the user assigned to the snapshot, who uses the imported snapshot to provision a new Cloud PC. |
| sourceFiles | cloudPcSnapshotImportActionDetail collection | Detailed source information for the files to be imported. |
If successful, this method returns a 200 OK response code and a cloudPcSnapshotImportActionResult object in the response body.
The following example shows a request.
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/snapshots/importSnapshot
Content-Type: application/json
{
"sourceFiles": [
{
"sourceType": "azureStorageAccount",
"fileType": "dataFile",
"storageBlobInfo": {
"storageAccountId": "/subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/account-name",
"containerName": "myContainer",
"blobName": "snapshotForCloudPc.vhd"
}
},
{
"sourceType": "azureStorageAccount",
"fileType": "virtualMachineGuestState",
"storageBlobInfo": {
"storageAccountId": "/subscriptions/subscription-idresourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/account-name",
"containerName": "myContainer",
"blobName": "virtualMachineGuestState.vhd"
}
}
],
"assignedUserId": "93aff428-61f2-467f-a879-1102af6fd4a8"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.cloudPcSnapshotImportActionResult",
"filename": "snapshotForCloudPc",
"usageStatus": "notUsed",
"importStatus": "inProgress",
"assignedUserPrincipalName": "snapshot@contoso.com",
"policyName": "Test_ProvisioningPolicy",
"startDateTime": "2025-01-13T15:13:14Z",
"endDateTime": null,
"additionalDetail": null
}