POST https://management.azure.com/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/providers/Microsoft.AppConfiguration/locations/westus/deletedConfigurationStores/contoso/purge?api-version=2023-03-01
/** Samples for ConfigurationStores PurgeDeleted. */
public final class Main {
/*
* x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json
*/
/**
* Sample code: Purge a deleted configuration store.
*
* @param manager Entry point to AppConfigurationManager.
*/
public static void purgeADeletedConfigurationStore(
com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) {
manager.configurationStores().purgeDeleted("westus", "contoso", 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.appconfiguration import AppConfigurationManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appconfiguration
# USAGE
python deleted_configuration_stores_purge.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 = AppConfigurationManagementClient(
credential=DefaultAzureCredential(),
subscription_id="c80fb759-c965-4c6a-9110-9b2b2d038882",
)
response = client.configuration_stores.begin_purge_deleted(
location="westus",
config_store_name="contoso",
).result()
print(response)
# x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.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 armappconfiguration_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json
func ExampleConfigurationStoresClient_BeginPurgeDeleted() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappconfiguration.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewConfigurationStoresClient().BeginPurgeDeleted(ctx, "westus", "contoso", 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 { AppConfigurationManagementClient } = require("@azure/arm-appconfiguration");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Permanently deletes the specified configuration store.
*
* @summary Permanently deletes the specified configuration store.
* x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json
*/
async function purgeADeletedConfigurationStore() {
const subscriptionId =
process.env["APPCONFIGURATION_SUBSCRIPTION_ID"] || "c80fb759-c965-4c6a-9110-9b2b2d038882";
const location = "westus";
const configStoreName = "contoso";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationManagementClient(credential, subscriptionId);
const result = await client.configurationStores.beginPurgeDeletedAndWait(
location,
configStoreName
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.AppConfiguration;
// Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json
// this example is just showing the usage of "ConfigurationStores_PurgeDeleted" 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 DeletedAppConfigurationStoreResource created on azure
// for more information of creating DeletedAppConfigurationStoreResource, please refer to the document of DeletedAppConfigurationStoreResource
string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882";
AzureLocation location = new AzureLocation("westus");
string configStoreName = "contoso";
ResourceIdentifier deletedAppConfigurationStoreResourceId = DeletedAppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, location, configStoreName);
DeletedAppConfigurationStoreResource deletedAppConfigurationStore = client.GetDeletedAppConfigurationStoreResource(deletedAppConfigurationStoreResourceId);
// invoke the operation
await deletedAppConfigurationStore.PurgeDeletedAsync(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