Importing Multiple Azure Subscriptions at Once

Important: This documentation is for the APS-based Azure integration solution. If you are using a Connect-based Azure integration solution, please refer to the Connect documentation.

Prerequisites

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

  1. Obtain the bulk_import.py Python script from the Release Notes.
  2. Create customer accounts, reseller accounts, service templates, and service plans in CloudBlue Commerce.
  3. Prepare a CSV file and fill in information about subscriptions. The file must contain the following columns: tenant, plan_id, sub_id, company_name, email, account_id.

The account_id field is optional.

During the import, if the company name and administrator's email address specified in the file are the same as in the 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:

tenant,plan_id,sub_id,company_name,email,account_id
chriscontoso.onmicrosoft.com,453f357f-5ba1-46c1-b34d-f36a568c17c2,bfb8503a-eded-4230-8df9-c0fb26df3e58,Contoso,chris@contoso.com,,
bencontoso.onmicrosoft.com,36fdae6c-c4b4-40e7-9842-fc8b9e967ce5,6b6283cf-af60-4a1a-9e5d-d1dad03c64a7,Contoso,ben@contoso.com,1000009
mcontoso.onmicrosoft.com,724e2236-ff5c-4d18-ad1a-c36537fa0518,88891613-8fb6-4bd6-9974-5526422c2031,"Contoso, with comma",melissa@contoso.com,1000010

Notes:

  • You must specify full tenant domain names.
  • You must use double quotes for escaping special characters in company names.
  • Import does not change the MPN IDs of imported subscriptions.
  • The bulk_import.py script has a default limit on the number of subscriptions per file (IMPORT_LIMIT = 100). Either split your subscriptions into separate files or change this property in the script.

Performing the Import

  1. Allow bulk import on the Azure end-point node:
    1. In the configuration file /usr/local/azure-nce/application.yml, change the value of the bulkImportAllowed property to true.
    2. Restart the application service:

      systemctl restart azure-nce
  2. Create a directory on the management node.

    mkdir /usr/local/azure-nce
  3. Copy the bulk_import.py Python script to the directory that you created on the management node.
  4. Copy the CSV file that you prepared to the same directory.
  5. Run the import tool as follows:

    cd /usr/local/azure-nce/
    python bulk_import.py --file <path> --plan-id <service plan ID>

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:

  • --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 first day of the current month.
  • --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 into 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 match. 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.

Notes:

  • The vendors of the imported subscriptions must have permission to import them.
  • Use the --vendor-verification parameter if you do not want to send verification messages to your customers.
  • For the imported subscriptions, the Microsoft Customer Agreement will be accepted with the first name, the last name, and the email address of the CloudBlue Commerce account's administrative contact that you specified by using company_name+email or account_id values.
  • Use the --auto-verification (or -V) flag if you want to import subscriptions without manually passing the verification.
  • The --cut-off-date is the first day of a month. This value should be specified as follows: -C YYYY-MM; for example, for the Apr 1st 2020, you should use -C 2020-04.
  • We recommend you use the test mode (--test or -T) to check your file before the import. Check the import results and logs files for details.
  • You can view the results of the import in the files /usr/local/azure-nce/import_log[timestamp].csv.
  • You can view the logs of the import in the file /usr/local/azure-nce/bulk_import.log.