An Azure service that is used to automate, configure, and install updates across hybrid environments.
Hello @Yogesh Rahate
Thank you for posting your query on Microsoft Q&A platform.
You can programmatically cancel subscriptions using the Azure Subscription REST API:
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel?api-version=2021-10-01
This allows you to script the cancellation of multiple subscriptions in bulk using Azure CLI, PowerShell, or any REST client.
Additionally, since these are CSP subscriptions, partners can also cancel Azure subscriptions through the Partner Center API:
POST {baseURL}/v1/customers/{customer_id}/subscriptions/{subscription_id}/azureEntitlements/{entitlement_id}/cancel
This requires the Customer ID, Subscription ID, and Entitlement ID. Partners must have Global Administrator with Admin Agent roles.
Reference: https://learn.microsoft.com/en-us/partner-center/developer/cancel-an-azure-subscription
As you already noted, the "Delete subscription" option in the Azure portal becomes available 7 days after cancellation for field and partner channel subscriptions (including CSP). This is a portal-only action and there is currently no public API to perform this final deletion step programmatically
However, if you don't need to delete them immediately, you can simply automate the cancellation and let Azure automatically delete the subscriptions after 90 days.
Note: You must be assigned the Subscription Owner role to see and use the Delete option in the portal, and all resources within the subscription must be deleted first.
Partners can suspend or cancel a subscription if requested by a customer or in cases of nonpayment or fraud. For more information, see Suspend or cancel a subscription.
Thanks,
Suchitra.