Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

How to use application user credential to call Web API?

(0) ShareShare
ReportReport
Posted on by 35

hi,

I have created the application user in Dynamic 365, and now i wish to write the connection string to connect to the Dynamic Environment using Web API. Anyone know how to write the connection string in C# App.config? 

If i already have Application User, do i still need to fill in the UserPrincipalName and Password?

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: How to use application user credential to call Web API?

    Hi,

    Please make sure that the application has been registered in Azure Active Directory admin center: Tutorial: Register an app with Azure Active Directory (Microsoft Dataverse) - Power Apps | Microsoft Docs

     

    Then the connection code is something like:

    {
        "ConnectionStrings": {
            "CrmOnline": "Url=https://yourorganization.crm.dynamics.com/; Username=name@xxx.onmicrosoft.com; Password=password"
    	    },
        "AppSettings": {
            "ClientId": "yourclientid",
            "RedirectUrl": "yourredirectUrl"
    	    }
    }
     

    ClientId: ‘Application ID’ from Azure AD,  generated in above section.

    RedirectUrl: set in the registration.

     

    Here is a complete sample you can refer to:

    GitHub - mischameyer/sample-dynamics365-webapi-caller-dotnet461: Simple .NET Client (console) with .NET 4.6.1 to connect to an existing dynamics365-instance and get all contacts from a REST-Api (GET).

     

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans