Git Product home page Git Product logo

aspnetcore-search-sample's Introduction

Use the Microsoft Search API to query data

This sample was added after the 30 Days of Microsoft Graph blog series and as such has limited documentation. The key points to note:

Prerequisites

  • Permissions required

    • Delegated (work or school account)
      • Mail.Read, Mail.ReadWrite, Calendars.Read, Calendars.ReadWrite, Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All, ExternalItem.Read.All
  • Visual Studio Code installed on your development machine. If you do not have Visual Studio Code, visit the previous link for download options. (Note: This tutorial was written with Visual Studio Code version 1.55.2. The steps in this guide may work with other versions, but that has not been tested.)

  • Visual Studio. (Note This tutorial was written with Visual Studio 2019. The steps in this guide may work with other versions, but that has not been tested.), when start installation, please:

    • Make sure you installed the ASP.NET & web development under the Web & Cloud
    • Make sure you installed .Net desktop development under the Desktop & Mobile
  • If you want to extend authentication, please refer the guides before or try to use this MSAL sample or go to Azure Document for getting auth helps. In this guide, please ensure you have a way to get a token for accessing graph endpoint. Try Graph Explorer and got a token from there. Screenshot of getting a token from graph explorer

  • Nodejs This tutorial was written with NodeJS version 14.15.4. Please click the link then install the nodeJS

Step 1: Start Backend

Double click day30Sample.sln under the backend/Csharp/day30Sample

Open Package Manager

Screenshot of opening package manager, type below and enter

dotnet restore

Run Project

Screenshot of running project

After starting the backend, you will see below and please keep the browser window.

Screenshot of backend demo

Step 2: Start Frontend

Open commandline on your PC

run command below:

npm install -g @angular/cli
  • Open Visual Studio Code, and import frontend project.
  • Screenshot of importing frontend project

Open a Terminal in Visual Studio Code

Screenshot of terminal

Run npm install in the terminal as below, it will take a little long time:

Screenshot of installing frontend

Run ng serve, start project

Screenshot of running frontend

After starting successfully, go http://localhost:4200, will see below:

Screenshot of frontend demo

Step 3: Try the demo

Set a token in welcome page, Graph Explorer and got a token from there.

Screenshot of getting a token from graph explorer

Screenshot of setting a token in welcome page

Click Search Button,

Screenshot of search result

aspnetcore-search-sample's People

Contributors

yiwenwang-ms avatar jasonjoh 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.