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.
The collection of Cloud PC provisioning policy resources each to be assigned to the corresponding target group. Only Microsoft 365 groups and security groups in Azure AD are currently supported.
Response
If successful, this method returns a 204 No Content response code.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.ProvisioningPolicies.Item.Assign.AssignPostRequestBody
{
Assignments = new List<CloudPcProvisioningPolicyAssignment>
{
new CloudPcProvisioningPolicyAssignment
{
Id = "b0c2d35f-3385-46c8-a6f5-6c3dfad7708b_64ff06de-9c00-4a5a-98b5-7f5abe26ffff",
Target = new CloudPcManagementAssignmentTarget
{
OdataType = "microsoft.graph.cloudPcManagementGroupAssignmentTarget",
AdditionalData = new Dictionary<string, object>
{
{
"groupId" , "64ff06de-9c00-4a5a-98b5-7f5abe26ffff"
},
},
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"@odata.type" , "#microsoft.graph.cloudPcProvisioningPolicyAssignment"
},
},
};
await graphClient.DeviceManagement.VirtualEndpoint.ProvisioningPolicies["{cloudPcProvisioningPolicy-id}"].Assign.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.
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
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AssignPostRequestBody();
$assignmentsCloudPcProvisioningPolicyAssignment1 = new CloudPcProvisioningPolicyAssignment();
$assignmentsCloudPcProvisioningPolicyAssignment1->setId('b0c2d35f-3385-46c8-a6f5-6c3dfad7708b_64ff06de-9c00-4a5a-98b5-7f5abe26ffff');
$assignmentsCloudPcProvisioningPolicyAssignment1Target = new CloudPcManagementAssignmentTarget();
$assignmentsCloudPcProvisioningPolicyAssignment1Target->set@odatatype('microsoft.graph.cloudPcManagementGroupAssignmentTarget');
$additionalData = [
'groupId' => '64ff06de-9c00-4a5a-98b5-7f5abe26ffff',
];
$assignmentsCloudPcProvisioningPolicyAssignment1Target->setAdditionalData($additionalData);
$assignmentsCloudPcProvisioningPolicyAssignment1->setTarget($assignmentsCloudPcProvisioningPolicyAssignment1Target);
$assignmentsArray []= $assignmentsCloudPcProvisioningPolicyAssignment1;
$requestBody->setAssignments($assignmentsArray);
$additionalData = [
'@odata.type' => '#microsoft.graph.cloudPcProvisioningPolicyAssignment',
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->deviceManagement()->virtualEndpoint()->provisioningPolicies()->byProvisioningPolicieId('cloudPcProvisioningPolicy-id')->assign()->post($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.