Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Erstellen Sie ein neues cloudPcCloudApp-Objekt .
API-Verfügbarkeit
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
CloudPC.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
CloudPC.ReadWrite.All |
Nicht verfügbar. |
HTTP-Anforderung
POST /deviceManagement/virtualEndpoint/cloudApps
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des cloudPcCloudApp-Objekts an.
Die folgende Tabelle zeigt die Eigenschaften, die beim Erstellen einer cloudPcCloudApp verfügbar sind.
| Eigenschaft |
Typ |
Beschreibung |
| appDetail |
cloudPcCloudAppDetail |
Die Details zur Cloud-App. Hierbei handelt es sich um einen polymorphen Typ. Verwenden Sie @odata.type , um den abgeleiteten Typ anzugeben: #microsoft.graph.cloudPcFilePathAppDetail für Apps mit einem manuell angegebenen Dateipfad oder #microsoft.graph.cloudPcAutomaticDiscoveredAppDetail für automatisch erkannte Apps. Erforderlich. |
| description |
Zeichenfolge |
Die Beschreibung, die der Cloud-App zugeordnet ist. Die maximal zulässige Länge für diese Eigenschaft beträgt 512 Zeichen. Optional. |
| discoveredAppName |
Zeichenfolge |
Der Name der ermittelten App, die der Cloud-App zugeordnet ist. Erforderlich. |
| displayName |
Zeichenfolge |
Der Anzeigename für die Cloud-App. Muss innerhalb einer einzelnen Bereitstellungsrichtlinie eindeutig sein. Die maximal zulässige Länge für diese Eigenschaft beträgt 64 Zeichen. Erforderlich. |
| provisioningPolicyId |
Zeichenfolge |
Die ID der Bereitstellungsrichtlinie, die dieser Cloud-App zugeordnet ist. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt diese Methode einen 201 Created Antwortcode und ein cloudPcCloudApp-Objekt im Antworttext zurück.
Beispiele
Anforderung
Im folgenden Beispiel wird gezeigt, wie Sie eine Cloud-App mit dem cloudPcFilePathAppDetail-Typ erstellen.
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudApps
Content-Type: application/json
{
"displayName": "Remote Desktop Connection",
"discoveredAppName": "Remote Desktop Connection",
"provisioningPolicyId": "e31f75e9-25a8-41e9-a9d5-ce8fd484af15",
"description": "",
"appDetail": {
"@odata.type": "#microsoft.graph.cloudPcFilePathAppDetail",
"filePath": "C:\\Windows\\system32\\mstsc.exe",
"commandLineArguments": "",
"iconPath": "C:\\Windows\\system32\\mstsc.exe",
"iconIndex": 0
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CloudPcCloudApp
{
DisplayName = "Remote Desktop Connection",
DiscoveredAppName = "Remote Desktop Connection",
ProvisioningPolicyId = "e31f75e9-25a8-41e9-a9d5-ce8fd484af15",
Description = "",
AppDetail = new CloudPcFilePathAppDetail
{
OdataType = "#microsoft.graph.cloudPcFilePathAppDetail",
FilePath = "C:\Windows\system32\mstsc.exe",
CommandLineArguments = "",
IconPath = "C:\Windows\system32\mstsc.exe",
IconIndex = 0,
},
};
// 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.CloudApps.PostAsync(requestBody);
// 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.NewCloudPcCloudApp()
displayName := "Remote Desktop Connection"
requestBody.SetDisplayName(&displayName)
discoveredAppName := "Remote Desktop Connection"
requestBody.SetDiscoveredAppName(&discoveredAppName)
provisioningPolicyId := "e31f75e9-25a8-41e9-a9d5-ce8fd484af15"
requestBody.SetProvisioningPolicyId(&provisioningPolicyId)
description := ""
requestBody.SetDescription(&description)
appDetail := graphmodels.NewCloudPcFilePathAppDetail()
filePath := "C:\Windows\system32\mstsc.exe"
appDetail.SetFilePath(&filePath)
commandLineArguments := ""
appDetail.SetCommandLineArguments(&commandLineArguments)
iconPath := "C:\Windows\system32\mstsc.exe"
appDetail.SetIconPath(&iconPath)
iconIndex := int32(0)
appDetail.SetIconIndex(&iconIndex)
requestBody.SetAppDetail(appDetail)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudApps, err := graphClient.DeviceManagement().VirtualEndpoint().CloudApps().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPcCloudApp cloudPcCloudApp = new CloudPcCloudApp();
cloudPcCloudApp.setDisplayName("Remote Desktop Connection");
cloudPcCloudApp.setDiscoveredAppName("Remote Desktop Connection");
cloudPcCloudApp.setProvisioningPolicyId("e31f75e9-25a8-41e9-a9d5-ce8fd484af15");
cloudPcCloudApp.setDescription("");
CloudPcFilePathAppDetail appDetail = new CloudPcFilePathAppDetail();
appDetail.setOdataType("#microsoft.graph.cloudPcFilePathAppDetail");
appDetail.setFilePath("C:\Windows\system32\mstsc.exe");
appDetail.setCommandLineArguments("");
appDetail.setIconPath("C:\Windows\system32\mstsc.exe");
appDetail.setIconIndex(0);
cloudPcCloudApp.setAppDetail(appDetail);
CloudPcCloudApp result = graphClient.deviceManagement().virtualEndpoint().cloudApps().post(cloudPcCloudApp);
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcCloudApp = {
displayName: 'Remote Desktop Connection',
discoveredAppName: 'Remote Desktop Connection',
provisioningPolicyId: 'e31f75e9-25a8-41e9-a9d5-ce8fd484af15',
description: '',
appDetail: {
'@odata.type': '#microsoft.graph.cloudPcFilePathAppDetail',
filePath: 'C:\\Windows\\system32\\mstsc.exe',
commandLineArguments: '',
iconPath: 'C:\\Windows\\system32\\mstsc.exe',
iconIndex: 0
}
};
await client.api('/deviceManagement/virtualEndpoint/cloudApps')
.version('beta')
.post(cloudPcCloudApp);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CloudPcCloudApp;
use Microsoft\Graph\Beta\Generated\Models\CloudPcFilePathAppDetail;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcCloudApp();
$requestBody->setDisplayName('Remote Desktop Connection');
$requestBody->setDiscoveredAppName('Remote Desktop Connection');
$requestBody->setProvisioningPolicyId('e31f75e9-25a8-41e9-a9d5-ce8fd484af15');
$requestBody->setDescription('');
$appDetail = new CloudPcFilePathAppDetail();
$appDetail->setOdataType('#microsoft.graph.cloudPcFilePathAppDetail');
$appDetail->setFilePath('C:\Windows\system32\mstsc.exe');
$appDetail->setCommandLineArguments('');
$appDetail->setIconPath('C:\Windows\system32\mstsc.exe');
$appDetail->setIconIndex(0);
$requestBody->setAppDetail($appDetail);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->cloudApps()->post($requestBody)->wait();
# 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_cloud_app import CloudPcCloudApp
from msgraph_beta.generated.models.cloud_pc_file_path_app_detail import CloudPcFilePathAppDetail
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CloudPcCloudApp(
display_name = "Remote Desktop Connection",
discovered_app_name = "Remote Desktop Connection",
provisioning_policy_id = "e31f75e9-25a8-41e9-a9d5-ce8fd484af15",
description = "",
app_detail = CloudPcFilePathAppDetail(
odata_type = "#microsoft.graph.cloudPcFilePathAppDetail",
file_path = "C:\Windows\system32\mstsc.exe",
command_line_arguments = "",
icon_path = "C:\Windows\system32\mstsc.exe",
icon_index = 0,
),
)
result = await graph_client.device_management.virtual_endpoint.cloud_apps.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/virtualEndpoint/cloudApps/$entity",
"id": "60a7bbf2-d831-4dc8-8375-1253403f7e74",
"displayName": "Remote Desktop Connection",
"discoveredAppName": "Remote Desktop Connection",
"provisioningPolicyId": "e31f75e9-25a8-41e9-a9d5-ce8fd484af15",
"description": "",
"appDetail": {
"@odata.type": "#microsoft.graph.cloudPcFilePathAppDetail",
"filePath": "C:\\Windows\\system32\\mstsc.exe",
"commandLineArguments": "",
"iconPath": "C:\\Windows\\system32\\mstsc.exe",
"iconIndex": 0
},
"addedDateTime": "2025-11-13T07:37:22.3049326Z",
"lastPublishedDateTime": "0001-01-01T00:00:00Z",
"appStatus": "preparing",
"actionFailedErrorCode": null,
"actionFailedErrorMessage": null,
"availableToUser": false,
"scopeIds": [
"0"
]
}