DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool?api-version=2024-03-01
/**
* Samples for StandbyVirtualMachinePools Delete.
*/
public final class Main {
/*
* x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json
*/
/**
* Sample code: StandbyVirtualMachinePools_Delete.
*
* @param manager Entry point to StandbyPoolManager.
*/
public static void
standbyVirtualMachinePoolsDelete(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) {
manager.standbyVirtualMachinePools().delete("rgstandbypool", "pool", 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.standbypool import StandbyPoolMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-standbypool
# USAGE
python standby_virtual_machine_pools_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 = StandbyPoolMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.standby_virtual_machine_pools.begin_delete(
resource_group_name="rgstandbypool",
standby_virtual_machine_pool_name="pool",
).result()
# x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.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 armstandbypool_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool"
)
// Generated from example definition: 2024-03-01/StandbyVirtualMachinePools_Delete.json
func ExampleStandbyVirtualMachinePoolsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstandbypool.NewClientFactory("00000000-0000-0000-0000-000000000009", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewStandbyVirtualMachinePoolsClient().BeginDelete(ctx, "rgstandbypool", "pool", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 { StandbyPoolManagementClient } = require("@azure/arm-standbypool");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to delete a StandbyVirtualMachinePoolResource
*
* @summary delete a StandbyVirtualMachinePoolResource
* x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json
*/
async function standbyVirtualMachinePoolsDelete() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000009";
const client = new StandbyPoolManagementClient(credential, subscriptionId);
await client.standbyVirtualMachinePools.delete("rgstandbypool", "pool");
}
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.Resources;
using Azure.ResourceManager.StandbyPool.Models;
using Azure.ResourceManager.StandbyPool;
// Generated from example definition: specification/standbypool/resource-manager/Microsoft.StandbyPool/stable/2024-03-01/examples/StandbyVirtualMachinePools_Delete.json
// this example is just showing the usage of "StandbyVirtualMachinePools_Delete" 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 StandbyVirtualMachinePoolResource created on azure
// for more information of creating StandbyVirtualMachinePoolResource, please refer to the document of StandbyVirtualMachinePoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000009";
string resourceGroupName = "rgstandbypool";
string standbyVirtualMachinePoolName = "pool";
ResourceIdentifier standbyVirtualMachinePoolResourceId = StandbyVirtualMachinePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, standbyVirtualMachinePoolName);
StandbyVirtualMachinePoolResource standbyVirtualMachinePool = client.GetStandbyVirtualMachinePoolResource(standbyVirtualMachinePoolResourceId);
// invoke the operation
await standbyVirtualMachinePool.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