Azure Synapse Link for Dataverse gets stuck “Fetching app…”


Introduction

In this post I am documenting the approach that we took to fixing an issue when setting up the Azure Synapse Link for Dataverse.

We followed the instructions that Microsoft laid out which are detailed in this post,

Create an Azure Synapse Link for Dataverse with your Azure Synapse Workspace.

It is important to get the permissions right within Azure for the Blob Storage rights to the Azure Storage Account.

The problem was when we set up the Azure Synapse Link for Dataverse, after you choose your tables and click Save. The setup would start but get stuck with a message saying “Fetching app….” at the top of the screen. I waited and waited but nothing happened.

An example is shown below.

After a lot of head-scratching and checking the documentation, we ended up launching a call with Microsoft Support.

Microsoft Support to the rescue

Our support engineer, Kristiana, asked us to create network traces and eventually, we could see a request to Azure AD Application failing for app id: f3b07414-6bf4-46e6-b63f-56941f3f4128.

Kristiana came back to us and said that we were missing an Azure AD sorry Microsoft Entra Service Principal for Power Query.

The fix was the following:

Prerequisites:

User with privileges to create a service principal in Azure tenant (Tenant admin):

o Application Administrator
o Global Administrator

Create principal in the Azure tenant:

  • Launch Powershell
  • Connect to the tenant by running the following command; you’ll be prompted to authenticate. Login using credentials for the Azure tenant admin
  • Connect-AzAccount 
  • The subscription shouldn’t matter as we’re adding a new service principal to the tenant
  • Add the principal by running the following command
  • New-AzADServicePrincipal -ApplicationId ‘f3b07414-6bf4-46e6-b63f-56941f3f4128’

The Azure Synapse Link process was tried again and it worked, after a few weeks of trying we had a successful Azure Synapse Link setup!

Anyway hope that helps.

Resolving Power Automate Outlook Connector’s Create Event Operation Cannot find Calendar Issue


Photo by Jonny Gios on Unsplash

Introduction

One of my iThink 365 team called me up about creating events using the Outlook 365 connector and Create Event activity.

An image showing the Office 365 Outlook connector with the Create Event action.

The Create Event activity would successfully create an event when the Power Automate flow was run by the developer who created the flow. However, when the flow runs as anyone else then it failed with the following error,

“The specified object was not found in the store.”.

When we looked at the configuration of the Create Event operation we could see that the “Calendar”, calendar had been selected. So, if we have selected the right calendar, why is it failing? Why is it that Power Automate cannot find the Outlook calendar?

Well, the point is that the create event operation has a drop-down. This drop-down allows you to choose the name of the calendar to create the event in (as shown below).

However, when the calendar, “Calendar” is chosen it does not use the name of the calendar but rather the id instead. Each calendar has a unique id for each user’s mailbox. When we chose the calendar, rather than using a generic name, the Power Automate editor uses the calendars id. You can see that Id shown in the screenshot below (this was shown by clicking … for the operation and choosing Peek code).

So when Power Automate flow is running, it is running in the context of a user. In our example it is based on the user who started the flow. Now if the user is different to the developer, then they will have calendars with different IDs to the developer. So, in short, the error is right! The flow cannot find the calendar in the store because the calendar with the ID does not exist in the user’s mailbox!

Solution

So how do we resolve this and build something that works?

Well, we need to get the Id for the calendar and use that instead. How do we do that? Fortunately, there is an operation called Get Calendars which allows us to get all the calendars for the current user.

This operation will retrieve all the calendars in the user’s mailbox and using that it is possible to filter the array of calendars and select the id for the default calendar in the user’s mailbox.

This Filter array operation is then configured to take the output of the Get Calendars action and filter using the name “Calendar”.

Now, that we have the array item for the default calendar for the user, we can now use this with Create event by using the following formulae for the Calendar id.

first(body(‘Get_Users_Default_Calendar’))?[‘Id’]

Now that the Create Event action is using this formula to choose the Calendar Id, the operation will be able to find the calendar to successfully create the event in the user’s calendar. Regardless of which user runs the Power Automate flow!

Caveat

There is a caveat for this approach to work, firstly we need to ensure that the flow runs the connection in the context of the user who started the flow.

To do this, browse to the Power Automate Flow details page. Click edit next to the “Run only users” box. Change the drop-down to for the connector to say “Provided by run-only user”, as shown below.

Finally, set the Outlook 365 Connector to use “Provided by run-only user”.

The other point to make is that the flow will need to run in the context of the user that is having the event created in their calendar.

Therefore, there will be some design choices that you will need to make to ensure that the flow is started by the user who is to have the event created in their calendar.

This means that the flow cannot run off a system event or as an application as it will not have permission to write to the user’s calendar. Currently, the actions do not support being run as a service principal. If this were the case, it would be possible to give permission to write in every user’s calendar.

Anyway, hope that helps and please reach out if you have any questions on this.