GithubHelp home page GithubHelp logo

ankitk20 / consoleapp-deltaquery-dotnet-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftgraph/msgraph-sample-deltaquery

0.0 0.0 0.0 90 KB

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.

License: MIT License

PowerShell 33.56% C# 66.44%

consoleapp-deltaquery-dotnet-sample's Introduction

page_type products languages extensions
sample
ms-graph
csharp
contentType technologies createdDate
samples
Microsoft Graph
5/25/2017 5:03:53 PM

ConsoleApp-MicrosoftGraphAPI-DeltaQuery-DotNet

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.

The sample uses demonstates how graph calls can be made with the Graph SDK and how the reponses can be handled.

The specific example used in this sample involves monitoring changes(addition and removal) of MailFolders in an individual's email account.

How To Run This Sample

To run this sample you will need:

  • Visual Studio 2017
  • An Internet connection
  • 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

Step 1: Clone or download this repository

From your shell or command line:

git clone https://github.com/microsoftgraph/ConsoleApp-DeltaQuery-DotNet

Step 2: Register the sample application with your Azure Active Directory tenant

There is one project in this sample. To register it, you can:

If you want to use this automation:

  1. On Windows run PowerShell and navigate to the root of the cloned directory

  2. In PowerShell run:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
  3. Run the script to create your Azure AD application and configure the code of the sample application accordinly.

    .\AppCreationScripts\Configure.ps1

    Other ways of running the scripts are described in App Creation Scripts

  4. Open the Visual Studio solution and click start

If you don't want to use this automation, follow the steps below

Choose the Azure AD tenant where you want to create your applications

As a first step you'll need to:

  1. Sign in to the Azure portal using either a work or school account or a personal Microsoft account.
  2. 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 (using Switch Directory).
  3. In the left-hand navigation pane, select the Azure Active Directory service, and then select App registrations (Preview).

Register the client app (ConsoleApp-DeltaQuery-DotNet)

  1. In App registrations (Preview) page, select Register an Application.
  2. When the Register an application page appears, enter your application's registration information:
    • In the Name section, enter a meaningful application name that will be displayed to users of the app, for example ConsoleApp-DeltaQuery-DotNet.
    • In the Supported account types section, select Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com).
    • Select Register to create the application.
  3. 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.
  4. In the list of pages for the app, select Authentication
    • 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).
  5. In the list of pages for the app, select API permissions
    • Click the Add a permission button and then,
    • Ensure that the Microsoft APIs tab is selected
    • In the Commonly used Microsoft APIs section, click on Microsoft Graph
    • In the Delegated permissions section, ensure that the right permissions are checked: Mail.Read. Use the search box if necessary.
    • Select the Add permissions button

Step 3: Configure the sample to use your Azure AD tenant

In the steps below, "ClientID" is the same as "Application ID" or "AppId".

Open the solution in Visual Studio to configure the projects

Configure the client project

  1. In the ConsoleApplication folder, rename the appsettings.json.example file to appsettings.json
  2. Open and edit the appsettings.json file to make the following change
    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.

Clean the solution, rebuild the solution, and start it in the debugger.

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.MD.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Questions and comments

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 section of this repository.

Questions about Microsoft Graph in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [MicrosoftGraph].

If you have a feature suggestion, please post your idea on our User Voice page, and vote for your suggestions there.

Additional resources

Copyright (c) 2019 Microsoft Corporation. All rights reserved.

consoleapp-deltaquery-dotnet-sample's People

Contributors

andrueastman avatar darrelmiller avatar jasonjoh avatar madhumitadange avatar nokafor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.