<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: TeamCloudSkills</title>
    <description>The latest articles on Forem by TeamCloudSkills (@teamcloudskills).</description>
    <link>https://forem.com/teamcloudskills</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F572055%2Fbb05ec00-67ba-475b-9be0-be840eb735d7.png</url>
      <title>Forem: TeamCloudSkills</title>
      <link>https://forem.com/teamcloudskills</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/teamcloudskills"/>
    <language>en</language>
    <item>
      <title>The Beginners Guide to Running Docker Containers on AWS</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Sat, 06 Mar 2021 18:50:05 +0000</pubDate>
      <link>https://forem.com/cloudskills/the-beginners-guide-to-running-docker-containers-on-aws-2m7n</link>
      <guid>https://forem.com/cloudskills/the-beginners-guide-to-running-docker-containers-on-aws-2m7n</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/lO2wU2rcGUw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Learning the basics of AWS and Docker containers?&lt;/p&gt;

&lt;p&gt;In this episode, we explain the basics of Docker and how to run containers on AWS.&lt;/p&gt;

&lt;p&gt;This a one-hour project focused tutorial from our AWS Certified Solutions Architect training.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>techtalks</category>
    </item>
    <item>
      <title>AWS Quick Tip: Working with EC2 and IAM Roles</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Sat, 06 Mar 2021 18:40:12 +0000</pubDate>
      <link>https://forem.com/cloudskills/aws-quick-tip-working-with-ec2-and-iam-roles-4gdc</link>
      <guid>https://forem.com/cloudskills/aws-quick-tip-working-with-ec2-and-iam-roles-4gdc</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/lNzfPp2UYio"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Allowing your applications to access cloud services on your behalf can sometimes be tricky. In AWS, you can take advantage of IAM roles to make this a lot easier.&lt;/p&gt;

&lt;p&gt;Working with IAM roles and delegating service access to applications is a core concept when it comes to dealing with AWS.&lt;/p&gt;

&lt;p&gt;In this AWS Quick Tip, CloudSkills Author Michael Levan explains how this works. &lt;/p&gt;

</description>
      <category>aws</category>
    </item>
    <item>
      <title>AKS Virtual Nodes with Chad Crowell</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Sat, 06 Mar 2021 18:37:41 +0000</pubDate>
      <link>https://forem.com/cloudskills/aks-virtual-nodes-with-chad-crowell-2jkf</link>
      <guid>https://forem.com/cloudskills/aks-virtual-nodes-with-chad-crowell-2jkf</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Mn56W-D-A-0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Working with Azure Kubernetes Service (AKS)?&lt;/p&gt;

&lt;p&gt;If you're in Azure and planning to work with Kubernetes, definitely check out how to SCALE virtual nodes and get your billing under control.&lt;/p&gt;

&lt;p&gt;This 13 minute YouTube video is by CloudSkills Author Chad Crowell.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Packer and Terraform with Immutable Infrastructure</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 15:00:32 +0000</pubDate>
      <link>https://forem.com/cloudskills/packer-and-terraform-with-immutable-infrastructure-47ja</link>
      <guid>https://forem.com/cloudskills/packer-and-terraform-with-immutable-infrastructure-47ja</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/w0gv-Tw6698"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Terraform is red hot right now, and you probably know that it's an open-source Infrastructure as Code (IaC) solution.&lt;/p&gt;

&lt;p&gt;OK, but what is Packer?&lt;/p&gt;

&lt;p&gt;Well, Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. It's lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel.&lt;/p&gt;

&lt;p&gt;In this CloudSkills Community Call replay,  Luke Orellana shows you how to get started with Packer, Terraform, and Immutable Infrastructure.&lt;/p&gt;

&lt;p&gt;Resources from this episode:&lt;/p&gt;

&lt;p&gt;HashiCorp Learn:&lt;br&gt;
&lt;a href="https://learn.hashicorp.com/terraform"&gt;https://learn.hashicorp.com/terraform&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introduction to Packer&lt;br&gt;
&lt;a href="https://www.packer.io/intro"&gt;https://www.packer.io/intro&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Learning Application Security with Tanya Janca</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 12:10:54 +0000</pubDate>
      <link>https://forem.com/cloudskills/learning-application-security-with-tanya-janca-4ki7</link>
      <guid>https://forem.com/cloudskills/learning-application-security-with-tanya-janca-4ki7</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3t4tXDBVQM4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Tanya Janca, who was on the podcast last year, is back! Since the last time we talked, she’s been very busy founding her own company, We Hack Purple. Tanya’s an expert on App Security, and through her company, she’s sharing those skills with online on-demand courses.&lt;/p&gt;

