Importing Multiple Azure CSP Subscriptions

If you need to migrate Azure CSP subscriptions between various installations of CloudBlue Commerce, or need to accommodate in CloudBlue Commerce existing Azure CSP tenants that are managed elsewhere, you can do so by using a command-line tool called bulk-tenant-import.

You can obtain this tool from the distribution package of Azure CSP Integration.

Prerequisites

Before you start importing or migrating Azure subscriptions, you need to perform the following steps:

  1. Create customer accounts, reseller accounts, service templates, and service plans in CloudBlue Commerce.
  2. Prepare a CSV file and fill in information about subscriptions. The file must have the following columns: domain_name, sub_id, mpn_id, company_name, email, account_id.

  3. The account ID and MPN IDs are optional.

During the import, if the company name and administrator's email address specified in the file coincide with contact details of user accounts in CloudBlue Commerce, Azure subscriptions are automatically bound to user accounts. If you want to import tenants and bind them to specific accounts in CloudBlue Commerce, specify account IDs in the file.

Here is an example of such a file:

domain_name,sub_id,mpn_id,company_name,email,account_id
chriscontoso.onmicrosoft.com,02C12D13-D517-4602-8AED-B69802908C72,,Contoso,chris@contoso.com,
bencontoso.onmicrosoft.com,941ECAE3-7219-4341-8845-7CDF2A8BDA96,0000005,Contoso,ben@contoso.com,1000009
mcontoso.onmicrosoft.com,80103A3A-32F8-4A1F-AB58-4EA03DF7F4D8,0000005,Contoso,melissa@contoso.com,1000010

Performing the Import

  1. Copy the CSV file that you prepared to the management node.
  2. Run the import tool as follows:

    cd /usr/local/azure/
    python deployment/bulk_tenant_import.py --file <path> --plan-id <service plan ID> > import.log

    Where:

    • --file (or -F) specifies the path to your CSV file.
    • --plan-id (or -P) specifies the ID of the service plan that will be assigned to the imported Azure subscriptions. Make sure that the plan that you specify belongs to the vendor of the imported subscription.

    Optional parameters:

    • --azure-ep (or -E) specifies the ID of the service node where the Azure end-point host is deployed. By default, the first end-point host registered in the system is used.
    • --cut-off-date (or -C) specifies when Billing in CloudBlue Commerce must start charging the subscription owner. By default, the cut-off date is the same as the date of import.
    • --test (or -T) specifies that the tool must run in a test mode. The tool analyzes whether the import can be completed without any issues and it records the results to a file.
    • --auto-verification (or -V) specifies that the tool must automatically confirm the ownership of imported tenants without requiring any actions from the owner or the vendor. This option only works for the accounts where the company name and administrator's email address coincide. For the accounts that cannot be automatically verified, email messages with manual verification instructions will be sent to users. Vendors will not be sent any verification messages.
    • --vendor-verification specifies that the vendor will verify all imported subscriptions manually.

You can view the results of the import in the file /usr/local/azure/import_log*.csv.