DELETE https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name?api-version=2024-11-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.kubernetesconfiguration.privatelinkscopes import KubernetesConfigurationPrivateLinkScopesMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-kubernetesconfiguration-privatelinkscopes
# USAGE
python private_endpoint_connection_delete.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 = KubernetesConfigurationPrivateLinkScopesMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-1111-2222-3333-444444444444",
)
client.private_endpoint_connections.delete(
resource_group_name="myResourceGroup",
scope_name="myPrivateLinkScope",
private_endpoint_connection_name="private-endpoint-connection-name",
)
# x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.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 armprivatelinkscopes_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armprivatelinkscopes"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4a2bb0762eaad11e725516708483598e0c12cabb/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.json
func ExamplePrivateEndpointConnectionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armprivatelinkscopes.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", 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 { PrivateLinkScopesClient } = require("@azure/arm-kubernetesconfiguration-privatelinkscopes");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Deletes a private endpoint connection with a given name.
*
* @summary Deletes a private endpoint connection with a given name.
* x-ms-original-file: specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.json
*/
async function deletesAPrivateEndpointConnectionWithAGivenName() {
const subscriptionId =
process.env["KUBERNETESCONFIGURATION_SUBSCRIPTION_ID"] ||
"00000000-1111-2222-3333-444444444444";
const resourceGroupName =
process.env["KUBERNETESCONFIGURATION_RESOURCE_GROUP"] || "myResourceGroup";
const scopeName = "myPrivateLinkScope";
const privateEndpointConnectionName = "private-endpoint-connection-name";
const credential = new DefaultAzureCredential();
const client = new PrivateLinkScopesClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.delete(
resourceGroupName,
scopeName,
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