&lt;p&gt;In this episode, we talk about…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tanya’s new community centered around her online academy, which has been a positive and kind space for discussing related topics.&lt;/li&gt;
&lt;li&gt;Why, if you’re a software developer, you should learn about app security and have a strategy to talk to management to get what you want and legitimize your job.&lt;/li&gt;
&lt;li&gt;Tanya’s book and how she teaches each lesson within it several different ways to make it accessible for various learning styles.&lt;/li&gt;
&lt;li&gt;Tanya’s current free mini-course offering about scaling your security program and security team.&lt;/li&gt;
&lt;li&gt;The best career advice Tanya has ever gotten.&lt;/li&gt;
&lt;li&gt;The importance of mentors in everyone’s careers and why it’s very important to build a community.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Resources from this episode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow Tanya on &lt;a href="https://twitter.com/shehackspurple"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Check out the &lt;a href="https://store.wehackpurple.com/"&gt;We Hack Purple Academy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Read Tanya's new book: &lt;a href="https://www.amazon.com/Alice-Bob-Learn-Application-Security/dp/1119687357"&gt;Alice and Bob Learn Application Security&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join the &lt;a href="https://newsletter.wehackpurple.com/"&gt;We Hack Purple Newsletter&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
    </item>
    <item>
      <title>Azure Automation: Managing Runbook Authentication and Modules</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 11:16:28 +0000</pubDate>
      <link>https://forem.com/cloudskills/azure-automation-managing-runbook-authentication-and-modules-4bd2</link>
      <guid>https://forem.com/cloudskills/azure-automation-managing-runbook-authentication-and-modules-4bd2</guid>
      <description>&lt;p&gt;In my previous post, we took a look at &lt;a href="https://cloudskills.io/blog/azure-automation-runbook"&gt;creating your first Azure Automation PowerShell runbook&lt;/a&gt;. We set up the Azure Automation account, authored a PowerShell runbook, and incorporated parameters and variable assets. The next step is to understand how we can access and manage Azure resources from our runbooks.&lt;/p&gt;

&lt;p&gt;In this guide, you will learn how Azure Automation can authenticate and access Azure resources. We will also take a look at importing PowerShell modules to add cmdlets to our runbooks. When you're finished, you'll have the skills to elevate your runbooks to the next level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin this guide, you'll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure tenant and subscription&lt;/li&gt;
&lt;li&gt;Administrator account with sufficient permissions on a subscription, such as Owner, or a role containing Microsoft.Automation resource authorization&lt;/li&gt;
&lt;li&gt;PowerShell knowledge&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Azure Automation Run As Account
&lt;/h2&gt;

&lt;p&gt;When I created the Azure Automation account in the first article, I enabled the option &lt;a href="https://cloudskills.io/blog/azure-automation-runbook#create-an-azure-automation-account"&gt;to create an Azure Run As account&lt;/a&gt;. By enabling this option, Azure will automatically create an Azure AD application. You can use this application identity to authenticate to an Azure subscription to access and manage resources. During the Run As account creation, Azure performs several other functions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding a self-signed certificate to the application account.&lt;/li&gt;
&lt;li&gt;Creating a service principal identity for the application.&lt;/li&gt;
&lt;li&gt;Assigning the &lt;strong&gt;Contributor&lt;/strong&gt; role for the account in the current subscription.&lt;/li&gt;
&lt;li&gt;Creating Automation connection assets named &lt;strong&gt;AzureRunAsCertificate&lt;/strong&gt; and &lt;strong&gt;AzureRunAsConnection&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to view more information about the Run As account, from the Automation Account resource page, navigate to &lt;strong&gt;Account Settings &amp;gt; Run as accounts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--opYOhQmv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yohirx566xvpc15c3iwq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--opYOhQmv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yohirx566xvpc15c3iwq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can view the account's properties in the portal, including the certificate thumbprint, the Azure AD application information, service principal ID, role assignments, and runbooks utilizing the account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--isRydeN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nf2l67s2r4dikyc5xoa3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--isRydeN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nf2l67s2r4dikyc5xoa3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the top of the properties page, note an action named &lt;strong&gt;Renew Certificate&lt;/strong&gt;. The account's certificate is only valid for one year, so be sure to renew before expiration to keep your runbooks from failing.&lt;/p&gt;

