Share via

How can I delete CSP-type subscriptions after deactivating them?

Yogesh Rahate 0 Reputation points
2026-04-28T05:23:09.58+00:00

I have multiple CSP-type subscriptions in my tenant. I want to know how to delete these subscriptions after:

Deleting all resources inside each subscription

Disabling the subscriptions

I understand that subscriptions can be deleted from the portal after 7 days. However, I would like to know if there is any script or automated method to delete them instead of doing it manually.

Azure Automation
Azure Automation

An Azure service that is used to automate, configure, and install updates across hybrid environments.


2 answers

Sort by: Most helpful
  1. Suchitra Suregaunkar 14,430 Reputation points Microsoft External Staff Moderator
    2026-04-28T11:16:11.57+00:00

    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.

    Reference: https://learn.microsoft.com/en-us/rest/api/subscription/subscription/cancel?view=rest-subscription-2021-10-01&tabs=HTTP

    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.

    Reference: https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/cancel-azure-subscription#delete-subscriptions

    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.

    Was this answer helpful?


  2. Alex Burlachenko 22,040 Reputation points MVP Volunteer Moderator
    2026-04-28T08:20:36.4966667+00:00

    Yogesh Rahate hi & thx for join me here at Q&A platform,

    for CSP subscriptions, u generally dont delete them from inside Azure like normal PAYG subs.

    after resources are removed, the CSP partner has to suspend/cancel them from Partner Center. Azure portal delete is limited and often not available for CSP-managed subscriptions. there is no reliable script from tenant side to fully delete CSP subscriptions after deactivation.

    So u can automate cleanup of resources with Azure CLI/PowerShell, but the subscription lifecycle itself is controlled by CSP/Partner Center.

    If u are the partner, use Partner Center / Partner Center APIs to suspend or cancel. if u are the customer, ask ur CSP provider to remove/cancel those subscriptions. after cancellation they may remain visible for some time due to retention/billing records, thats normal.

    Other words script resource cleanup, but CSP subscription deletion must be done via CSP partner/Partner Center.

    rgds,

    Alex

    &

    pls if my answer helps pls accept it.
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.