Skip to content

Commit 26695a8

Browse files
authored
Merge pull request #2292 from MicrosoftDocs/master
Pushing changes live
2 parents db62bf0 + 60b48ea commit 26695a8

40 files changed

+790
-118
lines changed
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
---
2-
title: "Discovery Services (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3-
description: "Common Data Service Discovery service is accessed through either the Web API or the Organization Service."
2+
title: "Discovery Service (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3+
description: "Learn about access to the Discovery Service for discovering business organization instance details."
44
ms.custom: ""
5-
ms.date: 10/31/2018
6-
ms.reviewer: ""
5+
ms.date: 1/16/2019
6+
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
99
author: "JimDaly" # GitHub ID
1010
ms.author: "jdaly" # MSFT alias of Microsoft employees only
11-
manager: "ryjones" # MSFT alias of manager or PM counterpart
11+
manager: "kvivek" # MSFT alias of manager or PM counterpart
1212
search.audienceType:
1313
- developer
1414
search.app:
1515
- PowerApps
1616
- D365CE
1717
---
18-
# Discovery Services
18+
# Discovery Service
1919

2020
[!INCLUDE [cc-discovery-service-description](includes/cc-discovery-service-description.md)]
2121

22+
The Discovery Service is accessed through two different APIs:
2223

23-
A Discovery service is accessed through either the Web API or the Organization Service.
24+
- For the OData V4 RESTful API: [Discover the URL for your organization](webapi/discover-url-organization-web-api.md)
25+
- For the discovery API available through the 2011 (SOAP) endpoint: [Use the Discovery Service with the Microsoft.Xrm.Sdk.Discovery NameSpace](org-service/discovery-service.md)
2426

25-
- For the Web API: [Discover the URL for your organization using the Web API](webapi/discover-url-organization-web-api.md)
26-
- For the Organization Service: [Use the Discovery Service with the Microsoft.Xrm.Sdk.Discovery NameSpace](org-service/discovery-service.md)
27+
> [!NOTE]
28+
> The *regional* Discovery Service is deprecated. More information: [Important changes (deprecations)](/power-platform/important-changes-coming.md).
2729
2830
### See Also
2931

3032
[Use the Common Data Service Web API](webapi/overview.md)<br />
31-
[Use the Common Data Service Organization Service](org-service/overview.md)
33+
[Modify your code to use global Discovery Service](webapi/discovery-orgsdk-to-webapi.md)

powerapps-docs/developer/common-data-service/org-service/discovery-service.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: "Use the Discovery Service with the SDK Assemblies (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3-
description: "Describes how to use the discovery service with the .NET SDK assemblies." # 115-145 characters including spaces. This abstract displays in the search result.
3+
description: "Describes how to use the Discovery Service with the APIs available in the SDK assemblies." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/31/2018
6-
ms.reviewer: ""
5+
ms.date: 1/16/2020
6+
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
99
author: "JimDaly" # GitHub ID
1010
ms.author: "jdaly" # MSFT alias of Microsoft employees only
11-
manager: "ryjones" # MSFT alias of manager or PM counterpart
11+
manager: "kvivek" # MSFT alias of manager or PM counterpart
1212
search.audienceType:
1313
- developer
1414
search.app:
@@ -17,10 +17,14 @@ search.app:
1717
---
1818
# Use the Discovery Service with the SDK Assemblies
1919