&lt;p&gt;Along with the Run As account, Azure will create two connection assets: &lt;strong&gt;AzureRunAsCertificate&lt;/strong&gt; and &lt;strong&gt;AzureRunAsConnection&lt;/strong&gt;. The certificate asset authenticates to Azure so the runbook can manage Azure Resource Manager resources. The connection asset contains the application ID, tenant ID, subscription ID, and certificate thumbprint. Basically, everything you need to connect to Azure to start managing resources! In an upcoming example, I'll use this connection to connect to Azure and to retrieve some resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automation Account Modules
&lt;/h2&gt;

&lt;p&gt;Before I create a new runbook to manage my Azure resources, I need to make sure I have the right PowerShell commands available. When you create a new Automation Account, Azure will automatically import some PowerShell modules for you, such as AzureRM.Automation, AzureRM.Computer, and AzureRM.Resources. However, these modules are a part of the older AzureRM PowerShell module, which Microsoft is no longer developing. Microsoft has replaced this module with the newer Az PowerShell module.&lt;/p&gt;

&lt;p&gt;Luckily, I'm not stuck using the older modules in my PowerShell runbooks. I can import the new Az modules into the Automation Account for use with my PowerShell code. From the Automation Account, navigate to &lt;strong&gt;Shared Resources &amp;gt; Modules gallery&lt;/strong&gt;. The first module I need to import is the &lt;em&gt;Az.Accounts&lt;/em&gt; module so I can use the &lt;em&gt;Connect-AzAccount&lt;/em&gt; cmdlet in my runbook. Search for "Az.Accounts", then select the resulting module.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2EL8o6i2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tnn6cv9tlsmeyyl4ws8c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2EL8o6i2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tnn6cv9tlsmeyyl4ws8c.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the module page, I can search the module for the cmdlets and functions to verify it has what I need. From here, I can select the &lt;strong&gt;Import&lt;/strong&gt; action at the top. Once the import is successful, I need to navigate the &lt;strong&gt;Modules gallery&lt;/strong&gt; and perform the same steps for the &lt;em&gt;Az.Resources&lt;/em&gt; module so I can use the &lt;em&gt;Get-AzResourceGroup&lt;/em&gt; in my runbook.&lt;/p&gt;

&lt;p&gt;The imports can take a few minutes, but you can verify the status by navigating back to &lt;strong&gt;Shared Resources &amp;gt; Modules&lt;/strong&gt;. In this list of modules, verify the module import progress in the &lt;strong&gt;Status&lt;/strong&gt; column. From this &lt;strong&gt;Modules&lt;/strong&gt; page, also note there are options to import a custom module. Select the &lt;strong&gt;+ Add a module&lt;/strong&gt; and choose a .zip file that contains the module code. Note that the module code's file name must match the file name of the zip file. Importing custom written module is a fantastic feature of Azure Automation that allows you to write a runbook to fit any scenario.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect to Azure from PowerShell Runbook
&lt;/h2&gt;

&lt;p&gt;Back in the Automation Account, I will create a new runbook that will connect to Azure and retrieve my resource groups. In the Automation Account, navigate to &lt;strong&gt;Process Automation &amp;gt; Runbooks&lt;/strong&gt;, then select &lt;strong&gt;+ Create a runbook&lt;/strong&gt;. From here, input a name for the runbook, select the PowerShell runbook type, then select &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Edit PowerShell Runbook&lt;/strong&gt; window, I need to write code that will retrieve the information stored in &lt;strong&gt;AzureRunAsConnection&lt;/strong&gt;. For this, I use the &lt;em&gt;Get-AutomationConnection&lt;/em&gt; cmdlet and specify the name of the Run As connection. If I store the connection information to a variable, I can reference the tenant ID, application ID, and certificate thumbprint in the &lt;em&gt;Connect-AzAccount&lt;/em&gt; cmdlet to authenticate to my Azure tenant.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$connection&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-AutomationConnection&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AzureRunAsConnection&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Connect-AzAccount&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ServicePrincipal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;-Tenant&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$connection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TenantID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;-ApplicationId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$connection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ApplicationID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;-CertificateThumbprint&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$connection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CertificateThumbprint&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you do not remember the cmdlet to retrieve the Run As connection asset, remember you can expand &lt;em&gt;Assets&lt;/em&gt; on the left to view saved connections and other assets. Selecting &lt;em&gt;Add to canvas&lt;/em&gt; will insert the necessary PowerShell code.&lt;/p&gt;

&lt;p&gt;Once the runbook connects, I can now use other Az cmdlets to work with Azure resources. Since I imported the &lt;em&gt;Az.Resources&lt;/em&gt; module, I can retrieve all my resource groups using the &lt;em&gt;Get-AzResourceGroup&lt;/em&gt; cmdlet. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eB8kqUB3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nrbem9o06kz1bujhjixc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eB8kqUB3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nrbem9o06kz1bujhjixc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here, I will save the runbook code, publish, and then execute it. When I view the runbook job status, the &lt;strong&gt;Output&lt;/strong&gt; tab will show the runbook successfully authenticating to Azure. It will then start displaying my resource groups.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V4o6lLpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a3fvfg6bwho7n0k75s7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V4o6lLpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a3fvfg6bwho7n0k75s7m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Retrieving resource groups is only the beginning of what is possible. Imagine what other tasks you could automate within a runbook, such as taking snapshots of virtual machine disks, turning off virtual machines, or automatically resizing resources based on a schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Runbook Authentication without Run As Accounts
&lt;/h2&gt;

&lt;p&gt;You might be asking, "If I don't create a Run As account with the Automation Account, how can I authenticate to Azure?". There are a few options for managing authentication in this scenario, which I outline in the following sections. Remember, if you choose not to use the built-in Run As account, you will need to ensure that whichever account used has permissions to the Azure resources the script is trying to access. The built-in Run As account accomplishes this by being a Contributor at the subscription level, but you may want to apply more granular permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the Run As Account
&lt;/h3&gt;

&lt;p&gt;I can still enable the Run As account after the Automation Account has been created. In the account, navigate to &lt;strong&gt;Account Settings &amp;gt; Run as accounts&lt;/strong&gt;. Previously in this screen, we viewed the existing account, but I can also create one if it doesn't exist already. No additional inputs or settings are needed to set up the account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oulDmORF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d7bq3ett2o7czkghxdia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oulDmORF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d7bq3ett2o7czkghxdia.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Service Principal
&lt;/h3&gt;

&lt;p&gt;Applications use a service principal to access resources secured by Azure AD. The service principle represents the application inside the tenant, and you can assign it permissions to resources (just like a user account).&lt;/p&gt;

&lt;p&gt;To create a service principal, navigate to Azure Active Directory in the Azure portal. In the &lt;strong&gt;Manage&lt;/strong&gt; section, select &lt;strong&gt;App registrations&lt;/strong&gt;. Select &lt;strong&gt;+ New registration&lt;/strong&gt;, then input the application's name, support account type (for now, leave at the default), and redirect URI (this can be blank).&lt;/p&gt;

&lt;p&gt;After you create the app registration, on the &lt;strong&gt;Overview&lt;/strong&gt; page, take note of the application ID and tenant ID. You will need this information later to create a new connection or credentials asset (see following sections). In the &lt;strong&gt;Manage&lt;/strong&gt; section, you can navigate to &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt; to upload a certificate or generate a secret (essentially a password for the account). You can then use either of these to authenticate out to Azure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a New Connection Asset
&lt;/h3&gt;

&lt;p&gt;You can create your own connection asset that includes an ApplicationId, TenantId, Certificate Thumbprint, and Subscription Id. If you created a service principal in the previous section, you could use it for this purpose.&lt;/p&gt;

&lt;p&gt;Create a connection asset in the Automation Account by navigating to &lt;strong&gt;Shared Resources &amp;gt; Connections&lt;/strong&gt;, then select &lt;strong&gt;+ Add a connection&lt;/strong&gt;. Give a name to the connection asset, select &lt;em&gt;AzureServicePrincipal&lt;/em&gt; as the type, and enter the required information from the service principal. Once the connection is created, I can use it just like the &lt;em&gt;AzureRunAsConnection&lt;/em&gt; asset in my PowerShell code from earlier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Credentials Asset
&lt;/h3&gt;

&lt;p&gt;Finally, you can store security credentials as a shared resource. The credentials asset includes a username and password, and you can use these on cmdlets that accept a PSCredential object. In the Automation Account, navigate to &lt;strong&gt;Shared Resources &amp;gt; Credentials&lt;/strong&gt; and select &lt;strong&gt;+ Add a credential&lt;/strong&gt;. Name the credential and enter the username and password.&lt;/p&gt;

&lt;p&gt;Once you create the asset, you can retrieve the credentials using &lt;em&gt;Get-AutomationPSCredential&lt;/em&gt; and store it in a variable. You then pass the credentials to the &lt;strong&gt;Connect-AzAccount&lt;/strong&gt; cmdlet, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$creds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-AutomationPSCredential&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'{CredentialAssetName}'&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Connect-AzAccount&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Credentials&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$creds&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget, you can use the Asset explorer on the left to input the correct code and asset name into your script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post, you learned how to configure authentication so your runbooks can access Azure resources. Being able to authenticate to Azure without storing usernames and passwords in the runbook code is a security best practice. Now that you can connect to Azure, start thinking about what tasks you can automate using runbooks. You will need to be sure to import any modules required by your code.&lt;/p&gt;

&lt;p&gt;Check back soon for my next post on Azure Automation where I will show how to configure a hybrid worker so you can execute a runbook anywhere.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Jeff Brown&lt;/strong&gt; is a Systems Engineer and Cloud Administrator with over a decade of experience in server and application administration. In his career, he has managed a wide range of technologies including Windows Server, Exchange Server, Skype for Business, Azure, and Microsoft 365. Jeff enjoys writing about technology topics and creating content for the community. You can find more of his content over at &lt;a href="https://jeffbrown.tech/"&gt;jeffbrown.tech&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
    </item>
    <item>
      <title>Azure Automation: Creating a PowerShell Runbook</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 11:08:50 +0000</pubDate>
      <link>https://forem.com/cloudskills/azure-automation-creating-a-powershell-runbook-fn8</link>
      <guid>https://forem.com/cloudskills/azure-automation-creating-a-powershell-runbook-fn8</guid>
      <description>&lt;p&gt;Azure Automation is a cloud-based automation and configuration service that you can use for process automation through runbooks. You can author runbooks using a graphical interface or in PowerShell or Python programming languages. Think of these runbooks as replacing scripts you have scheduled to run on a server. &lt;/p&gt;

&lt;p&gt;In this guide, you will set up an Azure Automation Account and deploy your first PowerShell runbook. When you're finished, you will have the necessary skills to get started deploying runbooks in your Azure tenant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin this guide, you'll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure tenant and subscription&lt;/li&gt;
&lt;li&gt;Administrator account with sufficient permissions on a subscription, such as Owner or Contributor&lt;/li&gt;
&lt;li&gt;PowerShell knowledge&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create an Azure Automation Account
&lt;/h2&gt;

&lt;p&gt;Before creating your first runbook, you need to create an Azure Automation Account. This account is responsible for executing runbooks and authenticating to Azure resources required by the runbook. The account groups together Automation resources, runbooks, and configuration settings. You can create multiple accounts to separate their functionality, such as accounts for development and production.&lt;/p&gt;

&lt;p&gt;To get started creating your first Azure Automation Account, log into the Azure portal at &lt;a href="https://portal.azure.com"&gt;https://portal.azure.com&lt;/a&gt;. In the Search bar, enter Azure Automation, and select Automation Accounts from the results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ikmj3oWk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/srostou7qzd7yaz7utkj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ikmj3oWk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/srostou7qzd7yaz7utkj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here on the Automation Accounts resource page, you can view and manage any existing Automation Accounts. Click on &lt;strong&gt;+ Add&lt;/strong&gt; to create your Automation Account. In the &lt;strong&gt;Add Automation Account&lt;/strong&gt; page, you need to define some information for your account:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: Enter a descriptive name for the account. Following Microsoft recommendations, I will name mine based on the resource type, its purpose, environment, Azure region, and instance. For example, aa-cloudskills-prod-westus-001.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscription&lt;/strong&gt;: Select a valid Azure subscription.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Group&lt;/strong&gt;: Select an existing resource group or create a new one. For this demo, I am creating a new resource group named &lt;em&gt;azacct-rg&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Location&lt;/strong&gt;: Select a location to host the Automation Account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create Azure Run As account&lt;/strong&gt;: Enabling this option will automatically create an Azure Run As account for authenticating to other Azure resources. For now, configure this to &lt;strong&gt;Yes&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6KOvB1rk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/scoop4m2s46le7m0ttjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6KOvB1rk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/scoop4m2s46le7m0ttjc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have entered the account information, click on &lt;strong&gt;Create&lt;/strong&gt;. Once Azure creates the account successfully, select the account in the Automation Account list (this may require a refresh before it appears).&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a PowerShell Runbook
&lt;/h2&gt;

