Symptoms

After upgrade Azure CSP to version 7.7 periodic task Synchronize resource usage for APS application instance #xxx (Azure Cloud Solution Provider) started to fail with error like:

    Could not get resource usage for resource with UUID '423d77df-2975-406b-b6f9-6cfb7f3d9ed7': The tenant linked with the customer account '1000009' cannot be transferred to another vendor. An account can be transferred only between resellers of the same vendor. The Azure reseller linked with the account '8068cf69-d816-4be1-82f5-8290327e9d3d' is undefined.

Azure usage is not propogated to the CB Commerce as well.


For Azure CSP 7.7.1 and above, task "Execute operation '/synchronize_resource_usage' with ID *** on resource ***" fails with the same output.

Cause

Additional check was added in scope of Azure CSP 7.7 application. This check determines customers which were improperly moved between different resellers. Such feature was not supported by Azure CSP application, so the application tries to fix the configuration and relink these customers.

The check is implemented the following way. First, the application tries to determine "partner" resource linked with customer's account:

2020-01-10 01:51:02,947 DEBUG [com.odin.azure.common.ClientLogs] (azure task-93) <APS> Outgoing request 'GET https://192.168.0.143:6308/aps/2/resources/?implementing(http://www.odin.com/app/azure-csp/partner/1.8),eq(core_account.aps.id,6cfdcf4b-bd7f-4600-a4a9-4c281ef80d58)' has been finished: HTTP 200 OK
- headers:
        Cache-Control: no-cache, no-store
        Connection: keep-alive
        Content-Length: 2
        Content-Range: items */0
        Content-Type: application/json
        Date: Fri, 10 Jan 2020 06:50:55 GMT
        Expires: Mon, 01 Jan 2001 00:00:01 GMT
        X-APSBooster-Response: true
- body:
[]
- end

Then it tries to determine "reseller" resource linked with customer's account:

2020-01-10 01:51:03,059 DEBUG [com.odin.azure.common.ClientLogs] (azure task-93) <APS> Outgoing request 'GET https://192.168.0.143:6308/aps/2/resources/e01c6e44-b27f-4abd-a19c-6fa10261c4ac/reseller?implementing(http://www.odin.com/app/azure-csp/reseller/1.5)' has been finished: HTTP 200 OK
- headers:
        Cache-Control: no-cache, no-store
        Connection: keep-alive
        Content-Length: 2
        Content-Range: items */0
        Content-Type: application/json
        Date: Fri, 10 Jan 2020 06:50:55 GMT
        Expires: Mon, 01 Jan 2001 00:00:01 GMT
        X-APSBooster-Response: true
- body:
[]
- end

The error appears when both of these requests return empty response. That could be caused by several reasons:

  1. Customer was moved between resellers on a different level (for instance, from provider to reseller).
  2. Instance is not activated.
  3. Reseller of the customer is not subscribed to "Azure Reseller" service plan.

All three of these scenarios are considered as misconfigurations and should be resolved accordingly in order to avoid issues with Azure usage collection/calculation.

Resolution

Case #1:

In order to correct Azure CSP business model, it is required to unprovision subscription with "Do not suspend in Azure" and add it back using import procedure:

  1. Set "Do not suspend in Azure" flag for incorrect subscription.
  2. Cancel and destroy affected subscription.
  3. Check if import is allowed for the reseller of customer in application instance settings.
  4. Import the subscription with correct cut-of-date to corresponding reseller.
  5. Perform import verification procedure (can be performed whether by reseller or customer (check Azure application documentation for additional details).

Case #2:

It is required to activate Azure instance. The instance could be activated whether by provider's account or it could be delegated to one of resellers.

To activate instance for the provider refer to:

Azure CSP Integration > Azure CSP Integration > Configuring CSP Partner as an Odin Automation Provider > Configuring the Azure Application Instance

In order to delegate instance to one of reseller, follow steps described in this section:

Azure CSP Integration > Azure CSP Integration > Configuring CSP Partner as an Odin Automation Reseller

Once misconfiguration is resolved, it might be required to destroy and import affected subscription (follow instructions provided in Case #1).

Case #3:

It is required to subscribed resellers to the following service plans:

  • Azure Reseller
  • Azure Customer Resources

Refer to the following section of documentation in order to create corresponding plans:

Azure CSP Integration > Azure CSP Integration > Configuring CSP Partner as a CloudBlue Commerce Provider > Creating Service Plans 

https://docs.cloudblue.com/cbc/services/azure/7.7/content/Creating-Service-Plans.htm

Azure CSP Integration > Azure CSP Integration > Configuring CSP Partner as a CloudBlue Commerce Provider > Selling Azure Services to Resellers

https://docs.cloudblue.com/cbc/services/azure/7.7/content/Selling-Azure-Services-to-Resellers.htm


Bear in mind that only the following schema is supported by the Azure application:

Partner > L2 Reseller > End-customer

L3 resellers are not supported by the application:

Partner > L2 Reseller > L3 Reseller > End-customer

Once misconfiguration is resolved, it might be required to destroy and import affected subscription (follow instructions provided in Case #1).

Internal content

Link on internal Article