FY18P20Labs

View the Project on GitHub

Become a Graph Explorer

This lab will walk you through setting up your own local copy of the Graph Explorer.

Prerequisites

Cloning Graph Explorer

From a Command Prompt:

  1. Create a new directory at the root of C:\ to hold our clone of the repository:

     MKDIR c:\mw-labs\
    
  2. Switch to our new directory:

     CD c:\mw-labs\
    
  3. Clone the Graph Explorer repository from GitHub:

     git clone https://github.com/microsoftgraph/microsoft-graph-explorer.git
    
  4. Switch to our cloned image:

     CD microsoft-graph-explorer\
    
  5. Rename secrets.sample.js to secrets.js:

     RENAME secrets.sample.js  secrets.js
    
  6. Open secrets.js in Notepad:

     NOTEPAD secrets.js
    

Register an Application

  1. Open https://apps.dev.microsoft.com.

  2. Sign in using your personal Microsoft Account.

  3. Select Add an App from the My applications section.

  4. For Application Name enter Graph Explorer - <your alias>.

  5. Uncheck Guided Setup and click Create.

  6. Under Platforms select the Add Platform button.

  7. Select Web as the Platform type.

  8. Enter http://localhost:3000 under Redirect URLs.

  9. Click Save

  10. Copy the Application Id to your clipboard

  11. Switch to the secrets.js file you previously opened in Notepad

  12. Paste your copies Application Id into the window.ClientId and Save the file

Build & Run Explorer

  1. Return to your Command Prompt

  2. Download requested packaged from npm:

     npm install
    

    This process will take a minute or two. You can ignore any warnings.

  3. Start Graph Explorer using npm:

     npm start
    

    At this point a browser will open automatically and open http://localhost:3000

Try some Samples

When the Explorer opens it will default to a demo tenant and query of https://graph.microsoft.com/v1.0/me/. Click Run Query to execute and receive this JSON result:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
    "businessPhones": [
        "+1 412 555 0109"
    ],
    "displayName": "Megan Bowen",
    "givenName": "Megan",
    "jobTitle": "Auditor",
    "mail": "MeganB@M365x214355.onmicrosoft.com",
    "mobilePhone": null,
    "officeLocation": "12/1110",
    "preferredLanguage": "en-US",
    "surname": "Bowen",
    "userPrincipalName": "MeganB@M365x214355.onmicrosoft.com"
}

View Profile Photo

Teams & Groups