&lt;p&gt;Now that the Automation Account has been created, you can author the runbook that hosts your PowerShell code. Using the left menu in the Automation Account resource, scroll down to &lt;strong&gt;Process Automation&lt;/strong&gt; and select &lt;strong&gt;Runbooks&lt;/strong&gt;. Here you will see some examples of each type of runbook you can create: Graphical, Python, and PowerShell. You can view each of these runbooks to learn how to perform different actions in runbooks, such as using variables or connecting to Azure resources. You can also import a runbook or browse the PowerShell Gallery and Azure Automation GitHub organization for resources created by Microsoft and the community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tsrp-ZiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jiwnw9donvjrfppseuk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tsrp-ZiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jiwnw9donvjrfppseuk5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get started creating a runbook by selecting &lt;strong&gt;Create a runbook&lt;/strong&gt;. In the form, enter a runbook name, select the runbook type, and enter a description. This demo is using a PowerShell runbook type. Once you have entered all the runbook information, select the &lt;strong&gt;Create&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dVhDiiMO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v4nskiczopsj7b5hy8l1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dVhDiiMO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v4nskiczopsj7b5hy8l1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After Azure creates the runbook, it should redirect you to the &lt;strong&gt;Edit PowerShell Runbook&lt;/strong&gt; page. This page is where you can enter in the PowerShell code that the Automation Account executes. The menu actions include the ability to save the runbook, publish a new version of the runbook, revert to a previously published version, or run a test of the runbook. On the left, you can view the modules and cmdlets available to use in the runbook, import references to other runbooks, or view assets that you can use in the script, such as variables or certificates for authentication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mLOGQC8C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sx1fdyb9sgsh6mvfd2ng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mLOGQC8C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sx1fdyb9sgsh6mvfd2ng.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this runbook, I am keeping the code simple and displaying the phrase "Hello, Azure Runbooks!" to the console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="s2"&gt;"Hello, Azure Runbooks!"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have entered the code, select the &lt;strong&gt;Save&lt;/strong&gt; button, then the &lt;strong&gt;Publish&lt;/strong&gt; button. You will receive a warning that publishing the runbook will override the existing published version. Select &lt;strong&gt;Yes&lt;/strong&gt; to this prompt. Once the runbook is successfully published, the Azure portal will redirect to the &lt;strong&gt;Overview&lt;/strong&gt; page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execute the Runbook
&lt;/h2&gt;

&lt;p&gt;With the runbook created and published, you can now execute the runbook and view the output. From the &lt;strong&gt;Overview&lt;/strong&gt; page, select the &lt;strong&gt;Start&lt;/strong&gt; icon. It will prompt you to make sure you want to start the runbook, go ahead and select &lt;strong&gt;Yes&lt;/strong&gt;. Once Azure begins executing the runbook, the portal will redirect to the overview page for this runbook job instance. Here, you can view the instance ID, the status, and the input and output streams of the runbook. From here, select the &lt;strong&gt;Output&lt;/strong&gt; tab to view the "Hello, Azure Runbooks!" message to the console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b7RHMTio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cq9pny8xpjdoz3l9nhjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b7RHMTio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cq9pny8xpjdoz3l9nhjl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Warning and Error Output
&lt;/h2&gt;

&lt;p&gt;In the above example, the PowerShell runbook output the string "Hello, Azure Runbooks!". You can also use the cmdlets &lt;em&gt;Write-Warning&lt;/em&gt; and &lt;em&gt;Write-Error&lt;/em&gt; to output warning and error messages to the console logs.&lt;/p&gt;

&lt;p&gt;Back on the runbook &lt;strong&gt;Overview&lt;/strong&gt; page, select the Edit icon at the top to go back to the &lt;strong&gt;Edit PowerShell Runbook&lt;/strong&gt; page with the existing code. In the code editor, add the following lines of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Write-Warning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is the warning message."&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is the error message."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sEcrTDPl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e1l4qxch3hj2wemog68j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sEcrTDPl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e1l4qxch3hj2wemog68j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save and publish this version of the runbook. Back in the &lt;strong&gt;Overview&lt;/strong&gt; page for the runbook, select the &lt;strong&gt;Start&lt;/strong&gt; icon to execute the runbook again, just as you did previously. In the job results window, select the &lt;strong&gt;Errors&lt;/strong&gt; and &lt;strong&gt;Warnings&lt;/strong&gt; tabs to view the custom messages outputted from the script. You can also select &lt;strong&gt;All Logs&lt;/strong&gt; to view all output from the script in one place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--71ovBWJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vyu1n2bi8vkwrqsshybc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--71ovBWJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vyu1n2bi8vkwrqsshybc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Op-SKgRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3ikulrqc5snbdywzn1z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Op-SKgRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3ikulrqc5snbdywzn1z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the appropriate PowerShell cmdlets, you can create a runbook that shows regular, warning, and error messages. Customizing this output can quickly ascertain if the script has any issues by correctly displaying warnings and errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhance Runbook Execution with Parameters
&lt;/h2&gt;

