Discover the URL for your organization
Effective November 2020:
- Common Data Service has been renamed to Microsoft Dataverse. Learn more
- Some terminology in Microsoft Dataverse has been updated. For example, entity is now table and field is now column. Learn more
This article will be updated soon to reflect the latest terminology.
You can create a client for a specific Microsoft Dataverse environment and not provide the user any options about which environment they can connect with. Only valid users for that specific environment can use your client.
If you want people using your client to be able to connect to any Dataverse environment they have access to you could prompt them to enter the URL for their environment, but this is not recommended. Each user may have access to multiple Dataverse environments. Users may not know or remember the URL for their environment. Expecting people to enter this URL is bound to frustrate users.
Instead, your client should provide a list of each of the available environments based on the user’s credentials. If there is more than one environment available, your application should prompt the user to choose which environment they want to connect with.
With Dataverse, server and organization allocation may change as part of datacenter management and load balancing. Therefore, a discovery service provides a way to discover which server is serving an instance at a given time.
When accessing the Discovery Service using the OData V4 RESTful API, you can add standard
$select parameters to the service request to customize the returned list of instance data.
- Effective March 2, 2020, the regional Discovery Service will be deprecated. Applications must use the global Discovery Service that is documented in this topic.
- For Dynamics 365 US Government users, a global Discovery Service endpoint is available for the GCC and GCC High users, and the URL is different from the regular global Discovery Service URL. More information: Dynamics 365 Government URLs.
Information provided by the Discovery Service
Organization information is stored in the
Instance entity of the Discovery Service. To see the kind of information contained in that entity, send an HTTP GET request to the service for one of your instances.
In the above example, the global Discovery Service is used to obtain the organization information of the instance with a unique name of "myorg". More details about this request is provided later in this topic.
Scope of the returned information
For the global Discovery Service, the
Instances entity set, returns the set of instances that the user has access to across all geographies, when no filters are applied. The returned data has a scope as described below.
- Includes all instances in the commercial cloud where the user is provisioned and enabled, except sovereign clouds instances are not returned
- Does not include instances where the user's account is disabled
- Does not include instances where users have been filtered out based on an instance security group
- Does not include instances where the user has access as a result of being a delegated administrator
- If the calling user has access to no instances, the response simply returns an empty list
How to access the Discovery Service
In general, the Web address of the Discovery Service has the following format:
<service base address>/api/discovery/. You can easily find the Web address and version number for your deployment in the Microsoft Dataverse Web application by navigating to Settings > Customization > Developer Resources
Dataverse Discovery services
The service base address of the global Discovery Service is :
https://globaldisco.crm.dynamics.com/. This results in the service address of
Using the Discovery service
An entity set named
Instances is used to obtain instance information. You can use
$filter with the Instances entity set to filter the returned data. You can also use
$metadata to obtain the metadata document of the service.
Accessing the Discovery Service requires authentication with an OAuth access token.
When the Discovery Service is configured for OAuth authentication, a request sent to the service without an access token triggers a bearer challenge with the authority of the “common” endpoint and the resource ID of the service.
The Discovery Service supports the CORS standard for cross-origin access. For more information about CORS support see Use OAuth with Cross-Origin Resource Sharing to connect a Single Page Application.
Get the details of a specific instance. If you leave out the GUID, all instances that the authenticated user has access to are returned.
You can use the UniqueName attribute as an alternate key.
Retrieve a list of available instances, filtered by production type.