Se ha cambiado el nombre de la conexión de red local como conexión de red de Azure. Los objetos cloudPcOnPremisesConnection son equivalentes a la conexión de red de Azure para el producto cloud pc.
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
En la tabla siguiente se enumeran las propiedades necesarias al crear el objeto cloudPcOnPremisesConnection .
Propiedad
Tipo
Descripción
adDomainName
Cadena
Nombre de dominio completo (FQDN) del dominio de Active Directory al que desea unirse.
adDomainPassword
Cadena
Contraseña asociada a adDomainUsername.
adDomainUsername
Cadena
Nombre de usuario de una cuenta de Active Directory (cuenta de usuario o servicio) que tiene permisos para crear objetos de equipo en Active Directory. Formato necesario: username@contoso.com.
connectionType
cloudPcOnPremisesConnectionType
Especifica cómo se unirá el equipo en la nube aprovisionado a Microsoft Entra ID. El valor predeterminado es hybridAzureADJoin. Los valores posibles son: azureADJoin, hybridAzureADJoin y unknownFutureValue.
displayName
Cadena
Nombre para mostrar de la conexión de red de Azure.
resourceGroupId
Cadena
Identificador del grupo de recursos de destino. Formato necesario: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}".
subnetId
Cadena
Identificador de la subred de destino. Formato necesario: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkId}/subnets/{subnetName}".
subscriptionId
Cadena
Identificador de la suscripción de Azure de destino asociada al inquilino.
virtualNetworkId
Cadena
Identificador de la red virtual de destino. Formato necesario: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}".
Respuesta
Si se ejecuta correctamente, este método devuelve un 200 OK código de respuesta y un objeto cloudPcOnPremisesConnection actualizado en el cuerpo de la respuesta.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/onPremisesConnections/{id}
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPcOnPremisesConnection",
"displayName": "Display Name value",
"subscriptionId": "0ac520ee-14c0-480f-b6c9-0a90c585ffff",
"subscriptionName": "Subscription Name value",
"adDomainName": "Active Directory Domain Name value",
"adDomainUsername": "Active Directory Domain User Name value",
"organizationalUnit": "Organization Unit value",
"resourceGroupId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG",
"virtualNetworkId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet",
"subnetId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new CloudPcOnPremisesConnection
{
OdataType = "#microsoft.graph.cloudPcOnPremisesConnection",
DisplayName = "Display Name value",
SubscriptionId = "0ac520ee-14c0-480f-b6c9-0a90c585ffff",
SubscriptionName = "Subscription Name value",
AdDomainName = "Active Directory Domain Name value",
AdDomainUsername = "Active Directory Domain User Name value",
OrganizationalUnit = "Organization Unit value",
ResourceGroupId = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG",
VirtualNetworkId = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet",
SubnetId = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default",
};
// 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.OnPremisesConnections["{cloudPcOnPremisesConnection-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCloudPcOnPremisesConnection()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
subscriptionId := "0ac520ee-14c0-480f-b6c9-0a90c585ffff"
requestBody.SetSubscriptionId(&subscriptionId)
subscriptionName := "Subscription Name value"
requestBody.SetSubscriptionName(&subscriptionName)
adDomainName := "Active Directory Domain Name value"
requestBody.SetAdDomainName(&adDomainName)
adDomainUsername := "Active Directory Domain User Name value"
requestBody.SetAdDomainUsername(&adDomainUsername)
organizationalUnit := "Organization Unit value"
requestBody.SetOrganizationalUnit(&organizationalUnit)
resourceGroupId := "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG"
requestBody.SetResourceGroupId(&resourceGroupId)
virtualNetworkId := "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet"
requestBody.SetVirtualNetworkId(&virtualNetworkId)
subnetId := "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default"
requestBody.SetSubnetId(&subnetId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
onPremisesConnections, err := graphClient.DeviceManagement().VirtualEndpoint().OnPremisesConnections().ByCloudPcOnPremisesConnectionId("cloudPcOnPremisesConnection-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPcOnPremisesConnection cloudPcOnPremisesConnection = new CloudPcOnPremisesConnection();
cloudPcOnPremisesConnection.setOdataType("#microsoft.graph.cloudPcOnPremisesConnection");
cloudPcOnPremisesConnection.setDisplayName("Display Name value");
cloudPcOnPremisesConnection.setSubscriptionId("0ac520ee-14c0-480f-b6c9-0a90c585ffff");
cloudPcOnPremisesConnection.setSubscriptionName("Subscription Name value");
cloudPcOnPremisesConnection.setAdDomainName("Active Directory Domain Name value");
cloudPcOnPremisesConnection.setAdDomainUsername("Active Directory Domain User Name value");
cloudPcOnPremisesConnection.setOrganizationalUnit("Organization Unit value");
cloudPcOnPremisesConnection.setResourceGroupId("/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG");
cloudPcOnPremisesConnection.setVirtualNetworkId("/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet");
cloudPcOnPremisesConnection.setSubnetId("/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default");
CloudPcOnPremisesConnection result = graphClient.deviceManagement().virtualEndpoint().onPremisesConnections().byCloudPcOnPremisesConnectionId("{cloudPcOnPremisesConnection-id}").patch(cloudPcOnPremisesConnection);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\CloudPcOnPremisesConnection;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcOnPremisesConnection();
$requestBody->setOdataType('#microsoft.graph.cloudPcOnPremisesConnection');
$requestBody->setDisplayName('Display Name value');
$requestBody->setSubscriptionId('0ac520ee-14c0-480f-b6c9-0a90c585ffff');
$requestBody->setSubscriptionName('Subscription Name value');
$requestBody->setAdDomainName('Active Directory Domain Name value');
$requestBody->setAdDomainUsername('Active Directory Domain User Name value');
$requestBody->setOrganizationalUnit('Organization Unit value');
$requestBody->setResourceGroupId('/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG');
$requestBody->setVirtualNetworkId('/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet');
$requestBody->setSubnetId('/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default');
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->onPremisesConnections()->byCloudPcOnPremisesConnectionId('cloudPcOnPremisesConnection-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.cloud_pc_on_premises_connection import CloudPcOnPremisesConnection
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CloudPcOnPremisesConnection(
odata_type = "#microsoft.graph.cloudPcOnPremisesConnection",
display_name = "Display Name value",
subscription_id = "0ac520ee-14c0-480f-b6c9-0a90c585ffff",
subscription_name = "Subscription Name value",
ad_domain_name = "Active Directory Domain Name value",
ad_domain_username = "Active Directory Domain User Name value",
organizational_unit = "Organization Unit value",
resource_group_id = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG",
virtual_network_id = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet",
subnet_id = "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default",
)
result = await graph_client.device_management.virtual_endpoint.on_premises_connections.by_cloud_pc_on_premises_connection_id('cloudPcOnPremisesConnection-id').patch(request_body)