web
You’re offline. This is a read only version of the page.
close
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.         }  
I have the same question (0)
  • DavePinch Profile Picture
    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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans