get tenant id and subscription id
az account show -o json | jq ".tenantId, .id"
create an application
az ad app create --display-name myapp --identifier-uris https://onexent.com --homepage https://onextent.com --password SECRET
create service principal
az ad sp create --id <APPID>
grant permission
az role assignment create --role "Owner" --assignee <UUID of servicePrincipalNames entry>
get client id
az ad app list -o json | jq '.[] | select(.displayName | contains("myapp")) | .appId'