Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

crmserviceclient Application user & Modifiedby Issue

(0) ShareShare
ReportReport
Posted on by 7,316

Hi,

I have a console application that runs as a webjob in azure portal. I recently came across the article that we need to move away from WS-Trust where you give account credentials in the connection string of app settings. So, I have restructured my code to utilize the OAuth based connection string where in I setup an Application user account and assign it System Admin role, create a ClientSecret account for it in Azure, app registration and all of that. My console app seems to be connecting to Dataverse fine and code seem to work as well. All my code does is CRUD operations like Create and Updates. 

My connection string looks something like this:

string connectionString1 = "AuthType=ClientSecret; url=https://xxxxx; ClientId=xxxxxxxxxx-aac6-4ef5-8eab-xxxxxxxxxxx; ClientSecret=xxxxxxxxxxxxxxxxxxxxx";

The problem I am facing is with Modified By field. When an update happens, it sets the Modified By as the application user for a few seconds and then it changes back to my admin account. 

The goal is to show Modified by as the Service account(in this case Application user) that is making the change and not myself. 

Also, when I debug the code, the callerId always shows all zero guid and userId as the application user. No where I see my user Id in it yet it makes it through somehow.

Not sure if I have missed anything in setting up this Application User but I am super confused and not sure how to troubleshoot. Any help would be greatly appreciated. Thanks.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: crmserviceclient Application user & Modifiedby Issue

    Hello,

    Have you verified the Audit history to see what updates are being made by your admin account?

    I agree with Andrew, you need to check your plugin/workflow/power automate which is running on this Entity.

    Check what all pleces you have used your admin account like Workflow owner, Plugin calling user and Power automate connection owner.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: crmserviceclient Application user & Modifiedby Issue

    I have already provided all options I can think of in my previous reply.

  • meenoo Profile Picture
    meenoo 7,316 on at
    RE: crmserviceclient Application user & Modifiedby Issue

    I do have flows but they aren't causing it. I checked.

    Any other suggestions? Thank you.

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: crmserviceclient Application user & Modifiedby Issue

    Hello,

    Do you have any automation that is trigerred on create/update of your records like plugins/workflows/power automate flows?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,399 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans