Create cloudPcProvisioningPolicy

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Create a new cloudPcProvisioningPolicy object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) CloudPC.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application CloudPC.ReadWrite.All Not available.

HTTP request

POST /deviceManagement/virtualEndpoint/provisioningPolicies

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the cloudPcProvisioningPolicy object.

The following table lists the properties that are required when you create the cloudPcProvisioningPolicy.

Property Type Description
description String The provisioning policy description.
displayName String The display name for the provisioning policy.
domainJoinConfigurations cloudPcDomainJoinConfiguration collection Specifies a list ordered by priority on how Cloud PCs join Microsoft Entra ID.
imageDisplayName String The display name for the OS image you’re provisioning.
imageId String The ID of the operating system image you want to provision on Cloud PCs. The format for a gallery type image is: {publisher_offer_sku}. Supported values for each of the parameters are as follows:
  • publisher: Microsoftwindowsdesktop.
  • offer: windows-ent-cpc.
  • sku: 21h1-ent-cpc-m365, 21h1-ent-cpc-os, 20h2-ent-cpc-m365, 20h2-ent-cpc-os, 20h1-ent-cpc-m365, 20h1-ent-cpc-os, 19h2-ent-cpc-m365 and 19h2-ent-cpc-os.
imageType cloudPcProvisioningPolicyImageType The type of OS image (custom or gallery) you want to provision on Cloud PCs. Possible values are: gallery, custom.
provisioningType cloudPcProvisioningType Specifies the type of license used when provisioning Cloud PCs using this policy. By default, the license type is dedicated if the provisioningType isn't specified when you create the cloudPcProvisioningPolicy. You can't change this property after the cloudPcProvisioningPolicy was created. Possible values are: dedicated, shared, unknownFutureValue, sharedByUser, sharedByEntraGroup. You must use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: sharedByUser, sharedByEntraGroup. The shared member is deprecated and will stop returning on April 30, 2027; going forward, use the sharedByUser member.
windowsSetting cloudPcWindowsSettings Indicates a specific Windows setting to configure during the creation of Cloud PCs for this provisioning policy. Supports $select.
domainJoinConfiguration (deprecated) cloudPcDomainJoinConfiguration Specifies how Cloud PCs join Microsoft Entra ID. The domainJoinConfiguration property is deprecated and will stop returning data on May 31, 2024. Going forward, use the domainJoinConfigurations property.
onPremisesConnectionId (deprecated) String The ID of the cloudPcOnPremisesConnection. To ensure that Cloud PCs have network connectivity and that they domain join, choose a connection with a virtual network that the Cloud PC service validated it. The onPremisesConnectionId property is deprecated and will stop returning data on May 31, 2024. Going forward, use the domainJoinConfigurations property.
windowsSettings (deprecated) cloudPcWindowsSettings Specific Windows settings to configure during the creation of Cloud PCs for this provisioning policy. Supports $select. The windowsSettings property is deprecated and will stop returning data on January 31, 2024. Going forward, use the windowsSetting property.

Response

If successful, this method returns a 201 Created response code and a cloudPcProvisioningPolicy object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/provisioningPolicies
Content-Type: application/json

{
    "@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",
    "description": "Description value",
    "displayName": "Display Name value",
    "domainJoinConfiguration": {
        "domainJoinType": "hybridAzureADJoin",
        "onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff"
    },
    "domainJoinConfigurations": [
      {
        "onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",
        "type": "hybridAzureADJoin"
      },
      {
        "onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",
        "type": "hybridAzureADJoin"
      }
    ],
    "id": "1d164206-bf41-4fd2-8424-a3192d39ffff",
    "enableSingleSignOn": true,
    "imageDisplayName": "Windows-10 19h1-evd",
    "imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
    "imageType":"gallery",
    "onPremisesConnectionId": "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
    "windowsSettings": {
        "language": "en-US"
    },
    "windowsSetting": {
        "locale": "en-US"
    },
    "provisioningType": "dedicated"
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",
  "description": "Description value",
  "displayName": "Display Name value",
  "domainJoinConfiguration": {
      "onPremisesConnectionId": "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
      "type": "hybridAzureADJoin"
  },
  "domainJoinConfigurations": [
    {
      "onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",
      "type": "hybridAzureADJoin"
    },
    {
      "onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",
      "type": "hybridAzureADJoin"
    }
  ],
  "microsoftManagedDesktop": {
      "managedType": "notManaged",
      "profile": null
  },
  "autopatch": {
      "autopatchGroupId": null
  },
  "autopilotConfiguration": null,
  "enableSingleSignOn": true,
  "id": "1d164206-bf41-4fd2-8424-a3192d39ffff",
  "imageDisplayName": "Windows-10 19h1-evd",
  "imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
  "imageType":"gallery",
  "onPremisesConnectionId": "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
  "windowsSettings": {
    "language": "en-US"
  },
  "windowsSetting": {
      "locale": "en-US"
  },
  "managedBy": "windows365",
  "provisioningType": "dedicated"
}