20-
[!INCLUDE [cc-discovery-service-description](../includes/cc-discovery-service-description.md)]
20+
> [!IMPORTANT]
21+
> Effective March 2, 2020, the *regional* Discovery Service will be [deprecated](/power-platform/important-changes-coming#regional-discovery-service-is-deprecated).
22+
>
23+
> For information on how to transition to use the *global* Discovery Service, see [Modify your code to use global Discovery Service](../webapi/discovery-orgsdk-to-webapi.md).
2124
25+
[!INCLUDE [cc-discovery-service-description](../includes/cc-discovery-service-description.md)]
2226

23-
To use the discovery service using the SDK assemblies, add a reference to the `Microsoft.Xrm.Sdk.dll` assembly to your Visual Studio project, and then add a `using` statement to access the <xref:Microsoft.Xrm.Sdk.Discovery> namespace.
27+
To access the Discovery Service using the SDK assembly APIs, add a reference to the `Microsoft.Xrm.Sdk.dll` assembly in your Visual Studio project, and then add a `using` statement to access the <xref:Microsoft.Xrm.Sdk.Discovery> namespace.
2428

2529
The <xref:Microsoft.Xrm.Sdk.WebServiceClient.DiscoveryWebProxyClient> implements the <xref:Microsoft.Xrm.Sdk.Discovery.IDiscoveryService> interface.
2630

@@ -33,7 +37,7 @@ When you instantiate the <xref:Microsoft.Xrm.Sdk.WebServiceClient.DiscoveryWebPr
3337
[!INCLUDE [regional-discovery-services](../../../includes/regional-discovery-services.md)]
3438

3539
> [!NOTE]
36-
> If you do not know the user's region, you need to loop through the available regions until you get results. The Web API provides a single global discovery service. More information: [Discover the URL for your organization using the Web API](../webapi/discover-url-organization-web-api.md)
40+
> If you do not know the user's region, you need to loop through the available regions until you get results. A single global Discovery Service is also available. More information: [Discover the URL for your organization](../webapi/discover-url-organization-web-api.md)
3741
3842
## Discovery service messages
3943

@@ -160,4 +164,4 @@ Endpoints:
160164
### See also
161165

162166
[Discovery Services](../discovery-service.md)<br />
163-
[Discover the URL for your organization using the Web API](../webapi/discover-url-organization-web-api.md)
167+
[Discover the URL for your organization](../webapi/discover-url-organization-web-api.md)

powerapps-docs/developer/common-data-service/webapi/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
items:
8181
- name: Get started
8282
href: discover-url-organization-web-api.md
83+
- name: Modify your code to use global Discovery Service
84+
href: discovery-orgsdk-to-webapi.md
8385
- name: Global Discovery Service Sample (C#)
8486
href: samples/global-discovery-service-csharp.md
8587
- name: Web API versions and limitations
Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: "Discover the URL for your organization using the Web API (Common Data Service)| Microsoft Docs"
3-
description: "Learn how you can use the Web API to discover at runtime the organizations, or instances that the logged-on user belongs to"
2+
title: "Discover the URL for your organization (Common Data Service)| Microsoft Docs"
3+
description: "Use the Discovery Service to find the organizations (instances) that the logged-on user belongs to"
44
ms.custom: ""
5-
ms.date: 04/22/2019
5+
ms.date: 1/16/2020
66
ms.service: powerapps
77
ms.suite: ""
88
ms.tgt_pltfrm: ""
@@ -14,81 +14,72 @@ caps.latest.revision: 18
1414
author: "JimDaly" # GitHub ID
1515
ms.author: "jdaly"
1616
ms.reviewer: "susikka"
17-
manager: "annbe"
17+
manager: "kvivek"
1818
search.audienceType:
1919
- developer
2020
search.app:
2121
- PowerApps
2222
- D365CE
2323
---
24-
# Discover the URL for your organization using the Web API
24+
# Discover the URL for your organization
2525

2626
[!INCLUDE [cc-discovery-service-description](../includes/cc-discovery-service-description.md)]
2727

28-
With the Web API discovery service, you can use standard `$filter` and `$select` parameters to a Web API service request to customize the returned list of instance data.
29-
<!-- TODO should only talk about the global discovery service -->
28+
When accessing the Discovery Service using the OData V4 RESTful API, you can add standard `$filter` and `$select` parameters to the service request to customize the returned list of instance data.
3029

31-
## Global Discovery service
32-
33-
In addition to datacenter specific Discovery services, that are available on the 2011 (SOAP) endpoint and through the Web API, there is also a Web API only Global Discovery service that spans all operational datacenters. For more information about the Discovery service on the 2011 endpoint see [Discovery Service](../org-service/discovery-service.md)
34-
35-
> [!NOTE]
36-
> It is recommended that users switch from the legacy regional discovery service (`https://disco.crm.dynamics.com`) to global discovery service (`https://globaldisco.crm.dynamics.com`).
37-
>
38-
> For Dynamics 365 US Government users, the global discovery service 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](https://docs.microsoft.com/dynamics365/customer-engagement/admin/government/microsoft-dynamics-365-government#dynamics-365-us-government-urls).
30+
> [!IMPORTANT]
31+
> - Effective March 2, 2020, the *regional* Discovery Service will be [deprecated](/power-platform/important-changes-coming#regional-discovery-service-is-deprecated). Applications must use the global Discovery Service that is documented in this topic.
32+
> - 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](https://docs.microsoft.com/dynamics365/customer-engagement/admin/government/microsoft-dynamics-365-government#dynamics-365-us-government-urls).
3933
4034

41-
## Information provided by the Discovery service
35+
## Information provided by the Discovery Service
4236

43-
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.
37+
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.
4438

4539
```http
4640
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances(UniqueName='myorg')
4741
```
4842

49-
In the above example, the global Discovery service of Common Data Service is used to obtain the organization information of the instance with a unique name of "myorg". More details about this request is expanded upon later in this topic.
43+
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.
5044

51-
52-
53-
5445
### Scope of the returned information
5546

56-
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.
47+
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.
5748

5849
- Includes all instances in the commercial cloud where the user is provisioned and enabled, except sovereign clouds instances are not returned
5950
- Does not include instances where the user's account is disabled
6051
- Does not include instances where users have been filtered out based on an instance security group
6152
- Does not include instances where the user has access as a result of being a delegated administrator
6253
- If the calling user has access to no instances, the response simply returns an empty list
6354

64-
## How to access the Discovery services
55+
## How to access the Discovery Service
6556

66-
In general, the Web API address of the Discovery service has the following format: `<service base address>/api/discovery/`. The addresses for each deployment type are identified below. You can easily find the Web API addresses and version number for your deployment in the Common Data Service web application by navigating to **Settings > Customization > Developer Resources**
57+
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 Common Data Service Web application by navigating to **Settings > Customization > Developer Resources**
6758

6859
### Common Data Service Discovery services
6960

70-
The service base address of the global Discovery service is : `https://globaldisco.crm.dynamics.com/`. This results in the service address of `https://globaldisco.crm.dynamics.com/api/discovery/`.
61+
The service base address of the global Discovery Service is : `https://globaldisco.crm.dynamics.com/`. This results in the service address of `https://globaldisco.crm.dynamics.com/api/discovery/`.
7162

7263
## Using the Discovery service
7364

7465
An entity set named `Instances` is used to obtain instance information. You can use `$select` and `$filter` with the Instances entity set to filter the returned data. You can also use `$metadata` to obtain the metadata document of the service.
7566

7667
### Authentication
7768

78-
Common Data Service Web API instances of the Discovery service require authentication with OAuth access tokens.
69+
Accessing the Discovery Service requires authentication with an OAuth access token.
70+
71+
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.
7972

80-
When the Discovery service is configured for OAuth authentication, a request sent to the service Web API without an access token triggers a bearer challenge with the authority of the “common” endpoint and the resource ID of the service.
8173
### CORS support
8274

83-
The Discovery service Web API supports the CORS standard for cross-origin access as does the Web API. For more information about CORS support see [Use OAuth with Cross-Origin Resource Sharing to connect a Single Page Application](../oauth-cross-origin-resource-sharing-connect-single-page-application.md).
75+
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](../oauth-cross-origin-resource-sharing-connect-single-page-application.md).
8476

8577
### Examples
8678

8779
- Get the details of a specific instance. If you leave out the GUID, all instances that the authenticated user has access to are returned.
8880

8981
```http
9082
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances(<guid>)
91-
GET https://disco.crm.dynamics.com/api/discovery/v9.0/Instances(<guid>)
9283
```
9384
9485
- You can use the UniqueName attribute as an alternate key.
@@ -103,13 +94,7 @@ The Discovery service Web API supports the CORS standard for cross-origin access
10394
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances?$select=DisplayName,Description&$filter=Type+eq+0
10495
```
10596
106-
- Retrieve a specific instance's ID property value.
107-
108-
```http
109-
GET https://disco.crm.dynamics.com/api/discovery/v9.0/Instances(UniqueName='myorg')/Id/$value
110-
```
111-
11297
## See also
11398
114-
[Web API Global Discovery Service sample (C#)](samples/global-discovery-service-csharp.md)
99+
[Discovery Service sample (C#)](samples/global-discovery-service-csharp.md)
115100
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: "Modify your code to use global Discovery Service (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3+
description: "Update your application code to make Discovery Service calls using a modern RESTful API."
4+
ms.custom: ""
5+
ms.date: 1/16/2020
6+
ms.reviewer: "pehecke"
7+
ms.service: powerapps
8+
ms.topic: "article"
9+
author: "bpevans" # GitHub ID
10+
ms.author: "bevans" # MSFT alias of Microsoft employees only
11+
manager: "kvivek" # MSFT alias of manager or PM counterpart
12+
search.audienceType:
13+
- developer
14+
search.app:
15+
- PowerApps
16+
- D365CE
17+
---
18+
19+
# Modify your code to use global Discovery Service
20+
21+
The Discovery Service APIs can be used by your application to discover business organization instances that the application user has access to. If your application currently uses the Organization Service API on the 2011 SOAP endpoint to discover organization instances, you can follow the steps in this topic and convert your application to access organization details using the OData V4 RESTful API with the global Discovery Service URL. If your application accesses the Discovery Service using the regional Discovery Service URL, you will need to change the application code from using the regional URL to the global Discovery Service URL.
22+
23+
A detailed description of using the Discovery Service with the RESTful API can be found on the [Discover the URL for your organization](/powerapps/developer/common-data-service/webapi/discover-url-organization-web-api) page.
24+
25+
> [!IMPORTANT]
26+
> When accessing the Discovery Service, it is strongly recommended that your application use the *global* Discovery Service endpoint (https://globaldisco.crm.dynamics.com) and not the *regional* Discovery Service endpoint, which is [deprecated](/power-platform/important-changes-coming#regional-discovery-service-is-deprecated). The global Discovery Service is only available when using the RESTful API.
27+
28+
The rest of this document describes the changes that may be needed to call the Discovery Service using the RESTful API.
29+
30+
## Authentication
31+
Accessing the Discovery Service using the RESTful API requires authentication with an OAuth 2.0 access token.
32+
If your application code uses WS-Trust SAML tokens for authentication, you need to change your application code to acquire an OAuth 2.0 token from Azure Active Directory (AD), and then add that token in the Authorization header of the Discovery Service API calls. More information: [Use OAuth with Common Data Service](../authenticate-oauth.md).
33+
34+
## OData API calls
35+
The example HTTP requests shown below are supported by the Discovery Service RESTful API. These examples use the Instances API to return the same organization data as the <xref:Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationsRequest> and <xref:Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationRequest> message requests of the Organization Service API.
36+
37+
- Get all instances for the user in all regions.
38+
```http
39+
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances
40+
```
41+
- Get all instances for the user in a specific region.
42+
```http
43+
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances(Region={region})
44+
```
45+
Response
46+
```javascript
47+
{
48+
"value":[
49+
{
50+
"Id":"<GUID>",
51+
"UniqueName":"myorg",
52+
"UrlName":"orgurlname",
53+
"FriendlyName":"My Org",
54+
"State":0,
55+
"Version":"<Version>",
56+
"Url":"https://orgurlname.crm.dynamics.com",
57+
"ApiUrl":"https://orgurlname.api.crm.dynamics.com"
58+
}
59+
]
60+
}
61+
```
62+
63+
- Get a single instance by ID
64+
```http
65+
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances(<guid>)
66+
```
67+
- Get a single instance by unique name
68+
```http
69+
GET https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances(UniqueName='myorg')
70+
```
71+
72+
Response
73+
```javascript
74+
{
75+
"Id":"<GUID>",
76+
"UniqueName":"myorg",
77+
"UrlName":"orgurlname",
78+
"FriendlyName":"My Org",
79+
"State":0,
80+
"Version":"<Version>",
81+
"Url":"https://orgurlname.crm.dynamics.com",
82+
"ApiUrl":"https://orgurlname.api.crm.dynamics.com"
83+
}
84+
```
85+
86+
## Mapping of fields
87+
The table shown below shows the field mapping in the responses returned from the Discovery Service when using the two APIs. These are applicable to all above example calls.
88+
89+
Response field (SOAP endpoint) | Response field (OData V4 RESTful endpoint)
90+
------------------------------------|---------------------------------
91+
Endpoints[WebApplication] | Url
92+
Endpoints[OrganizationService] | {ApiUrl}/XRMServices/2011/Organization.svc
93+
Endpoints[OrganizationDataService] |{ApiUrl}//XRMServices/2011/OrganizationData.svc
94+
FriendlyName|FriendlyName
95+
OrganizationId|Id
96+
OrganizationVersion|Version
97+
State | State<br/><ul><li>0: Enabled</li><li>1: Disabled</li><ul>
98+
UniqueName|UniqueName
99+
UrlName|UrlName
100+
101+
## Deprecated API call
102+
The Organization Service API message GetUserIdByExternalId is not supported in the RESTful API.
103+
104+
## See Also
105+
[Discovery Services](/powerapps/developer/common-data-service/discovery-service)
106+
107+
[Use the Common Data Service Web API](/powerapps/developer/common-data-service/webapi/discover-url-organization-web-api)

0 commit comments

Comments
 (0)