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

Announcements

No record found.

News and Announcements icon
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.

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

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

  • meenoo Profile Picture
    7,316 on at

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

    Any other suggestions? Thank you.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

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

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    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/

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 115

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 74 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 56 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans