Azure SPNs (Service Principal Names) – PowerShell

Using Azure SPNs is a massive benefit more so for the pure fact that it creates a specific user account in Azure (like a service account) which you can use to automate PowerShell scripts against Azure subscriptions for specific tasks. You don’t need to worry about whether the account needed is a Microsoft account, which you know that you can’t automate an Azure logon with PowerShell using a Microsoft account. You can however create an SPN and use this instead. The other benefit, you’re using a task based account.

The SPN is created on the tenant (Directory) which can essentially have access to one or many Azure subscriptions when used.

The other benefit to using SPNs is the fact that once you logon using an SPN (instructions below), you will have access to both Azure ASM (Classic) based Azure modules and Azure ARM based Azure modules.

Azure PowerShell modules can be accessed from here.

Manual SPN Logon:

To logon to Azure using PowerShell and an Azure SPN, the following will allow you to logon on manually using the SPN you created above.

Automatic SPN Logon:

To logon to Azure using PowerShell and an Azure SPN, the following will allow you to logon on automatically using the SPN you created above.

Azure PowerShell

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: