Azure Service Principals: How to Create (and Understand) Them

Adam Bertram
12 min readSep 9, 2020

Originally published at https://adamtheautomator.com by June Castillote on September 9, 2020

When you need to automate tasks in Azure with scripts and tools, would you consider using service accounts or Azure service principals? It is not uncommon for some to just create a new service account, slap it with all the admin roles you want, and exclude it from MFA.

I know what you’re thinking — “that is a horrible idea”. Of course, it is! And for sure, your IT Sec will give you a lot of grief if you did all that.

But what’s the alternative? How can you use a privileged credential with a limited scope that doesn’t have to be excluded from multi-factor authentication? You’re in luck because that’s what this article will teach you.

In this article, you’ll learn about what Azure Service Principal is. You’ll learn how to create service principals with different types of credentials, such as passwords, secret keys, and certificates.

There are many tools to create Azure Service Principals. These include using the Azure Portal, Azure Active Directory Admin Center, Azure AD PowerShell, Azure CLI, and Azure PowerShell. The tool that will be the focus of this article is the Azure PowerShell.

Still interested? Keep on reading and let’s get started!

Requirements

--

--

Adam Bertram

A 20-year veteran of IT, crypto geek, content creator, consultant and overall problem solver.