• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 115184, created on Nov 22, 2012, last review on Nov 22, 2014

  • Applies to:
  • Operations Automation 5.5
  • Operations Automation 5.4

Problem Statement

Microsoft does provide the 'test environments' to the customers, where they can test the Office 365 functionality without paying for every subscription.

There used to be 3 types of the environments:

  1. EDOG: testing the new functions. Fully functional environment, featuring all the real services - real SharePoint, real Lync, real Exchange with mailboxes. The provisioning platform stability was quite low: some systems availability was below 10%.
  2. UAT7: user acceptance testing. Mock environment where only the provisioning part has been implemented. Does not make much sense since there is no way to check end-to-end scenarios.
  3. TIP: test-in-production. Real environment hosted on the same back-end as the production platform.

Certain throttling limits are applied to those test environments:

  1. Total number of customer accounts registered: 50 (will be raised to 200 since mid-December 2012)
  2. Total number of subscriptions registered: 1000
  3. Total number of Exchange mailboxes registered: 1000 Note: deleting the mailboxes is deferred by 30 days to allow for recovery. This affects the throttling limits, so plan accordingly - if too many Exchange mailboxes are created, then even cancelling the subscriptions will not help to come over this until 30 days are passed.
  4. Total number of SharePoint sites registered: 1000 In order to remove the customer accounts (which also deletes the associated subscriptions and mailboxes), Microsoft Online Services Interface (MOSI) provides the special method that works only in test environments. This method is documented to have no effect in production environments.

    There is no automated way for calling this method in Parallels Automation. The article provides step-by-step instruction on the manual way to unregister the customer subscription in the Microsoft Office 365 test environment.


Important: the instruction below may be applied to any APS 1.2 Office 365 version starting from 3.0, but Office 365 4.2 and newer have the built-in function to delete the test accounts on expiration. See the parameters "Customer Deactivation Behavior" and "Confirm Deactivation Behavior" in the provider's guide on Creating Office 365 Application Resource Type.

Read the KB article #111518 for instructions how to get the CURL utility for Windows.

Follow the steps below to remove Office 365 subscription of PA customer.

  1. Go to POA Customer CP > Microsoft Office 365 > Configuration > Settings, copy/save somewhere the values of the 'Microsoft internal customer ID' and 'Microsoft internal subscription IDs' parameters.
  2. Cancel the subscription in PA.
  3. Log into the Provisioning Gateway Host using SSH/RDP.
  4. For each Microsoft subscription ID from the p.1 above run the command below to cancel subscription in the Office 365 cloud:

    echo "{\"custId\": \"$custId\", \"subsId\": \"$subsId\"}" | curl -k -d@- -H 'X-MOSI-Gateway-Required-Version: 1.0' -H 'X-MOSI-Gateway-Method: cancel_subscription' <MOSI_GATEWAY_URL>
  5. Finally, run the command to deactivate customer account:

    echo "\"$custId\"" | curl -H "X-MOSI-Gateway-Method: deactivate_customer" -H "X-MOSI-Gateway-Required-Version: 1.0" -D - -d@- -X POST <MOSI_GATEWAY_URL>

    Replace <MOSI_GATEWAY_URL> in the commands above with the actual URL of MOSI Gateway Application installed in the POA-managed environment, it may look like this - https://bpos.provider.com/BPOS/HTTPEndpoint.aspx.

    Replace $custId and $subsId with customer ID and Microsoft subscription ID respectively.

    In case customer has many Office 365 subscriptions you may prepare and run simple Linux shell script to send cancelation requests to MOSI Gateway easier.

1.Create the cancel_customer.sh file on Linux Provisioning Gateway Host with the content like this:

         set -e
         function cancel_subscription()
            echo "{\"custId\": \"$1\", \"subsId\": \"$2\"}" | curl -k -d@- -H 'X-MOSI-Gateway-Required-Version: 1.0' -H 'X-MOSI-Gateway-Method: cancel_subscription' $MOSI_URL
         function deactivate_customer()
            echo "\"$1\"" | curl -k -d@- -H 'X-MOSI-Gateway-Required-Version: 1.0' -H 'X-MOSI-Gateway-Method: deactivate_customer' $MOSI_URL
         # Invoke the cancel_subscription function for every Microsoft subscription
         cancel_subscription CUSTOMER_ID SUB_ID_1
         cancel_subscription CUSTOMER_ID SUB_ID_2
         cancel_subscription CUSTOMER_ID SUB_ID_N

         # Invoke the deactivate_customer function for Microsoft customer account
         deactivate_customer CUSTOMER_ID

Put customer ID and Microsoft subscriptions IDs right into the script in the lines where the cancel_customer and deactivate_customer functions are called. Invoke the cancel_subscription function as many times as many Office 365 subscriptions customer has.

2.Make the cancel_customer.sh script executable:

    # chmod +x cancel_customer.sh

3.Run the script:

    # ./cancel_customer.sh <MOSI_GATEWAY_URL>

MOSI Gateway URL may be found in the POA Provider Control Panel in properties of the resource type created for the APS application Office 365:

  • Log into the POA Provider Control Panel
  • Go to Top > Service Director > Application Manager > Applications
  • Click on the Office 365 application
  • Switch to the Resource Types tab
  • Click on the resource type based on the resource class Application
  • Switch to the Activation Parameters tab
  • Switch to the Global Settings sub-tab
  • Get the value of the parameter URL for MOSI Connector Once the script in p.5 returns the success response (HTTP status 200 OK), the customer account is considered deleted.

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07 5b048d9bddf8048a00aba7e0bdadef37 2554725ed606193dd9bbce21365bed4e ac82ce33439a9c1feec4ff4f2f638899

Email subscription for changes to this article
Save as PDF