
This article was written in 2022. Versions, tools and recommendations may have changed since then. Newer posts are collected under Azure.
There are now an insane number of ways to register applications in Azure Active Directory - but many ways are no longer supported or have been discontinued, for example the old Azure PowerShell tools.
However, new tools - for example PowerShell Az - do not support all features, are not well documented or do not behave as expected. In addition, for months there has been a bug in PowerShell that makes the tooling installation take up to 60 minutes! Powershell Gallery slowness: Install-Module -Name Az takes 60 minutes instead of 3
However, one way is still stable and working: the Azure CLI.
Install Azure CLI
Using WinGet:
winget install -e --id Microsoft.AzureCLIUsing Chocolatey:
choco install azure-cliManual Install: Azure CLI Docs
Login
Login into your Azure Account from CLI:
az loginor use device code login to use a custom browser window (e.g. multi account feature of your browser):
az login --use-device-codeSelect a subscription
az account set --subscription $subscriptionIdCreate Azure App Registration
When creating the app, it is important to consider what type of app is desired. By default, certain parameters always refer to a web app, e.g. Reply URLs. If a SPA is desired, an update must also take place after the creation!
Create WebApp
1$uri = "https://ba-sample-webapp.azurewebsites.net/"
2$appName = "Benjamin Abt Sample WebApp"
3$appHomepage = "https://ba-sample-webapp.azurewebsites.net/"
4$appReplyUrls = @("https://ba-sample-webapp.azurewebsites.net/",
5 "https://ba-sample-webapp.azurewebsites.net/logout/")
6
7Write-Host "Web App Creating.."
8$app = az ad app create --display-name $appName `
9 --homepage $appHomepage `
10 --reply-urls $appReplyUrls `
11 | ConvertFrom-Json
12Write-Host "Web App $($app.appId) Created."Create SPA App
1$uri = "https://ba-sample-webapp.azurewebsites.net/"
2$appName = "Benjamin Abt Sample WebApp"
3$appHomepage = "https://ba-sample-webapp.azurewebsites.net/"
4$appReplyUrls = @("https://ba-sample-webapp.azurewebsites.net/",
5 "https://ba-sample-webapp.azurewebsites.net/logout/")
6
7Write-Host "SPA App Creating.."
8$app = az ad app create --display-name $appName `
9 --homepage $appHomepage `
10 | ConvertFrom-Json
11Write-Host "SPA App $($app.appId) Created."
12
13Write-Host "SPA App Updating.."
14# there is no CLI support to add reply urls to a SPA, so we have to patch manually via az rest
15$appPatchUri = "https://graph.microsoft.com/v1.0/applications/{0}" -f $app.objectId
16$appReplyUrlsString = "'{0}'" -f ($appReplyUrls -join "','")
17$appPatchBody = "{spa:{redirectUris:[$appReplyUrlsString]}}"
18az rest --method PATCH --uri $appPatchUri --headers 'Content-Type=application/json' `
19 --body $appPatchBody
20Write-Host "SPA App Updated."Docs
Conclusion:
It is still very simple and fast to create Azure AD App Registrations, however it is just not well documented.
Related articles

- 17 min read
Automatic TTL in Azure Cosmos DB with .NET
Temporary data is easy to create and surprisingly difficult to remove reliably. Sessions, idempotency keys, import buffers, transient …

- 8 min read
Run Hono on Azure Static Web Apps: managed Functions APIs for static frontends
Azure Static Web Apps is primarily a host for static frontend assets, but it can also deploy a small HTTP API alongside the frontend. That …

- 14 min read
Run Hono on Azure: Container Apps, Functions, App Service and AKS compared
Hono is often associated with Cloudflare Workers and for good reason. Its small routing model, Web Standard API surface and direct fetch …
Let's Work Together
Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.
