Collecting Tenant Data
Before importing tenant subscriptions, tenant data must be collected from the Microsoft cloud. It is done by using the readCSPAccounts.py
script. The script retrieves information about tenants, such as tenant properties and lists of tenant subscriptions, tries to find the corresponding customer accounts for these tenants, and tries to find suitable Office 365 service plans for tenant subscriptions.
The readCSPAccounts.py
script has the following input parameters:
- csp-app-instance-id – The identifier of an application instance of the Office 365 application. Specify the prepared identifier of the required application instance.
- vendor-id – The identifier of a vendor account in Odin Automation. Specify the prepared identifier of the required vendor account.
-
account-domain-list – A comma-separated list of verified domains of tenants. If it is specified, the
readCSPAccounts.py
script collects the tenant data of the tenants identified by the domains. If it is not specified, thereadCSPAccounts.py
script collects the tenant data of all tenants. Note that thereadCSPAccounts.py
script takes into account tenants that are not managed by Odin Automation.You can use this parameter to import the tenant subscriptions of the tenants that you need. To do this, specify the parameter when running the
readCSPAccounts.py
script, and then use the produced output file when running theimportSubsCSP.py
script.Note: When using this parameter, enclose its value in double quotation marks (").
-
account-default-domain – (DEPRECATED) A verified domain of a tenant. If it is specified, the
readCSPAccounts.py
script collects the tenant data of the tenant identified by the domain. If it is not specified, thereadCSPAccounts.py
script collects the tenant data of all tenants. Note that thereadCSPAccounts.py
script takes into account tenants that are not managed by Odin Automation.You can use this parameter to import the tenant subscriptions of the tenant that you need. To do this, specify the parameter when running the
readCSPAccounts.py
script, and then use the produced output file when running theimportSubsCSP.py
script. - tenant-id-attribute-name – The identifier of a custom attribute in OA Billing. This parameter is optional. Specify this input parameter if the prepared customer accounts have a custom attribute and the corresponding tenant identifiers are specified in the custom attribute. This will enable the
readCSPAccounts.py
script to find the corresponding customer account for each tenant. Do not specify the input parameter if the prepared customer accounts do not have such a custom attribute. In this case you will need to use another approach to find the corresponding customer account for each tenant. - oa-api-user – The name of an Odin Automation Public API user. Specify this parameter only if HTTP authentication is turned on for the Odin Automation Public API. We recommend that you specify the name of the user that you created during the deployment of the application (see the Preparing an Odin Automation Public API User section for details).
- oa-api-user-password – The password of that Odin Automation Public API user. Specify this parameter only if HTTP authentication is turned on for the Odin Automation Public API. We recommend that you specify the password of the user that you created during the deployment of the application (see the Preparing an Odin Automation Public API User section for details).
- verbose – If it is specified, more log information is shown in the console during the
readCSPAccounts.py
script's execution. The parameter is optional. -
ignore-disabled – If it is specified, suspended tenant subscriptions are ignored by the script.
The readCSPAccounts.py
script produces the following output files:
-
customers_PARTNER_SUBDOMAIN.csv
orcustomers_PARTNER_TENANT_ID.csv
– This file contains a list of tenants and their properties. Each tenant is represented in the following way:- TenantId – The identifier of the tenant in the Microsoft cloud.
- CspCustomerId – The CSP customer identifier of the tenant in the Microsoft cloud.
- InitialDomainName – The initial domain of the tenant.
- DisplayName – The display name of the tenant.
- OSACustomerId – The identifier of the corresponding customer account in Odin Automation. It is set to -1 if the customer account cannot be found.
- company_name – The name of the company of the tenant.
- culture – The default locale of the tenant.
- address_line1 – The first line of the address of the tenant.
- address_line2 – The second line of the address of the tenant.
- address_line3 – The third line of the address of the tenant.
- city – The city of the tenant.
- country – The country of the tenant.
- first_name – The first name of the tenant.
- last_name – The last name of the tenant.
- phone_number – The phone number of the tenant.
- postal_code – The postal code of the tenant.
- region – The region of the tenant.
- email – The email address of the tenant.
- language – The language of the tenant.
- type – The type of the tenant in the Microsoft cloud.
-
importSubs_PARTNER_SUBDOMAIN.csv
orimportSubs_PARTNER_TENANT_ID.csv
– This file contains lists of tenant subscriptions which will be imported. This file will be used by theimportSubsCSP.py
script to perform importing. Each list of tenant subscriptions is represented in the following way:- OSACustomerID – The identifier of the corresponding customer account in Odin Automation. It is set to -1 if the customer account cannot be found.
- OSAServicePlanId – The identifier of the target Office 365 service plan which will be used to create an Office 365 subscription in Odin Automation for the tenant subscriptions listed in MSSubscriptionIDs.
- OSAPlanPeriodID – The identifier of the target subscription period of the chosen Office 365 service plan.
- SubscriptionStartDate – The start date of the Office 365 subscription which will be created in Odin Automation. The date is specified according to ISO 8601. For example: 2019-06-30T00:00:00Z.
- SubscriptionLastBillingDate – The last billing date of the Office 365 subscription which will be created in Odin Automation. By default, this field is empty, which means that this date will be calculated automatically based on SubscriptionStartDate and parameters of the corresponding service plan, such as its billing period and subscription period. If you need to customize this date, specify it according to ISO 8601. For example: 2019-06-30T00:00:00Z.
- SubscriptionNextBillingDate – The next billing date of the Office 365 subscription which will be created in Odin Automation. By default, this field is empty, which means that this date will be calculated automatically based on SubscriptionStartDate and parameters of the corresponding service plan, such as its billing period and subscription period. If you need to customize this date, specify it according to ISO 8601. For example: 2019-07-30T00:00:00Z.
- SubscriptionExpirationDate – The expiration date of the Office 365 subscription which will be created in Odin Automation. By default, this field is empty, which means that this date will be calculated automatically based on SubscriptionStartDate and parameters of the corresponding service plan, such as its billing period and subscription period. If you need to customize this date, specify it according to ISO 8601. For example: 2020-06-30T00:00:00Z.
- ResourceRateLimits – The list of resource rates and their limits. The format "RR_ID1-LIMIT,RR_ID2-LIMIT" is used for the list. For example: "100-10,200-20".
- CSPAccountId – The CSP customer identifier of the tenant in the Microsoft cloud.
- MSSubscriptionIDs – The list of tenant subscriptions. The format "MS_SUB_ID1,MS_SUB_ID2,..." is used for the list. For example: "A49C6781-1557-42CA-A074-52D0553397EA,EBE5106C-B1ED-44FF-8CE7-A2746AF8BC42".
- DefaultAdminLogin – The login of the default administrative user of the tenant.
- InitialDomainName – The initial domain of the tenant.
Notes:
1. There may be several rows in theimportSubs_PARTNER_SUBDOMAIN.csv
orimportSubs_PARTNER_TENANT_ID.csv
file for different lists of tenant subscriptions of a tenant because one list of tenant subscriptions may belong to one Office 365 service plan and another list of tenant subscriptions may belong to another Office 365 service plan.
2. See Creating 'Office 365' Service Plans to obtain information about the structure of Office 365 service plans.
3. Office 365 service plans with composite resources are supported by thereadCSPAccounts.py
script. If each composite resource of an Office 365 service plan contains one included resource and the amount of the included resource is equal to 1, the Office 365 service plan is taken into account by the script to find suitable Office 365 service plans for tenant subscriptions.
4. By default, both active tenant subscriptions and suspended tenant subscriptions are taken into account by thereadCSPAccounts.py
script. -
errorSubs_PARTNER_SUBDOMAIN.csv
orerrorSubs_PARTNER_TENANT_ID.csv
– This file contains lists of tenant subscriptions which cannot be imported due to some reasons. Each list of tenant subscriptions is represented in the following way:- OSACustomerID – The identifier of the corresponding customer account in Odin Automation. It is set to -1 if the customer account cannot be found.
- CSPAccountId – The CSP customer identifier of the tenant in the Microsoft cloud.
- SubscriptionStartDate – The start date of the Office 365 subscription which will be created in Odin Automation.
- MSSubscriptionIDs – The list of tenant subscriptions.
- MSSubscriptionOfferIDs – The list of tenant subscription offers.
- Comments – Comments containing information which may be used for troubleshooting.
Analyze the
errorSubs_PARTNER_SUBDOMAIN.csv
orerrorSubs_PARTNER_TENANT_ID.csv
file and fix problems. After doing this, you can run thereadCSPAccounts.py
script again. readCSPAccountsYYYY-MM-DD.log
- The log file of thereadCSPAccounts.py
script.
Note: If the readCSPAccounts.py
script fails with the error The identity of the calling application could not be established, use this KB article to resolve this problem.
You can run the readCSPAccounts.py
script, for example, in the following way: readCSPAccounts.py --vendor-id 1 --csp-app-instance-id 10
After running the readCSPAccounts.py
script, make sure all tenant subscriptions are processed correctly:
- Check that each tenant belongs to the corresponding customer account.
- Check that each list of tenant subscriptions belongs to the appropriate Office 365 service plan; the correct resource rates and limits are specified for each list of tenant subscriptions; the billing frequencies of the tenant subscriptions belong to the billing periods of their Office 365 service plans. If required, update the
importSubs_PARTNER_SUBDOMAIN.csv
orimportSubs_PARTNER_TENANT_ID.csv
file.