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.
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
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.
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.
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.
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.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new CloudPcProvisioningPolicy
{
OdataType = "#microsoft.graph.cloudPcProvisioningPolicy",
Description = "Description value",
DisplayName = "Display Name value",
DomainJoinConfigurations = new List<CloudPcDomainJoinConfiguration>
{
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff",
Type = CloudPcDomainJoinType.HybridAzureADJoin,
},
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "26e16c71-f210-438b-88ac-d481ccafffff",
Type = CloudPcDomainJoinType.HybridAzureADJoin,
},
},
Id = "1d164206-bf41-4fd2-8424-a3192d39ffff",
EnableSingleSignOn = true,
ImageDisplayName = "Windows-10 19h1-evd",
ImageId = "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
ImageType = CloudPcProvisioningPolicyImageType.Gallery,
WindowsSettings = new CloudPcWindowsSettings
{
Language = "en-US",
},
WindowsSetting = new CloudPcWindowsSetting
{
Locale = "en-US",
},
ProvisioningType = CloudPcProvisioningType.Dedicated,
AdditionalData = new Dictionary<string, object>
{
{
"domainJoinConfiguration" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"domainJoinType", new UntypedString("hybridAzureADJoin")
},
{
"onPremisesConnectionId", new UntypedString("16ee6c71-fc10-438b-88ac-daa1ccafffff")
},
})
},
{
"onPremisesConnectionId" , "4e47d0f6-6f77-44f0-8893-c0fe1701ffff"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.VirtualEndpoint.ProvisioningPolicies.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCloudPcProvisioningPolicy()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
cloudPcDomainJoinConfiguration := graphmodels.NewCloudPcDomainJoinConfiguration()
onPremisesConnectionId := "16ee6c71-fc10-438b-88ac-daa1ccafffff"
cloudPcDomainJoinConfiguration.SetOnPremisesConnectionId(&onPremisesConnectionId)
type := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration.SetType(&type)
cloudPcDomainJoinConfiguration1 := graphmodels.NewCloudPcDomainJoinConfiguration()
onPremisesConnectionId := "26e16c71-f210-438b-88ac-d481ccafffff"
cloudPcDomainJoinConfiguration1.SetOnPremisesConnectionId(&onPremisesConnectionId)
type := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration1.SetType(&type)
domainJoinConfigurations := []graphmodels.CloudPcDomainJoinConfigurationable {
cloudPcDomainJoinConfiguration,
cloudPcDomainJoinConfiguration1,
}
requestBody.SetDomainJoinConfigurations(domainJoinConfigurations)
id := "1d164206-bf41-4fd2-8424-a3192d39ffff"
requestBody.SetId(&id)
enableSingleSignOn := true
requestBody.SetEnableSingleSignOn(&enableSingleSignOn)
imageDisplayName := "Windows-10 19h1-evd"
requestBody.SetImageDisplayName(&imageDisplayName)
imageId := "MicrosoftWindowsDesktop_Windows-10_19h1-evd"
requestBody.SetImageId(&imageId)
imageType := graphmodels.GALLERY_CLOUDPCPROVISIONINGPOLICYIMAGETYPE
requestBody.SetImageType(&imageType)
windowsSettings := graphmodels.NewCloudPcWindowsSettings()
language := "en-US"
windowsSettings.SetLanguage(&language)
requestBody.SetWindowsSettings(windowsSettings)
windowsSetting := graphmodels.NewCloudPcWindowsSetting()
locale := "en-US"
windowsSetting.SetLocale(&locale)
requestBody.SetWindowsSetting(windowsSetting)
provisioningType := graphmodels.DEDICATED_CLOUDPCPROVISIONINGTYPE
requestBody.SetProvisioningType(&provisioningType)
additionalData := map[string]interface{}{
domainJoinConfiguration := graph.New()
domainJoinType := "hybridAzureADJoin"
domainJoinConfiguration.SetDomainJoinType(&domainJoinType)
onPremisesConnectionId := "16ee6c71-fc10-438b-88ac-daa1ccafffff"
domainJoinConfiguration.SetOnPremisesConnectionId(&onPremisesConnectionId)
requestBody.SetDomainJoinConfiguration(domainJoinConfiguration)
"onPremisesConnectionId" : "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
provisioningPolicies, err := graphClient.DeviceManagement().VirtualEndpoint().ProvisioningPolicies().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPcProvisioningPolicy cloudPcProvisioningPolicy = new CloudPcProvisioningPolicy();
cloudPcProvisioningPolicy.setOdataType("#microsoft.graph.cloudPcProvisioningPolicy");
cloudPcProvisioningPolicy.setDescription("Description value");
cloudPcProvisioningPolicy.setDisplayName("Display Name value");
LinkedList<CloudPcDomainJoinConfiguration> domainJoinConfigurations = new LinkedList<CloudPcDomainJoinConfiguration>();
CloudPcDomainJoinConfiguration cloudPcDomainJoinConfiguration = new CloudPcDomainJoinConfiguration();
cloudPcDomainJoinConfiguration.setOnPremisesConnectionId("16ee6c71-fc10-438b-88ac-daa1ccafffff");
cloudPcDomainJoinConfiguration.setType(CloudPcDomainJoinType.HybridAzureADJoin);
domainJoinConfigurations.add(cloudPcDomainJoinConfiguration);
CloudPcDomainJoinConfiguration cloudPcDomainJoinConfiguration1 = new CloudPcDomainJoinConfiguration();
cloudPcDomainJoinConfiguration1.setOnPremisesConnectionId("26e16c71-f210-438b-88ac-d481ccafffff");
cloudPcDomainJoinConfiguration1.setType(CloudPcDomainJoinType.HybridAzureADJoin);
domainJoinConfigurations.add(cloudPcDomainJoinConfiguration1);
cloudPcProvisioningPolicy.setDomainJoinConfigurations(domainJoinConfigurations);
cloudPcProvisioningPolicy.setId("1d164206-bf41-4fd2-8424-a3192d39ffff");
cloudPcProvisioningPolicy.setEnableSingleSignOn(true);
cloudPcProvisioningPolicy.setImageDisplayName("Windows-10 19h1-evd");
cloudPcProvisioningPolicy.setImageId("MicrosoftWindowsDesktop_Windows-10_19h1-evd");
cloudPcProvisioningPolicy.setImageType(CloudPcProvisioningPolicyImageType.Gallery);
CloudPcWindowsSettings windowsSettings = new CloudPcWindowsSettings();
windowsSettings.setLanguage("en-US");
cloudPcProvisioningPolicy.setWindowsSettings(windowsSettings);
CloudPcWindowsSetting windowsSetting = new CloudPcWindowsSetting();
windowsSetting.setLocale("en-US");
cloudPcProvisioningPolicy.setWindowsSetting(windowsSetting);
cloudPcProvisioningPolicy.setProvisioningType(CloudPcProvisioningType.Dedicated);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
domainJoinConfiguration = new ();
domainJoinConfiguration.setDomainJoinType("hybridAzureADJoin");
domainJoinConfiguration.setOnPremisesConnectionId("16ee6c71-fc10-438b-88ac-daa1ccafffff");
additionalData.put("domainJoinConfiguration", domainJoinConfiguration);
additionalData.put("onPremisesConnectionId", "4e47d0f6-6f77-44f0-8893-c0fe1701ffff");
cloudPcProvisioningPolicy.setAdditionalData(additionalData);
CloudPcProvisioningPolicy result = graphClient.deviceManagement().virtualEndpoint().provisioningPolicies().post(cloudPcProvisioningPolicy);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningPolicy;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDomainJoinConfiguration;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDomainJoinType;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningPolicyImageType;
use Microsoft\Graph\Beta\Generated\Models\CloudPcWindowsSettings;
use Microsoft\Graph\Beta\Generated\Models\CloudPcWindowsSetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcProvisioningPolicy();
$requestBody->setOdataType('#microsoft.graph.cloudPcProvisioningPolicy');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1 = new CloudPcDomainJoinConfiguration();
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1->setOnPremisesConnectionId('16ee6c71-fc10-438b-88ac-daa1ccafffff');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1->setType(new CloudPcDomainJoinType('hybridAzureADJoin'));
$domainJoinConfigurationsArray []= $domainJoinConfigurationsCloudPcDomainJoinConfiguration1;
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2 = new CloudPcDomainJoinConfiguration();
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setOnPremisesConnectionId('26e16c71-f210-438b-88ac-d481ccafffff');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setType(new CloudPcDomainJoinType('hybridAzureADJoin'));
$domainJoinConfigurationsArray []= $domainJoinConfigurationsCloudPcDomainJoinConfiguration2;
$requestBody->setDomainJoinConfigurations($domainJoinConfigurationsArray);
$requestBody->setId('1d164206-bf41-4fd2-8424-a3192d39ffff');
$requestBody->setEnableSingleSignOn(true);
$requestBody->setImageDisplayName('Windows-10 19h1-evd');
$requestBody->setImageId('MicrosoftWindowsDesktop_Windows-10_19h1-evd');
$requestBody->setImageType(new CloudPcProvisioningPolicyImageType('gallery'));
$windowsSettings = new CloudPcWindowsSettings();
$windowsSettings->setLanguage('en-US');
$requestBody->setWindowsSettings($windowsSettings);
$windowsSetting = new CloudPcWindowsSetting();
$windowsSetting->setLocale('en-US');
$requestBody->setWindowsSetting($windowsSetting);
$requestBody->setProvisioningType(new CloudPcProvisioningType('dedicated'));
$additionalData = [
'domainJoinConfiguration' => [
'domainJoinType' => 'hybridAzureADJoin',
'onPremisesConnectionId' => '16ee6c71-fc10-438b-88ac-daa1ccafffff',
],
'onPremisesConnectionId' => '4e47d0f6-6f77-44f0-8893-c0fe1701ffff',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->provisioningPolicies()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.cloud_pc_provisioning_policy import CloudPcProvisioningPolicy
from msgraph_beta.generated.models.cloud_pc_domain_join_configuration import CloudPcDomainJoinConfiguration
from msgraph_beta.generated.models.cloud_pc_domain_join_type import CloudPcDomainJoinType
from msgraph_beta.generated.models.cloud_pc_provisioning_policy_image_type import CloudPcProvisioningPolicyImageType
from msgraph_beta.generated.models.cloud_pc_windows_settings import CloudPcWindowsSettings
from msgraph_beta.generated.models.cloud_pc_windows_setting import CloudPcWindowsSetting
from msgraph_beta.generated.models.cloud_pc_provisioning_type import CloudPcProvisioningType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CloudPcProvisioningPolicy(
odata_type = "#microsoft.graph.cloudPcProvisioningPolicy",
description = "Description value",
display_name = "Display Name value",
domain_join_configurations = [
CloudPcDomainJoinConfiguration(
on_premises_connection_id = "16ee6c71-fc10-438b-88ac-daa1ccafffff",
type = CloudPcDomainJoinType.HybridAzureADJoin,
),
CloudPcDomainJoinConfiguration(
on_premises_connection_id = "26e16c71-f210-438b-88ac-d481ccafffff",
type = CloudPcDomainJoinType.HybridAzureADJoin,
),
],
id = "1d164206-bf41-4fd2-8424-a3192d39ffff",
enable_single_sign_on = True,
image_display_name = "Windows-10 19h1-evd",
image_id = "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
image_type = CloudPcProvisioningPolicyImageType.Gallery,
windows_settings = CloudPcWindowsSettings(
language = "en-US",
),
windows_setting = CloudPcWindowsSetting(
locale = "en-US",
),
provisioning_type = CloudPcProvisioningType.Dedicated,
additional_data = {
"domain_join_configuration" : {
"domain_join_type" : "hybridAzureADJoin",
"on_premises_connection_id" : "16ee6c71-fc10-438b-88ac-daa1ccafffff",
},
"on_premises_connection_id" : "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
}
)
result = await graph_client.device_management.virtual_endpoint.provisioning_policies.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.