Hi everyone,
I’m working on an automated provisioning flow using Power Automate to streamline group and workspace setup for our Dynamics 365 environment. Here's what the flow currently does:
- Creates a Microsoft 365 Group (used by Dynamics 365 for access control).
- Creates a Microsoft Teams team associated with that group.
- Outlook group gets provisioned automatically when the group is created.
- Now I want to create a OneNote notebook associated with the group as well.
To accomplish step 4, I attempted to use the Microsoft Graph API endpoint:
POST https://graph.microsoft.com/v1.0/groups/{group-id}/onenote/notebooks
However, I ran into the following error when executing the request with an app-only token:
The request does not contain a valid authentication token.
To improve the security of our customers' data, this API will no longer support app-only tokens starting from March 31st 2025. Customers may still call these APIs using delegated (app+user) tokens.
My questions:
- How can I adapt my Power Automate flow to support delegated (user+app) authentication when calling this endpoint?
Currently, everything is running under an application identity without user context.
- What is the recommended approach to programmatically create or trigger the creation of a OneNote notebook for a group when using Power Automate?
- Is there a workaround or alternate endpoint that supports app-only tokens for OneNote notebook creation, or any way to trigger this indirectly (e.g., through Teams or SharePoint)?
- If delegated authentication is the only option, how would that work in a fully automated backend process? Would I need to run the flow with a service account or user context somehow?
Additional Info:
- App is registered in Azure AD with necessary Graph permissions (
Group.ReadWrite.All, Notes.Create, Notes.ReadWrite.All, etc.).
- All other steps (group creation, Teams creation) work as expected using app-only access token.
- I want to avoid requiring user interaction (login prompts) in the automated flow.
Would really appreciate any guidance, code samples, or architecture suggestions from anyone who’s tackled a similar scenario.
Thanks in advance!