&lt;p&gt;PowerShell parameters enable passing information to a script to use during execution. Parameters allow PowerShell scripts to be more dynamic instead of setting static variables. Azure Automation PowerShell runbooks can also use parameters when you define them in the script code. Let's examine this functionality now.&lt;/p&gt;

&lt;p&gt;Follow the instructions from earlier in this post to edit the runbook code. In the code editor, add a parameter that will accept a name to display in the greeting message. Since this parameter is not mandatory, I'm defining the parameter with a default value of "CloudSkills." Here is the new runbook code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="kr"&gt;param&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Parameter&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CloudSkills"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After saving and publishing the runbook, execute the runbook just as you have done previously. However, this time Azure will display a &lt;strong&gt;Start Runbook&lt;/strong&gt; window to allow you to input a value for the &lt;em&gt;Name&lt;/em&gt; parameter. It also indicates that "CloudSkills" will be used as the default if you don't enter another value. Enter your name and select &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cCyycm6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3oldf6n4c94ubw4vw7pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cCyycm6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3oldf6n4c94ubw4vw7pf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the job results window, the &lt;strong&gt;Input&lt;/strong&gt; tab will show the value of the &lt;em&gt;Name&lt;/em&gt; parameter passed to the runbook, and the &lt;strong&gt;Output&lt;/strong&gt; tab will show the output message using the value of the parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Variable Asset
&lt;/h2&gt;

&lt;p&gt;While you can define variables within the runbook code, you can also define variables within the Automation Account to be used by multiple runbooks. Back in the Automation Account, navigate to &lt;strong&gt;Shared Resources&lt;/strong&gt; &amp;gt; &lt;strong&gt;Variables&lt;/strong&gt;. From here, select &lt;strong&gt;Add a variable&lt;/strong&gt;. In the &lt;strong&gt;New Variable&lt;/strong&gt; window, enter a variable name, description, data type, value, and encryption type. Once completed, select &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jqu1ZP2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sr6vwtsz2fami3sh52ka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jqu1ZP2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sr6vwtsz2fami3sh52ka.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the variable create, you can now reference it in a runbook. Navigate back to the runbook and edit the code. Inside the script, you can retrieve the variable's value by using the &lt;strong&gt;Get-AutomationVariable&lt;/strong&gt; with the variable name and storing it into a script-level variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$congratsMessage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-AutomationVariable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'congratsMessage'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now use the defined variable as needed in the script. Suppose you don't remember the name of the variable asset you defined in the Automation Account. In that case, you can view variable assets under &lt;strong&gt;Assets&lt;/strong&gt; and use the context menu to auto-generate the PowerShell command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XqSmugMm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2dfcfes0hnzghv4ay2k1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XqSmugMm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2dfcfes0hnzghv4ay2k1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save, publish, and then execute the runbook to verify the variable output in the job results window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GCvPrPs3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nxoi8y0iqwt6f2c5yksu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GCvPrPs3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nxoi8y0iqwt6f2c5yksu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post, you learned how to create an Azure Automation Account to host your first PowerShell runbook. You saw how to view the runbook output and use &lt;em&gt;Write-Warning&lt;/em&gt; and &lt;em&gt;Write-Error&lt;/em&gt; to customize the output. Finally, you extended the functionality of your runbook with parameters and variable assets.&lt;/p&gt;

