刪除配額、方案、供應項目和訂用帳戶Delete quotas, plans, offers, and subscriptions

本文將說明如何刪除不再使用的配額、方案、供應項目和訂用帳戶。This article describes how to delete quotas, plans, offers, and subscriptions that you no longer need. 在一般原則下,您只可以刪除非使用中的項目。As a general principle, you can delete only what isn't in use. 例如,您只能刪除沒有附屬訂用帳戶的供應項目。For example, deleting an offer is only possible if there are no subscriptions that belong to that offer.

但訂用帳戶是此一般原則的例外:您可以刪除包含資源的訂用帳戶,而資源會隨著訂用帳戶一併刪除。Subscriptions are the exception to this general principle: you can delete subscriptions that contain resources and the resources will be deleted along with the subscription.

如果您想要刪除配額,就必須回頭透過任何使用該配額的方案和供應項目來處理。If you want to delete a quota, you must work back through any plans and offers that use that quota. 從供應項目開始,請確定其中已沒有任何訂用帳戶、刪除每個供應項目,然後刪除使用該配額的方案等等。Starting with the offers, ensure they have no subscriptions, delete each offer, then delete the plans that use the quota, and so on.

刪除訂用帳戶Delete a subscription

若要刪除訂用帳戶,請依序選取 [所有服務] 和 [使用者訂用帳戶] ,以顯示系統上所有訂用帳戶的清單。To delete a subscription, select All services, then User subscriptions, to display a list of all subscriptions on the system. 如果您在供應項目上工作,您也可以從該處選取 [訂用帳戶] 。If you're working on an offer, you can also select Subscriptions from there.

您可以刪除這份清單中的訂用帳戶,也可以使用 PowerShell 來撰寫可為您刪除所有訂用帳戶的指令碼。You can delete subscriptions from this list, or you can use PowerShell to write a script that deletes all subscriptions for you. 這些命令記載於訂用帳戶 - 刪除參考中。These commands are documented in the Subscriptions - Delete reference.

警告

刪除訂用帳戶也會刪除其包含的任何資料與資源。Deleting a subscription also deletes any data and resources it contains.

刪除供應項目Delete an offer

若要刪除供應項目,請在系統管理員入口網站中移至 [所有服務] ,然後選取 [供應項目] 。To delete an offer, in the administrator portal, go to All services, then Offers. 選取您想要刪除的供應項目,然後選取 [刪除] 。Select the offer you want to delete, then select Delete.

在 Azure Stack Hub 管理員入口網站中刪除訂用帳戶

您只能刪除沒有訂用帳戶使用的供應項目。You can only delete an offer when there are no subscriptions using it. 如果訂用帳戶依存於該供應項目,則 [刪除] 選項無法使用。If subscriptions exist based on the offer, the Delete option isn't available. 在此情況下,請參閱刪除訂用帳戶一節。In this case, see the Delete a subscription section.

刪除方案Delete a plan

若要刪除方案,請在系統管理員入口網站中移至 [所有服務] ,然後選取 [方案] 。To delete a plan, in the administrator portal go to All services, then Plans. 選取您想要刪除的方案,然後選取 [刪除] 。Select the plan you want to delete, then select Delete.

在 Azure Stack Hub 管理員入口網站中刪除方案

您只能刪除沒有供應項目或訂用帳戶使用的方案。You can only delete a plan when there are no offers or subscriptions using it. 如果有供應項目在使用方案,刪除該方案會讓其失敗,而且您會收到錯誤訊息。If there are offers that use the plan, delete the plan, allow it to fail, and you'll receive an error message. 您可以選取 [父代供應項目] 來顯示正在使用方案的供應項目清單。You can select Parent offers to display a list of offers that use the plan. 如需有關刪除供應項目的詳細資訊,請參閱刪除供應項目For more information about deleting offers, see Delete an offer.

即使方案不是供應項目的一部分,這些方案也可能已直接新增為訂用帳戶的附加方案。Plans might have been added directly to a subscription as add-on plans, even if they're not part of the offer. 在此情況下,必須先從使用這些附加方案的訂用帳戶中移除方案,才能刪除方案。In this case, they must be removed from the subscriptions that use them before the plan can be deleted.

此外,如果方案是訂用帳戶中指定資源的唯一來源,則無法從該訂用帳戶中移除方案。Also, a plan can't be removed from a subscription if it's the only source of a given resource for that subscription. 例如,如果方案 A 已新增至訂用帳戶 1,而且是提供網路配額給訂用帳戶的唯一方案,則您無法從訂用帳戶中移除該方案。For example, if Plan A has been added to Subscription 1, and it's the only plan providing a network quota to the subscription, it can't be removed from the subscription. 因此,無法刪除該項目。Therefore, it can't be deleted.

編輯和刪除配額Edit and delete a quota

您可以使用系統管理員入口網站來檢視和編輯現有配額:選取 [區域管理] ,然後選取相關的資源提供者,並選取 [配額] 。You can view and edit existing quotas using the administrator portal: select Region Management, then select the relevant resource provider, and then select Quotas. 您也可以刪除特定資源提供者的配額。You can also delete quotas for certain resource providers.

在 Azure Stack Hub 管理員入口網站中刪除配額

您也可以使用以下 REST API 來刪除某些配額:You can also delete some quotas using these REST APIs:

注意

如果目前有任何方案正在使用配額,則無法刪除配額。You can't delete a quota if there are any current plans that use it. 您必須先刪除參考配額的方案。You must first delete the plan that references the quota.

後續步驟Next steps