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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

How to get "Resource URL" of my Dynamics 365 domain?

(0) ShareShare
ReportReport
Posted on by 5

Hi Team,

I have created my domain on Dynamics 365 site with my username as "Sunil@SunilAgrawal.onmicrosoft.com". I also have done all the steps required to register by app on Azure Portal by following the steps given here (
https://www.c-sharpcorner.com/article/generate-access-token-for-dynamics-365-single-tenant-server-to-server-authentica/).

I also have written the below code given on the above URL. But, I cannot figure out what is my "Dynamics 365 Organization URL".

Would someone please send me the steps to get my "Dynamics 365 Organization URL"?

  1. public static async Task<string> AccessTokenGenerator()  
  2.         {  
  3.             string clientId = "Given my ID"// Your Azure AD Application ID  
  4.             string clientSecret = "Given my secret"// Client secret generated in your App  
  5.             string authority = "">login.microsoftonline.com/ceb48f70-0000-1111-0000-9170f6a706a6"; // Azure AD App Tenant ID  
  6.             string resourceUrl = "">efrig.crm8.dynamics.com"; // Your Dynamics 365 Organization URL  
  7.   
  8.             var credentials = new ClientCredential(clientId, clientSecret);  
  9.             var authContext = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authority);  
  10.             var result = await authContext.AcquireTokenAsync(resourceUrl, credentials);  
  11.             return result.AccessToken;  
  12.         }  
I have the same question (0)
  • DavePinch Profile Picture
    Microsoft Employee on at

    Hi Sunil, this is not a programming forum so we can offer limited assistance. I'm not familiar with the API you referenced but to get your environment URL, Go to  admin.powerplatform.microsoft.com/environments and log into the Dynamics 365 Admin Center with your admin credentials. Select an environment and you will see an environment URL in the forum of orgXXX.crm.dynamics.com. Will that URL work for you?

  • Sunil Agrawal @ HCS Profile Picture
    5 on at

    Thanks Dave for your response.

    I followed the steps you mentioned and reached to the environment details page. But, there is no field for "Environment URL". It does have Environment ID though. But, I am looking for an "Environment URL".

    Would you please guide me further, or give me details for the programming forum to send my query?

  • DavePinch Profile Picture
    Microsoft Employee on at

    Once you have drilled into an environment, you should see a URL. Try clicking See All to see if that is listed.

    pastedimage1612573532536v1.png

    In the meantime for programming questions you may consider visiting the Power Apps community at Power Apps Community - Power Platform Community (microsoft.com), which has forums for working with CDS/DataVerse, etc. Alternately you can find AAD resources at Microsoft Q&A supported products | Microsoft Docs along with .NET, etc.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 51 Super User 2026 Season 1

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#3
Nagaraju_Matta Profile Picture

Nagaraju_Matta 50

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans