This article explains how to fix the Microsoft Office 365 push profile failure caused by the following error:
HTTP 400 BadRequest "Property usageLocation is invalid."
For example, the Usage Location in the Edit App Assignment page is set to UK.
- Microsoft Office 365 Provisioning
- Okta Integration Network (OIN)
- User Lifecycle Management
- Okta Identity Engine (OIE)
- Okta Classic Engine
This issue is typically caused by an invalid value in the problematic O365 app assignment's Usage Location field. For example, the Usage Location field value is set to the UK.
The value fails to meet Microsoft product requirements as described in this Microsoft documentation.
Based on the above Microsoft product restriction, further cross-referencing of the ISO 3166-1 alpha-2 two-letter country code for the United Kingdom in particular indicates that the correct two-letter country code is GB, not UK. That would explain the failed push profile update attempt, as Microsoft is rejecting this invalid Usage Location property field value as the provisioning error suggested.
To resolve the issue, follow the steps mentioned below:
- Please navigate to the Okta Admin Console > Tasks page and click on the Edit App assignment button to identify the currently set Usage Location field value for each failed app assignment/profile push task(for example,
UK). - For a full ISO-3166 two-letter country code reference, please visit the Online Browsing Platform (OBP) to locate the correct two-letter country code accepted by Microsoft products. This should be
GBfor the United Kingdom. - Apply the necessary changes to set the Usage Location field value to the correct ISO-3166 two-letter country code via:
- Manual Field value override.
- Alternatively, modify the OEL expression for the problematic Okta to Office 365 mapping for Usage Location app field mapping expression to ensure that it always generates the correct ISO-3166 two-letter country code. For example:
source.countryCode=="UK"?"GB":source.countryCode!="" AND source.countryCode!= null?source.countryCode:"US"
NOTE: The above is just a sample OEL expression. Please make the necessary OEL expression mapping changes based on different customer business needs, and fully test the new mapping expressions before applying them to all current app assignments.
- Save the app assignment and retry.
