
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?
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:
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