Monday, October 5, 2015

O365 Dev Challenges - Part 8 – Troubleshooting and tips

The most important tip I can give out is that you should not test the app against a tenant which you don’t have admin access to until you know that it works the way you want. The reason is that if you have to change the permissions needed or are changing URL’s of the web app itself, then you won’t be able to remove the app registration. Removing app registrations require admin permissions in AAD.

Cleaning up App registrations

When creating a lot of sample applications, you might end up with multiple App registrations and Azure resources. App registrations can easily be cleaned up using PowerShell.
If you have admin access you can download the Azure Active Directory Module for Windows PowerShell (64-bit version) package and once opened you first connect to your tenant with

Connect-MsolService

You can list all add-in registrations with

Get-MsolServicePrincipal

and you remove entries with

Remove-MsolServicePrincipal -AppPrincipalId <your app id>

Every time you remove an add-in registration you will be prompted to consent to the add-ins permission request the next time you access it. Very useful for testing.

Cleaning up Azure Resources

Azure resources can be cleaned up from the old and new Azure management portals.


By removing a resource group, you will also automatically remove all artifacts associated with that group.

image