&lt;p&gt;Check back soon for my next post on Azure Automation where I will show how to configure authentication to access and manage Azure resources.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Jeff Brown&lt;/strong&gt; is a Systems Engineer and Cloud Administrator with over a decade of experience in server and application administration. In his career, he has managed a wide range of technologies including Windows Server, Exchange Server, Skype for Business, Azure, and Microsoft 365. Jeff enjoys writing about technology topics and creating content for the community. You can find more of his content over at &lt;a href="https://jeffbrown.tech/"&gt;jeffbrown.tech&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
    </item>
    <item>
      <title>Windows Virtual Desktop with Travis Roberts</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 10:55:17 +0000</pubDate>
      <link>https://forem.com/cloudskills/windows-virtual-desktop-with-travis-roberts-2pc1</link>
      <guid>https://forem.com/cloudskills/windows-virtual-desktop-with-travis-roberts-2pc1</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zIeEZEN9rHU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In this episode we're catching up with Travis Roberts to chat about all things Windows Virtual Desktop, Azure, and a lot more.&lt;/p&gt;

&lt;p&gt;In part due to the COVID-19 Pandemic, 2020 saw the use of Windows Virtual Desktop soar. Many companies are in the process of switching their networks over to the Cloud. Mike’s guest today is Travis Roberts, the Senior Networking Systems Administrator at RBA Consulting. Travis has a background of working in corporate IT for over 20 years, but he made a switch when he realized he wanted to focus less on management and more on consulting. He has lots of experience with Windows Virtual Desktop (and more) and creates content online to help others learn how to better utilize this technology.&lt;/p&gt;

&lt;p&gt;In this episode, we talk about…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Travis’s background, how he got into consulting, and what the transition was like coming to that from corporate jobs.&lt;/li&gt;
&lt;li&gt;How Azure has been ramping up and is currently neck and neck with AWS.&lt;/li&gt;
&lt;li&gt;Why, at this point, most Systems Administrators are essentially Cloud Developers, as well.&lt;/li&gt;
&lt;li&gt;How you have to think a bit differently when using ARM templates and PowerShell.&lt;/li&gt;
&lt;li&gt;Why moving to the Cloud can save a business a lot of overhead expenses.&lt;/li&gt;
&lt;li&gt;The mindset shift involved in maintaining a server rack with manual switches and buttons, versus working within Azure.&lt;/li&gt;
&lt;li&gt;Why setting up a virtual network within Windows Virtual Desktop is so much faster than the traditional means.&lt;/li&gt;
&lt;li&gt;Why you need to continuously learn given the way technology is shifting now -and how if you learn it sooner, you can help others as they shift to the Cloud during the next decade.&lt;/li&gt;
&lt;li&gt;How building a brand can help you, and if you’re interested, you should start writing a blog or making Youtube videos.&lt;/li&gt;
&lt;li&gt;The importance of Source Control and how Travis has been using Github.&lt;/li&gt;
&lt;li&gt;The switch from using JSON to using HCL.&lt;/li&gt;
&lt;li&gt;How Travis has been seeing that he’s been needing to learn more about Continuous Integration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Resources from this episode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Travis on &lt;a href="https://twitter.com/Ciraltos"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Travis on&lt;a href="https://www.youtube.com/channel/UCuB24cID6NnypDWSLe4gfqA"&gt;YouTube&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Travis on &lt;a href="https://www.linkedin.com/in/robertst/"&gt;LinkedIn&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Udemy Course Discount: &lt;a href="https://www.udemy.com/course/zero-to-hero-with-windows-virtual-desktop/?couponCode=C1A569972876FF39D337"&gt;Zero to Hero with Windows Virtual Desktop&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
      <category>devops</category>
    </item>
    <item>
      <title>AWS for Azure Pros: The Ultimate AWS to Azure Service Comparison</title>
      <dc:creator>TeamCloudSkills</dc:creator>
      <pubDate>Tue, 02 Feb 2021 10:52:28 +0000</pubDate>
      <link>https://forem.com/cloudskills/aws-for-azure-pros-the-ultimate-aws-to-azure-service-comparison-3o69</link>
      <guid>https://forem.com/cloudskills/aws-for-azure-pros-the-ultimate-aws-to-azure-service-comparison-3o69</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/m94tlNJCjSI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Already know Azure but need to learn AWS? In this CloudSkills Community Call replay, MSFT MVP Mike Pfeiffer delivers a one-hour training that maps what you already know in Azure to comparable services in AWS.&lt;/p&gt;

&lt;p&gt;Note: Throughout the video Mike mentions an upcoming AWS class at CloudSkills.io; it ended up becoming the Cloud Native DevOps Bootcamp:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloudskills.io/cloudnative"&gt;https://cloudskills.io/cloudnative&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>azure</category>
    </item>
  </channel>
</rss>
