POST https://management.azure.com/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa/remove?api-version=2025-01-01
/**
* Samples for ReplicationRecoveryServicesProviders Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-01-01/examples
* /ReplicationRecoveryServicesProviders_Delete.json
*/
/**
* Sample code: Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is
* unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the
* object is empty we assume that it is old client and continue the old behavior).
*
* @param manager Entry point to SiteRecoveryManager.
*/
public static void
deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior(
com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) {
manager.replicationRecoveryServicesProviders().delete("resourceGroupPS1", "vault1", "cloud1",
"241641e6-ee7b-4ee4-8141-821fadda43fa", 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.recoveryservicessiterecovery import SiteRecoveryManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservicessiterecovery
# USAGE
python replication_recovery_services_providers_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 = SiteRecoveryManagementClient(
credential=DefaultAzureCredential(),
subscription_id="c183865e-6077-46f2-a3b1-deb0f4f4650a",
resource_group_name="resourceGroupPS1",
resource_name="vault1",
)
client.replication_recovery_services_providers.begin_delete(
fabric_name="cloud1",
provider_name="241641e6-ee7b-4ee4-8141-821fadda43fa",
).result()
# x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-01-01/examples/ReplicationRecoveryServicesProviders_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 armrecoveryservicessiterecovery_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fc983fb08e5fd8a7a821eb6491f5338ce52a9cf/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-01-01/examples/ReplicationRecoveryServicesProviders_Delete.json
func ExampleReplicationRecoveryServicesProvidersClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().BeginDelete(ctx, "resourceGroupPS1", "vault1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", 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 { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to The operation to removes/delete(unregister) a recovery services provider from the vault.
*
* @summary The operation to removes/delete(unregister) a recovery services provider from the vault.
* x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-01-01/examples/ReplicationRecoveryServicesProviders_Delete.json
*/
async function deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior() {
const subscriptionId =
process.env["RECOVERYSERVICESSITERECOVERY_SUBSCRIPTION_ID"] ||
"c183865e-6077-46f2-a3b1-deb0f4f4650a";
const resourceGroupName =
process.env["RECOVERYSERVICESSITERECOVERY_RESOURCE_GROUP"] || "resourceGroupPS1";
const resourceName = "vault1";
const fabricName = "cloud1";
const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa";
const credential = new DefaultAzureCredential();
const client = new SiteRecoveryManagementClient(credential, subscriptionId);
const result = await client.replicationRecoveryServicesProviders.beginDeleteAndWait(
resourceGroupName,
resourceName,
fabricName,
providerName,
);
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.RecoveryServicesSiteRecovery.Models;
using Azure.ResourceManager.RecoveryServicesSiteRecovery;
// Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-01-01/examples/ReplicationRecoveryServicesProviders_Delete.json
// this example is just showing the usage of "ReplicationRecoveryServicesProviders_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 SiteRecoveryServicesProviderResource created on azure
// for more information of creating SiteRecoveryServicesProviderResource, please refer to the document of SiteRecoveryServicesProviderResource
string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a";
string resourceGroupName = "resourceGroupPS1";
string resourceName = "vault1";
string fabricName = "cloud1";
string providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa";
ResourceIdentifier siteRecoveryServicesProviderResourceId = SiteRecoveryServicesProviderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, providerName);
SiteRecoveryServicesProviderResource siteRecoveryServicesProvider = client.GetSiteRecoveryServicesProviderResource(siteRecoveryServicesProviderResourceId);
// invoke the operation
await siteRecoveryServicesProvider.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