Beaches

There are beaches everywhere: on the sea, on the ocean, on the lake, on the river. Also on that ugly pit someone dug to get construction materials. Some of them are nice, some sandy, some crowded…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




The Perfect Weapon

Using Managed Identities in Azure Runbooks

How often have you discovered authentication data embedded directly in source code or an existing service account for software that was replaced in 2017? Managed identities provide a seamless way for applications to connect to resources that support Azure AD authentication. Applications can use managed identities to obtain Azure AD tokens without having to manage any credentials. They are rotated and managed automatically by Azure at no cost, with identity lifecycle management included.

There are two types of managed identities:

Step 1: Setup your prerequisites
Install Azure PowerShell if you don’t have it, and add these Modules (run PowerShell as admin):

Sign into your Azure subscription and create Resource Group:

Create Automation Account:

Create User Assigned Managed Identity:

Create Virtual Machine:

When you are done, your resource group will have these entities:

Toggle the system assigned managed identity on in your automation account:

Step 2: Assign Roles-now that our prerequisites are complete, we can give our managed identities the permissions they need to operate: In PowerShell, provide values for these variables:

Assign a new role to the system assigned managed identity:

Do the same for the user assigned managed identity:

And then add one more role for the system assigned managed identity:

Step 3: Create your runbook-
Now the magic starts-
In your automation account, select Process Automation>Runbooks>Create
Name the runbook miTesting (or whatever you like).
From the Runbook type drop-down, select PowerShell.
From the Runtime version drop-down, select either 7.1 (preview) or 5.1.
Enter an applicable description.

In your runbook console, put in this code (substitute your own value in line 8), code also included in the article:

Step 4: Save the runbook and then test it out in the test pane. You can try it as the user assigned managed identity and also as the system assigned managed identity.

Yay, your VM changes its state! But this isn’t all you can do. Common automation scenarios include log, database, and virtual machine management, as well as security and events management.

Add a comment

Related posts:

Succeeding in your first junior developer position

Everyone in tech knows right now is an exciting, and profitable time to be a developer. Whether you’re an aspiring software engineer or senior developer, you know that this moment in tech history is…

048.

seorang perempuan bernama evania gentari hari ini sedang berlamun didepan jendelanya. lamunannya hilang ketika ada notifikasi dari seorang laki laki. “tumben, tiba tiba banget deh sagara ini” kata…

You must visit Odeon of Herodes Atticus.

The Odeon of Herodes Atticus in Athens is one of the most significant and beautiful open-air theatres which is located in the Acropolis.