DELETE https://management.azure.com/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b?api-version=2024-04-03
/**
* Samples for PrivateEndpointConnections DeleteByHostPool.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/
* PrivateEndpointConnection_DeleteByHostPool.json
*/
/**
* Sample code: PrivateEndpointConnection_DeleteByHostPool.
*
* @param manager Entry point to DesktopVirtualizationManager.
*/
public static void privateEndpointConnectionDeleteByHostPool(
com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) {
manager.privateEndpointConnections().deleteByHostPoolWithResponse("resourceGroup1", "hostPool1",
"hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-desktopvirtualization
# USAGE
python private_endpoint_connection_delete_by_host_pool.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DesktopVirtualizationMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
)
client.private_endpoint_connections.delete_by_host_pool(
resource_group_name="resourceGroup1",
host_pool_name="hostPool1",
private_endpoint_connection_name="hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b",
)
# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdesktopvirtualization_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json
func ExamplePrivateEndpointConnectionsClient_DeleteByHostPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdesktopvirtualization.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewPrivateEndpointConnectionsClient().DeleteByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DesktopVirtualizationAPIClient } = require("@azure/arm-desktopvirtualization");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Remove a connection.
*
* @summary Remove a connection.
* x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json
*/
async function privateEndpointConnectionDeleteByHostPool() {
const subscriptionId =
process.env["DESKTOPVIRTUALIZATION_SUBSCRIPTION_ID"] || "daefabc0-95b4-48b3-b645-8a753a63c4fa";
const resourceGroupName = process.env["DESKTOPVIRTUALIZATION_RESOURCE_GROUP"] || "resourceGroup1";
const hostPoolName = "hostPool1";
const privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b";
const credential = new DefaultAzureCredential();
const client = new DesktopVirtualizationAPIClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.deleteByHostPool(
resourceGroupName,
hostPoolName,
privateEndpointConnectionName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.DesktopVirtualization.Models;
using Azure.ResourceManager.DesktopVirtualization;
// Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json
// this example is just showing the usage of "PrivateEndpointConnections_DeleteByHostPool" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this HostPoolPrivateEndpointConnectionResource created on azure
// for more information of creating HostPoolPrivateEndpointConnectionResource, please refer to the document of HostPoolPrivateEndpointConnectionResource
string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa";
string resourceGroupName = "resourceGroup1";
string hostPoolName = "hostPool1";
string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b";
ResourceIdentifier hostPoolPrivateEndpointConnectionResourceId = HostPoolPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName);
HostPoolPrivateEndpointConnectionResource hostPoolPrivateEndpointConnection = client.GetHostPoolPrivateEndpointConnectionResource(hostPoolPrivateEndpointConnectionResourceId);
// invoke the operation
await hostPoolPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed);
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue