I am writing an application (scheduled job) to bulk update SharePoint Online custom user profile properties using the SharePoint Online user profile bulk update API.
I am trying to use 'App Only' permissions when connecting to SharePoint Online and use the above API. Based on the article it looks like it is possible (See first question in FAQ in the article) but I am facing challenge in implementing it as I get 'access denied' no matter what permission I grant the client ID.
$workItemId = $o365.QueueImportProfileProperties($userIdType, $userLookupKey, $propertyMap, $importFileUrl);
Can someone point me to an same code/article that uses above API in app only context and what permissions do I have to assign on Azure AD and SharePoint.