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...
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.         }  
  • DavePinch Profile Picture
    DavePinch on at
    RE: How to get "Resource URL" of my Dynamics 365 domain?

    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.

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

    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
    DavePinch on at
    RE: How to get "Resource URL" of my Dynamics 365 domain?

    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?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

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,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans