Share via


Delete a Subscription

 

Applies To: Windows Azure Pack

Deletes a subscription.

Request

Replace <ServiceMgmt> with your Service Management API endpoint address. Replace <Port> with either 30005 for the tenant API or 30004 for the administrator API. Replace <SubscriptionId> with the identifier of the subscription that is to be deleted.

Method

Request URI

HTTP version

DELETE

https://<ServiceMgmt>:<Port>/subscriptions/<SubscriptionId>

HTTP/1.1

URI Parameters

Element name

Description

force

True forces deletion of the subscription regardless of its status in the underlying resource providers.

None.

Request Headers

The following table describes required and optional request headers.

Request Header

Description

Authorization: Bearer

Required. Authorization bearer token.

x-ms-principal-id

Required. The principal identifier.

x-ms-client-request-id:

Optional. The client request identifier.

x-ms-client-session-id:

Optional. The client session identifier.

x-ms-principal-liveid:

Optional. The principal Live identifier.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 202 (ACCEPTED).

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The following table describes the elements of the response body.

Element

Description

Subscription

The deleted subscription. For more information, see Subscription (Common object).

Example

The following code example shows a Delete Subscription request.

DELETE https://<Computer>:30004/subscriptions/9323db9e-e8f0-4bf7-ba07-6299fd460634?force=False HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: e46db2c4-e8b5-4436-b8be-818b1bd36f0c-2014-05-02 17:37:16Z
x-ms-client-session-id: f90c0464-436d-46a4-b0b6-3d89acde401f
x-ms-principal-id: <computer>%5cAdministrator
Accept-Language: en-US
Host: <computer>:30004
Content-Length: 0

The following code example shows a Delete Subscription response.

{
  "SubscriptionID": "9323db9e-e8f0-4bf7-ba07-6299fd460634",
  "SubscriptionName": "My Subscription",
  "AccountAdminLiveEmailId": "user@contoso.com",
  "ServiceAdminLiveEmailId": null,
  "CoAdminNames": [

  ],
  "AddOnReferences": [

  ],
  "AddOns": [

  ],
  "State": 3,
  "QuotaSyncState": 0,
  "ActivationSyncState": 1,
  "PlanId": "Mysubhtm4a5qe",
  "Services": [
    {

      "Type": "sqlservers",
      "State": "registered",
      "QuotaSyncState": 0,
      "ActivationSyncState": 1,
      "BaseQuotaSettings": [
        {
          "Key": "Editions",
          "Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":\"10\",\"resourceSize\":\"1024\",\"resourceSizeLimit\":\"1024\",\"offerEditionId\":\"032814080310\",\"groupType\":null}]"
        }
      ]
    }
  ],
  "LastErrorMessage": null,
  "Features": null,
  "OfferFriendlyName": "My Subscription",
  "OfferCategory": null,
  "Created": "2014-04-28T17:37:37.27"
}

See Also

Common Subscription Interfaces