Create an Azure Application & SPN with Certificate Authentication
This PowerShell code snippet creates an Azure AD application registration with an associated SPN and self-signed certificate for Azure authentication.
I've used this for generating certificates that Virtual Machines can use for authenticating to Azure as an alternative to Managed Identities.