web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a Dataverse S...
Power Apps
Suggested Answer

Creating a Dataverse Service Principal and Environment Variable for Azure Key Vault

(1) ShareShare
ReportReport
Posted on by 439
Hi everyone,
 
I have set up an Azure Key Vault which works well in the scope of a Flow which I authored and ran. (The Azure Subscription, Resource Group, Key Vault and Secret are working correctly in the Flow when they are called by the Flow).
 
I am trying to take this a step further, to add an Environment Variable in my Dataverse-based Solution which will call Key Vault to obtain the Secret. When I try to save the Environment Variable, I see this error:
 
 
The 'Owner' of the resources is logged in at the time the above is attempted, so it seems that the "User" it's referring to is the Dataverse 'service', and not the scope of a user account.

I've found instructions that say that I need to register the Microsoft.PowerPlatform resource provider in my Azure subscription (https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types). I can confirm this has already been done.

It also states:

"Azure Key Vault must have the Key Vault Secrets User role granted to the Dataverse service principal. If it doesn't exist for this vault, add a new access policy using the same method you previously used for the end user permission, only using the Dataverse application identity instead of the user. 

If you have multiple Dataverse service principals in your tenant, then we recommend that you select them all and save the role assignment. Once the role is assigned, review each Dataverse item listed in the role assignments list and select the Dataverse name to view the details. If the Application ID isn't 00000007-0000-0000-c000-000000000000**, then select the identity, and then select Remove to remove it from the list."

 

The problem is, I do not know how to check if we have a Dataverse Service Principal, or, how to set one up. Completing some searches for this have not revealed any information. Can anyone advise on next steps for this?

Thank you!

 

I have the same question (0)
  • Suggested answer
    MichaelFP Profile Picture
    1,847 Super User 2025 Season 2 on at
    These Dataverse Principal are App registration inside on the Microsoft Entra ID. So need to create one of this and them include in your environments and after that on the azure apply the roles that you got from the documentation.
     
    Setup a Service Principal in Power Automate

    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as answer ✔️. This is help the community.
  • pp365 Profile Picture
    439 on at
     
    Thank you for your reply and the linked resource. I've followed all the steps in the linked resource, and still no luck, I am getting the same error.
     
    Whilst I can see how the linked resource might work for a Power Automate Flow, I don't see how that would enable the use of an Environment Variable as there is nowhere to specify, within the creation of the Environment Variable, the Application Client ID or Client Secret or Directory (Tenant ID) which are surely the authentication pieces required? 
     
    In the linked article, in Create Flow, Step 4, the above details are added. This makes sense as you are providing the authentication details to the Flow which have been set up against the Application and in turn the Security Role provided to the Application. But during the creation of the Environment Variable there is nowhere to enter these data?
     
    It is very frustrating that (as usual), Microsoft documentation on this to any degree of usefulness is completely non-existent. Can you advise further please? Thank you very much!
  • pp365 Profile Picture
    439 on at
    Hi again @MichaelFP , everyone,
     
    I have proceeded to create a Service Principal within a Flow, for Dataverse tables - so the linked instructions do work for this. But, this does not extend to the Environment Variable concept. This matter remains pending. As mentioned in my last post, I can only assume there is an additional piece of the puzzle here since I am yet to see any instructions on how the Application Client ID or Client Secret or Directory (Tenant ID) can be matched against the Environment Variable - and yet these are the attributes needed to create a Service Principal in the Flow context.
     
    Any further help on this would be greatly appreciated, thank you!
  • pp365 Profile Picture
    439 on at
    Hello everyone,
     
    Still no further forward on this which is a total blocker on a solution development at the moment. Is anyone able to advise?
     
    Many thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard