Skip to content

Commit 1d5f30b

Browse files
committed
Merge branch 'main' into pnghub-patch-3
2 parents 7b2dcaa + 362d181 commit 1d5f30b

16 files changed

+161
-802
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "powerapps-docs/developer/data-platform/webapi/enhanced-quick-start.md",
5+
"redirect_url": "get-started-dynamics-365-web-api-csharp",
6+
"redirect_document_id": "false"
7+
},
8+
{
9+
"source_path": "powerapps-docs/developer/data-platform/webapi/start-web-api-project-visual-studio-csharp.md",
10+
"redirect_url": "get-started-dynamics-365-web-api-csharp",
11+
"redirect_document_id": "false"
12+
},
313
{
414
"source_path": "powerapps-docs/developer/data-platform/org-service/azure-storage-partitioning-sdk.md",
515
"redirect_url": "../elastic-tables",
Loading
Loading
Binary file not shown.

powerapps-docs/developer/data-platform/register-plug-in.md

Lines changed: 44 additions & 93 deletions
Large diffs are not rendered by default.

powerapps-docs/developer/data-platform/scalable-customization-design/database-transactions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ One of the most fundamental concepts behind many of the challenges faced here is
3131
A common reason that problems can occur in this area is the lack of awareness of how customizations can affect transactions.
3232

3333
Although the details of how this is done is beyond the scope of this topic, the most simple element to consider is that as Dataverse interacts with data in its database. SQL Server determines the appropriate locks to be taken by transactions on that data such as:
34-
- When retrieving a particular record, SQL Server takes a read lock on that record.
35-
- When retrieving a range of records, in some scenarios it can take a read lock on that range of records or the entire table.
3634
- When creating a record, it generates a write lock against that record.
3735
- When updating a record, it takes a write lock against the record.
3836
- When a lock is taken against a table or record, it’s also taken against any corresponding index records.

powerapps-docs/developer/data-platform/webapi/TOC.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
href: quick-start-console-app-csharp.md
1313
- name: 'Quick Start: Blazor Server sample (C#)'
1414
href: quick-start-blazor-server-app.md
15-
- name: Enhanced quick start (C#)
16-
href: enhanced-quick-start.md
17-
- name: Start Web API project in Visual Studio
18-
href: start-web-api-project-visual-studio-csharp.md
1915
- name: Web service authentication
2016
href: authenticate-web-api.md
2117
- name: Types and operations

powerapps-docs/developer/data-platform/webapi/enhanced-quick-start.md

Lines changed: 0 additions & 479 deletions
This file was deleted.
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Get started with Microsoft Dataverse Web API (C#) (Dataverse)| Microsoft Docs"
3-
description: "Learn how to access the Microsoft Dataverse Web API using the Microsoft Visual C# programming language"
4-
ms.date: 04/06/2022
2+
title: "Get started with Dataverse Web API (C#) (Dataverse)| Microsoft Docs"
3+
description: "Learn how to access the Dataverse Web API using the Microsoft Visual C# programming language."
4+
ms.date: 06/22/2023
55
author: divkamath
66
ms.author: dikamath
77
ms.reviewer: jdaly
@@ -10,21 +10,25 @@ search.audienceType:
1010
contributors:
1111
- JimDaly
1212
---
13-
# Get started with Microsoft Dataverse Web API (C#)
13+
# Get started with the Dataverse Web API (C#)
1414

15-
This section shows you how to access the Dataverse Web API using the C# programming language. The first topic, [Quick Start: Web API sample (C#)](quick-start-console-app-csharp.md), provides the quickest example of how to accomplish this, as all source code is simplified and provided in one file. The rest of this section shows you how to create and configure Visual Studio projects that use the Dataverse Web API to perform common business data operations.
16-
17-
After completing this guide, you will have learned enough to explore the many other business operations that are supported by the Dataverse Web API. You will also have a better understanding about how the [Web API Samples (C#)](web-api-samples-csharp.md) are structured.
15+
This section introduces some simple ways start accessing the Dataverse Web API using the C# programming language.
16+
17+
- [Quick Start: Web API sample (C#)](quick-start-console-app-csharp.md), provides the quickest example of how to access data, as all source code is simplified and provided in one file.
18+
- [Quickstart: Blazor Server Web API sample (C#)](quick-start-blazor-server-app.md) shows how to create a web application that can connect to Dataverse and retrieve data using the Web API.
19+
20+
21+
To learn more, please explore the [Web API Samples (C#)](web-api-samples-csharp.md).
1822

1923
## In this section
2024

21-
[Quick Start: Web API sample](quick-start-console-app-csharp.md) (Do this first)
22-
[Enhanced quick start](enhanced-quick-start.md) (Do this next)
23-
[Start a Dataverse Web API project in Visual Studio](start-web-api-project-visual-studio-csharp.md)
25+
[Quick Start: Web API sample](quick-start-console-app-csharp.md)
26+
[Quickstart: Blazor Server Web API sample (C#)](quick-start-blazor-server-app.md)
2427

2528
### See also
2629

27-
[Perform operations using the Web API](perform-operations-web-api.md)<br />
28-
[Web API Samples (C#)](web-api-samples-csharp.md)
30+
[Perform operations using the Web API](perform-operations-web-api.md)
31+
[Web API Samples (C#)](web-api-samples-csharp.md)
32+
[Set up a Postman environment](setup-postman-environment.md)
2933

3034
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

powerapps-docs/developer/data-platform/webapi/quick-start-blazor-server-app.md

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,93 +11,93 @@ search.audienceType:
1111
---
1212
# Quickstart: Blazor Server Web API sample (C#)
1313

14-
In this quickstart, you'll create a Blazor Server application to connect to your Microsoft Dataverse environment using the Web API.
14+
In this quickstart, you create a Blazor Server application to connect to your Microsoft Dataverse environment using the Web API.
1515

16-
You'll authenticate and use <xref:System.Net.Http.HttpClient> to send a `GET` request containing the [WhoAmI Function](xref:Microsoft.Dynamics.CRM.WhoAmI). The response will be a [WhoAmIResponse ComplexType ](xref:Microsoft.Dynamics.CRM.WhoAmIResponse). After call completion, the `WhoAmIResponse` properties are displayed.
16+
You authenticate and use <xref:System.Net.Http.HttpClient> to send a `GET` request containing the [WhoAmI Function](xref:Microsoft.Dynamics.CRM.WhoAmI). The response is a [WhoAmIResponse ComplexType ](xref:Microsoft.Dynamics.CRM.WhoAmIResponse). After call completion, the `WhoAmIResponse` properties are displayed.
1717

1818
> [!NOTE]
1919
> This is a very simple example to show how to get connected with a minimum of code.
2020
2121
## Prerequisites
2222

2323
- Visual Studio 2022 with the **ASP.NET and web development** workload.
24-
- [.NET 7.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
25-
- Familiarity with the Microsoft Azure portal
26-
- Internet connection
27-
- Valid user account for a Dataverse instance
28-
- Administrator access to grant application registrations
29-
- URL to the Dataverse environment you want to connect with
30-
- Basic understanding of the Visual C# language
24+
- [.NET 7.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0).
25+
- Familiarity with the Microsoft Azure portal.
26+
- Internet connection.
27+
- Valid user account for a Dataverse instance.
28+
- Administrator access to grant application registrations.
29+
- URL to the Dataverse environment you want to connect with.
30+
- Basic understanding of the Visual C# language.
3131

3232

3333
> [!NOTE]
3434
> To authenticate you must have an app registered in Azure Active Directory. The registration will happen automatically as part of the template creation, but will require additional updates in the Azure portal.
3535
3636
## Create a Visual Studio project
3737

38-
1. Open Visual Studio 2022 and click **Create a new project**.
38+
1. Open Visual Studio 2022 and select **Create a new project**.
3939

4040
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-1.png" alt-text="Open Visual Studio 2022":::
4141

42-
1. In the **Create a new project** dialog, search for *Blazor Server App*. Select the template and click **Next**.
42+
1. In the **Create a new project** dialog, search for *Blazor Server App*. Select the template and select **Next**.
4343

4444
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-2.png" alt-text="Create a new project":::
4545

46-
1. In the **Configure your new project** dialog, set the **Project name**, and **Location**. Then click **Next**.
46+
1. In the **Configure your new project** dialog, set the **Project name**, and **Location**. Then select **Next**.
4747

4848
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-2.5.png" alt-text="Enter project name and ___location":::
4949

50-
In this example we will use **DataverseWebApiBlazorServerQuickStart** as the **Project name**.
50+
In this example, we'll use **DataverseWebApiBlazorServerQuickStart** as the **Project name**.
5151

52-
1. In the **Additional information** dialog specify **Framework** and **Authentication type**.
52+
1. In the **Additional information** dialog, specify **Framework** and **Authentication type**.
5353

54-
In this example the Framework is **.NET 7.0 (Standard Term Support)**
54+
In this example, the Framework is **.NET 7.0 (Standard Term Support)**.
5555

5656
> [!IMPORTANT]
57-
> Set the **Authentication type** to **Microsoft identity platform**
57+
> Set the **Authentication type** to **Microsoft identity platform**.
5858
5959
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-3.png" alt-text="Set the Authentication type to Microsoft identity platform":::
6060

61-
1. Click **Create** to create the project.
62-
1. The project template opens a **Required components** dialog. Click **Next**.
61+
1. Select **Create** to create the project.
62+
1. The project template opens a **Required components** dialog. Select **Next**.
6363

6464
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-4.png" alt-text="Required components":::
6565

6666
1. In the **Microsoft identity platform** dialog, make sure that the selected Azure account has permissions to manage applications in Azure AD and the selected tenant is the one associated with your Power Platform environment.
6767

6868
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-5.png" alt-text="Microsoft identity platform dialog":::
6969

70-
1. Click **Create new**.
71-
1. In the **Register an application** dialog, set the **Display name** and click **Register** to close the dialog.
70+
1. Select **Create new**.
71+
1. In the **Register an application** dialog, set the **Display name** and select **Register** to close the dialog.
7272

7373
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-6.png" alt-text="Register an application":::
7474

75-
In this example we are using the name *Dataverse Web Api Blazor Server Quick Start*. We will search for the application using this name in a later step.
75+
In this example, we're using the name *Dataverse Web Api Blazor Server Quick Start*. We'll search for the application using this name in a later step.
7676

77-
1. Click **Next**.
77+
1. Select **Next**.
7878

7979
> [!NOTE]
8080
> You don't need to do anything in this step.
8181
82-
This step provides capabilities to connect to Microsoft Graph or another API, but this isn't necessary for this quickstart.
82+
This step provides capabilities to connect to Microsoft Graph or another API, but connecting to another API isn't necessary for this quickstart.
8383

8484
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-6.5.png" alt-text="Additional settings step.":::
8585

86-
1. Click **Next**. This step summarizes the changes that will be made to the project.
86+
1. Select **Next**. This step summarizes the changes that are made to the project.
8787

8888
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-6.6.png" alt-text="Summary of changes":::
8989

90-
1. Click **Finish**.
90+
1. Select **Finish**.
9191

9292
The **Dependency configuration progress** dialog shows the automated steps performed by the template to register the application.
9393

9494
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-7.png" alt-text="Dependency configuration progress":::
9595

96-
1. Click **Close** to close the dialog.
96+
1. Select **Close** to close the dialog.
9797

9898
## Configure the application in Active Directory
9999

100-
The Visual Studio template created a registered application using the information you provided. Connecting to Dataverse requires additional permissions.
100+
The Visual Studio template created a registered application using the information you provided. Connecting to Dataverse requires more permissions.
101101

102102
1. From the [Power Platform admin center](https://admin.powerplatform.microsoft.com/home), select the **Azure Active Directory** admin center.
103103

@@ -107,24 +107,24 @@ The Visual Studio template created a registered application using the informatio
107107

108108
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-9.png" alt-text="Search for the application registration":::
109109

110-
1. Open the application and select **API permissions**. Click **Add a permission**.
110+
1. Open the application and select **API permissions**. Select **Add a permission**.
111111

112112
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-10.png" alt-text="API permissions":::
113113

114114
1. In the **Request API permissions** fly-out, select the **APIs my organization uses** tab and search for *Dataverse*.
115115

116116
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-11.png" alt-text="search for Dataverse in APIs my organization uses":::
117117

118-
1. Select **Dataverse**, and **Dynamics CRM API** will open.
119-
1. Select the `user_impersonation` delegated permission and click **Add permissions**.
118+
1. Select **Dataverse**, and **Dynamics CRM API** opens.
119+
1. Select the `user_impersonation` delegated permission and select **Add permissions**.
120120

121121
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-12.png" alt-text="Add the user_impersonation delegated privilege":::
122122

123-
1. Select **Certificates & secrets** and click **New client secret**.
123+
1. Select **Certificates & secrets** and select **New client secret**.
124124

125125
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-13.png" alt-text="Certificates & secrets":::
126126

127-
1. In the **Add a client secret** fly-out, enter a **Description** and **Expires** duration, then click **Add**.
127+
1. In the **Add a client secret** fly-out, enter a **Description** and **Expires** duration, then select **Add**.
128128

129129
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-14.png" alt-text="Add a client secret":::
130130

@@ -157,17 +157,17 @@ The Visual Studio template created a registered application using the informatio
157157

158158
## Edit the app
159159

160-
To enable calls to Dataverse you must edit three files in the application:
160+
To enable calls to Dataverse, you must edit three files in the application:
161161

162162
- appsettings.json
163163
- Program.cs
164164
- Pages/FetchData.razor
165165

166166
### appsettings.json
167167

168-
There are several places in the other files that require a reference to the base uri used to access the Dataverse Web API. Adding this to the `appsettings.json` allows you to set this in one place.
168+
There are several places in the other files that require a reference to the base uri used to access the Dataverse Web API. Adding this data to the `appsettings.json` allows you to set this data in one place.
169169

170-
Add the following below `"AllowedHosts": "*"` where `<your org>` represents the base url to access the Dataverse Web API. If you are not sure what this is, see [Web API URL and versions](compose-http-requests-handle-errors.md#web-api-url-and-versions).
170+
Add the following below `"AllowedHosts": "*"` where `<your org>` represents the base url to access the Dataverse Web API. If you aren't sure what this is, see [Web API URL and versions](compose-http-requests-handle-errors.md#web-api-url-and-versions).
171171

172172
```json
173173
"AllowedHosts": "*",
@@ -204,14 +204,14 @@ Add the following below `"AllowedHosts": "*"` where `<your org>` represents the
204204
.EnableTokenAcquisitionToCallDownstreamApi(new string[] { $"{dataverseBaseUri}user_impersonation" })
205205
.AddInMemoryTokenCaches();
206206
```
207-
<!-- xref link was causing build errors -->
208-
- The [MicrosoftIdentityWebApiAuthenticationBuilder.EnableTokenAcquisitionToCallDownstreamApi Method](/dotnet/api/microsoft.identity.web.microsoftidentitywebapiauthenticationbuilder.enabletokenacquisitiontocalldownstreamapi) adds support for the web app to acquire tokens to call an API. By passing the `user_impersonation` scope, the user is can consent to the capability to use the Dataverse Web API.
207+
208+
- The [MicrosoftIdentityWebApiAuthenticationBuilder.EnableTokenAcquisitionToCallDownstreamApi Method](/dotnet/api/microsoft.identity.web.microsoftidentitywebapiauthenticationbuilder.enabletokenacquisitiontocalldownstreamapi) adds support for the web app to acquire tokens to call an API. By passing the `user_impersonation` scope, the user can consent to the capability to use the Dataverse Web API.
209209
- [AddInMemoryTokenCaches Method](xref:Microsoft.Identity.Web.MicrosoftIdentityAppCallsWebApiAuthenticationBuilder.AddInMemoryTokenCaches%2A) Enables caching the token issued for requests.
210210

211211

212212
### Pages/FetchData.razor
213213

214-
The default `Pages/FetchData.razor` component retrieves some weather forecast data. We are going to replace this completely.
214+
The default `Pages/FetchData.razor` component retrieves some weather forecast data. We're going to replace this completely.
215215

216216
Copy the following code and replace all the code in `Pages/FetchData.razor`:
217217

@@ -319,14 +319,14 @@ else
319319

320320
## Run the program
321321

322-
The application is now ready!
322+
The application is now ready.
323323

324324
1. Press F5 to run the program. The first time the program runs you should see this consent dialog:
325325

326326
:::image type="content" source="../media/quick-start-blazor-server-app-csharp-15.5.png" alt-text="Consent dialog":::
327327

328-
1. Click **Accept**.
329-
1. Click **Fetch data**.
328+
1. Select **Accept**.
329+
1. Select **Fetch data**.
330330

331331
The output should look like this:
332332

@@ -336,6 +336,13 @@ The application is now ready!
336336

337337
This quickstart shows a simple approach to create a Blazor Server web application that connects to data in Dataverse.
338338

339+
Learn more about Dataverse Web API capabilities by understanding the service documents.
340+
341+
> [!div class="nextstepaction"]
342+
> [Web API types and operations](web-api-types-operations.md)
343+
344+
345+
339346
### See Also
340347

341348
[Tutorial: Create an ASP.NET Core Blazor WebAssembly App using Dataverse](../walkthrough-blazor-webassembly-single-tenant.md)<br />

0 commit comments

Comments
 (0)