Skip to content
Skip to content
Menu
A cup of dev
  • Home
  • About
  • Ink and yarn
  • Contact
A cup of dev

How to register an application in Azure AD using Azure CLI

By Eli H. Schei on Wednesday, 18 August 2021, 19:00Friday, 27 August 2021, 7:48

If you are working as a M365 developer you probably have had to register an application in Azure AD at some point. In this blogpost I will show you how you can do so using Azure CLI.

Prerequesites:

You need to download and install Azure CLI.

Sign in to your tenant

When you have installed the Azure CLI you can sign in to your tenant. If you are on a dev-tenant or you don’t have a subscription to your account you should also add the “Allow-no-subscription” flag like shown below.

az login

//if you are on a dev-tenant or for some other reason don't have a subscription use the flag --allow-no-subscription
az login --allow-no-subscriptions

Add the app

When you have successfully signed in you can register a new app with a simple line.

az ad app create --display-name MyApp01 --available-to-other-tenants false

This will return a JSON object with the app information. I have shortened it down a bit in the example below.

{
  "acceptMappedClaims": null,
  "addIns": [],
  "allowGuestsSignIn": null,
  "allowPassthroughUsers": null,
  "appId": "ee26ecb3-977f-4520-ac21-be9eec424538",
 ...
  },
  ...
  ],
  "oauth2RequirePostResponse": false,
  "objectId": "301fc40c-a293-4509-8178-9d1b0fd76444",
  ...
  },
  ...
}

Two values that you should notice are the “appId, and the “objectId”. These values are often used when connecting to your registered app remotely. You can find the same information in the azure portal.

Screenshot of register an application in Azure AD via GUI. Application ID and Object ID are highlighted in yellow.

Resources

  • List of Azure CLI – Azure AD app commands (Microsoft docs)
  • Azure Command Line Interface documentation startpage (Microsoft docs)

Did you find this article usefull? Follow me on twitter to be notified when I publish something new!

Also, if you have any feedback or questions, please let me know in the comments below. šŸ™‚

Thank you for reading, and happy coding!

/Eli

Share this:

  • Twitter
  • Facebook

Post navigation

A beginners guide to web accessibility for developers. Part 5: Accessibility evaluation tools
My top 5 favorite newsletters to keep up with frontend development news

Leave a ReplyCancel reply

Eli H. Schei

I'm a front-end developer who mainly work in the Microsoft 365-sphere. As a developer I read a lot of blogs. And in my experience I can read multiple different blogposts about exactly the same topic, and only one of them makes sense to me. Therefore I’m adding my voice to the mix, and hopefully one of my blogposts will be the one that makes sense of a topic for you. You can learn more about me here.

Recent Posts

  • Give your app granular permissions to a specific site or list in SharePoint
  • Microsoft Graph Magic: Simplifying User Removal from teams in Microsoft Teams
  • How to leverage teams-js in your Teams app; Working with user context and SharePoint site context
  • Building a ‘My Tools’ Web Part for SharePoint: Using SPfx and PnPjs
  • My top 3 most read blogpost of 2023

Categories

  • Azure
    • Azure functions
  • Level
    • Beginner
    • Intermediate
  • Microsoft 365 Development
    • Microsoft Authentication Library
    • Microsoft Graph
    • Microsoft Teams
    • PNP powershell
    • PowerApps
      • PowerApps Component Framework
    • SharePoint Framework
    • SharePoint Online
  • Tech Lead
  • Web development
    • Accessibility
    • Soft skills
    • Tips and tricks

Tags

accessibility app permissions ARIA azure Azure CLI azure functions Content creation custom themes favorites git github M365 CLI M365 development MS Graph PCF PnPjs PnP powershell power apps PowerApps Component Framework quicktip react resources SharePoint Online Sideloading SPfx Teams teams app dev Teams apps Tech lead tools wcag webdev Windows terminal
©2025 A cup of dev | WordPress Theme by SuperbThemes.com