How to easily get an authentication token to your Office 365 Tenant

I have been developing a backend service that requires a Microsoft Graph token passed up from the frontend. During this development, I have been using Postman to do the call, and have used a simple SPA with authentication to give me a token to my development tenant. This has been a pretty annoying way to do things when the token expires every half an hour or so, meaning I need to generate another.

Updating a SharePoint List Item's Content Type in the Microsoft Graph

The Microsoft Graph Documentation on how to update a SharePoint list item describes only how to update the fields. This is done by a PATCH call to: PATCH{site-id}/lists/{list-id}/items/{item-id}/fields { "{Field Name}": "{Value}" } Which will, in turn, return a set of fields that you may or may not have changed. But what if you want to change the content type? This is not a big ask, and there are plenty of situations where you want to.

Finding the Files location of Microsoft Teams Channel using the Microsoft Graph

You may have come across the Files tab for a channel in Microsoft Teams. This basically shows the contents of a folder inside a Document Library in a SharePoint Team Site, the one that is provisioned when the Team was first created. In that Files tab, you are able to open that location by clicking “Open in SharePoint” But, determining this location programmatically can be a bit tricky. You see; the Microsoft Graph Beta API has a call to find the list of channels in a Microsoft Team:

Using the Microsoft Graph to determine if an Office365 Group has an associated Microsoft Team

It is very easy to accidentally create an Office365 Group, for example by creating a new plan or creating new Team in Microsoft Teams; either of these (and I’m sure there are more ways) will provision an entire Office365 Group including mailbox, calendar, SharePoint team site and OneNote notebook. It doesn’t create a team unless you do it specifically in the Teams client. You can create an Office365 Group without an associated Team, but you cannot create a Team without an Office365 Group.

Serving your Angular CLI App Locally over HTTPS

When creating an Angular CLI app using the ng new command, the CLI itself will create some scripts in the packages.json relating to the building, testing, and local serving of your app. When running npm start it will subsequently run ng serve which by default runs the web server on localhost in HTTP (e.g. http://localhost:4200). This is all well and good for local debugging of a standalone app, but if you need to run this inside an iframe on a site running HTTPS (like an Office Add-in or even a VSTS Extension), this becomes a challenge as your local app needs to be served over HTTPS as well.

Using the Angular CLI and the Yeoman Generator to create an Office Add-in

UPDATE: Since this was written the office generator has been updated and does not work in the same way as below, specifically that it no longer asks to create a subfolder (for you to refuse) and does it anyway. If a folder already exists then it will fail and the instructions below are now useless. Although you can still do this manually it is no longer as simple. I am a big fan of the Angular CLI, it is just so easy to scaffold an Angular application from scratch, and get up and going quickly.