So this blog post merges both Azure Automation and SPNs for credentials together.

The difference being, you just need to add an additional Azure Automation Variable for the Azure Tenant ID. You’ll will need to set yourself up an SPN first using my script, then go ahead and setup an Azure Automation account as per this post.