You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This console application demonstrates how to make Delta Query calls to the Graph API, allowing applications to request only changed data from Microsoft Graph tenants.
16
-
17
-
The sample uses demonstates how graph calls can be made with the Graph SDK and how the reponses can be handled.
18
-
19
-
The specific example used in this sample involves monitoring changes(addition and removal) of MailFolders in an individual's email account.
20
-
21
-
## How To Run This Sample
22
-
23
-
To run this sample you will need:
24
-
- Visual Studio 2017
25
-
- An Internet connection
26
-
- An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, please see [How to get an Azure AD tenant](https://azure.microsoft.com/en-us/documentation/articles/active-directory-howto-tenant/)
### Step 2: Register the sample application with your Azure Active Directory tenant
35
-
36
-
There is one project in this sample. To register it, you can:
37
-
38
-
- either follow the steps [Step 2: Register the sample with your Azure Active Directory tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Azure AD tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
39
-
- or use PowerShell scripts that:
40
-
-**automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you
41
-
- modify the Visual Studio projects' configuration files.
42
-
43
-
If you want to use this automation:
44
-
45
-
1. On Windows run PowerShell and navigate to the root of the cloned directory
46
-
1. In PowerShell run:
47
-
48
-
```PowerShell
49
-
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
50
-
```
51
-
52
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordinly.
53
-
54
-
```PowerShell
55
-
.\AppCreationScripts\Configure.ps1
56
-
```
57
-
58
-
> Other ways of running the scripts are described in [App Creation Scripts](./AppCreationScripts/AppCreationScripts.md)
59
-
60
-
1. Open the Visual Studio solution and click start
61
-
62
-
If you don't want to use this automation, follow the steps below
63
-
64
-
#### Choose the Azure AD tenant where you want to create your applications
65
-
66
-
As a first step you'll need to:
67
-
68
-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
69
-
1. If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant
70
-
(using **Switch Directory**).
71
-
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations (Preview)**.
72
-
73
-
#### Register the client app (ConsoleApp-DeltaQuery-DotNet)
74
-
75
-
1. In **App registrations (Preview)** page, select **Register an Application**.
76
-
1. When the **Register an application page** appears, enter your application's registration information:
77
-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `ConsoleApp-DeltaQuery-DotNet`.
78
-
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
79
-
- Select **Register** to create the application.
80
-
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project.
81
-
1. In the list of pages for the app, select **Authentication**
82
-
- In the *Suggested Redirect URIs for public clients(mobile,desktop)*, check the second box so that the app can work with the MSAL libs used in the application. (The box should contain the option *urn:ietf:wg:oauth:2.0:oob*).
83
-
1. In the list of pages for the app, select **API permissions**
84
-
- Click the **Add a permission** button and then,
85
-
- Ensure that the **Microsoft APIs** tab is selected
86
-
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
87
-
- In the **Delegated permissions** section, ensure that the right permissions are checked: **Mail.Read**. Use the search box if necessary.
88
-
- Select the **Add permissions** button
89
-
90
-
### Step 3: Configure the sample to use your Azure AD tenant
91
-
92
-
In the steps below, "ClientID" is the same as "Application ID" or "AppId".
93
-
94
-
Open the solution in Visual Studio to configure the projects
95
-
96
-
#### Configure the client project
97
-
98
-
1. In the *ConsoleApplication* folder, rename the `appsettings.json.example` file to `appsettings.json`
99
-
1. Open and edit the `appsettings.json` file to make the following change
100
-
1. Find the line where `ClientId` is set as `YOUR_CLIENT_ID_HERE` and replace the existing value with the application ID (clientId) of the `ConsoleApp-DeltaQuery-DotNet` application copied from the Azure portal.
101
-
102
-
Clean the solution, rebuild the solution, and start it in the debugger.
103
-
104
-
## Contributing
105
-
106
-
If you'd like to contribute to this sample, see [CONTRIBUTING.MD](/CONTRIBUTING.md).
107
-
108
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
109
-
110
-
## Questions and comments
111
-
112
-
We'd love to get your feedback about the Microsoft Graph Webhooks sample using WebJobs SDK. You can send your questions and suggestions to us in the [Issues](https://github.com/microsoftgraph/ConsoleApp-DeltaQuery-DotNet/issues) section of this repository.
113
-
114
-
Questions about Microsoft Graph in general should be posted to [Stack Overflow](https://stackoverflow.com/questions/tagged/MicrosoftGraph). Make sure that your questions or comments are tagged with *[MicrosoftGraph]*.
115
-
116
-
If you have a feature suggestion, please post your idea on our [User Voice](https://officespdev.uservoice.com/) page, and vote for your suggestions there.
-[Call Microsoft Graph in an ASP.NET MVC app](https://developer.microsoft.com/en-us/graph/docs/platform/aspnetmvc)
124
-
-[MSAL.NET](https://aka.ms/msal-net)
125
-
126
-
Copyright (c) 2019 Microsoft Corporation. All rights reserved.
13
+
# ConsoleApp-MicrosoftGraphAPI-DeltaQuery-DotNet
14
+
15
+
This console application demonstrates how to make Delta Query calls to the Graph API, allowing applications to request only changed data from Microsoft Graph tenants.
16
+
17
+
The sample uses demonstates how graph calls can be made with the Graph SDK and how the reponses can be handled.
18
+
19
+
The specific example used in this sample involves monitoring changes(addition and removal) of MailFolders in an individual's email account.
20
+
21
+
## How To Run This Sample
22
+
23
+
To run this sample you will need:
24
+
- Visual Studio 2017
25
+
- An Internet connection
26
+
- An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, please see [How to get an Azure AD tenant](https://azure.microsoft.com/en-us/documentation/articles/active-directory-howto-tenant/)
### Step 2: Register the sample application with your Azure Active Directory tenant
35
+
36
+
There is one project in this sample. To register it, you can:
37
+
38
+
- either follow the steps [Step 2: Register the sample with your Azure Active Directory tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Azure AD tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
39
+
- or use PowerShell scripts that:
40
+
-**automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you
41
+
- modify the Visual Studio projects' configuration files.
42
+
43
+
If you want to use this automation:
44
+
45
+
1. On Windows run PowerShell and navigate to the root of the cloned directory
46
+
1. In PowerShell run:
47
+
48
+
```PowerShell
49
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
50
+
```
51
+
52
+
1. Run the script to create your Azure AD application and configure the code of the sample application accordinly.
53
+
54
+
```PowerShell
55
+
.\AppCreationScripts\Configure.ps1
56
+
```
57
+
58
+
> Other ways of running the scripts are described in [App Creation Scripts](./AppCreationScripts/AppCreationScripts.md)
59
+
60
+
1. Open the Visual Studio solution and click start
61
+
62
+
If you don't want to use this automation, follow the steps below
63
+
64
+
#### Choose the Azure AD tenant where you want to create your applications
65
+
66
+
As a first step you'll need to:
67
+
68
+
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
69
+
1. If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant
70
+
(using **Switch Directory**).
71
+
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations (Preview)**.
72
+
73
+
#### Register the client app (ConsoleApp-DeltaQuery-DotNet)
74
+
75
+
1. In **App registrations (Preview)** page, select **Register an Application**.
76
+
1. When the **Register an application page** appears, enter your application's registration information:
77
+
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `ConsoleApp-DeltaQuery-DotNet`.
78
+
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
79
+
- Select **Register** to create the application.
80
+
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project.
81
+
1. In the list of pages for the app, select **Authentication**
82
+
- In the *Suggested Redirect URIs for public clients(mobile,desktop)*, check the second box so that the app can work with the MSAL libs used in the application. (The box should contain the option *urn:ietf:wg:oauth:2.0:oob*).
83
+
1. In the list of pages for the app, select **API permissions**
84
+
- Click the **Add a permission** button and then,
85
+
- Ensure that the **Microsoft APIs** tab is selected
86
+
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
87
+
- In the **Delegated permissions** section, ensure that the right permissions are checked: **Mail.Read**. Use the search box if necessary.
88
+
- Select the **Add permissions** button
89
+
90
+
### Step 3: Configure the sample to use your Azure AD tenant
91
+
92
+
In the steps below, "ClientID" is the same as "Application ID" or "AppId".
93
+
94
+
Open the solution in Visual Studio to configure the projects
95
+
96
+
#### Configure the client project
97
+
98
+
1. In the *ConsoleApplication* folder, rename the `appsettings.json.example` file to `appsettings.json`
99
+
1. Open and edit the `appsettings.json` file to make the following change
100
+
1. Find the line where `ClientId` is set as `YOUR_CLIENT_ID_HERE` and replace the existing value with the application ID (clientId) of the `ConsoleApp-DeltaQuery-DotNet` application copied from the Azure portal.
101
+
102
+
Clean the solution, rebuild the solution, and start it in the debugger.
103
+
104
+
## Contributing
105
+
106
+
If you'd like to contribute to this sample, see [CONTRIBUTING.MD](/CONTRIBUTING.md).
107
+
108
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
109
+
110
+
## Questions and comments
111
+
112
+
We'd love to get your feedback about the Microsoft Graph Webhooks sample using WebJobs SDK. You can send your questions and suggestions to us in the [Issues](https://github.com/microsoftgraph/ConsoleApp-DeltaQuery-DotNet/issues) section of this repository.
113
+
114
+
Questions about Microsoft Graph in general should be posted to [Stack Overflow](https://stackoverflow.com/questions/tagged/MicrosoftGraph). Make sure that your questions or comments are tagged with *[MicrosoftGraph]*.
115
+
116
+
If you have a feature suggestion, please post your idea on our [User Voice](https://officespdev.uservoice.com/) page, and vote for your suggestions there.
0 commit comments