As part of this cloud transition, it's important to realize that even though you can't see a system it still needs to be managed. Let's talk about PowerShell automation.
These days, just about every CIO, IT manager and IT professional has his head in the cloud. Organizations have found that offloading various utilitarian services to the cloud allows them to focus more on delivering business value rather than just keeping the lights on.
When deploying services to the cloud, whether it be a simple Infrastructure as a Service (IaaS) offering or Platform as a Service (PaaS), companies still need to focus on automation. Microsoft, Amazon and Google offload a lot of work but not everything. Let's focus on one way to manage resources in the cloud with PowerShell.Related Article: PowerShell Scripting and Open Management Infrastructure (OMI)
Most (if not all) cloud vendors support PowerShell to manage their services. They do this by providing PowerShell modules which are built to interact with their underlying APIs. Companies like Microsoft, Amazon and Google all have PowerShell modules. They provide these modules because many IT professionals use PowerShell to automate tasks in their organizations.
Getting started with PowerShell automation in the cloud is easy. Let's briefly cover what it takes to get a PowerShell module for each cloud vendor downloaded, installed and working for each of these major cloud vendors.
We'll start off with Microsoft. As you might expect, Microsoft's Azure cloud offering has a robust PowerShell module to do just about anything in Azure. The easiest way to download the AzureRM (Resource Manager) PowerShell module is to use the Install-Module cmdlets. Once run, PowerShellGet will find all the module dependencies and get everything set up for you.
Find-Module AzureRm | Install-Module
Once all modules have been downloaded, you'll then need to authenticate to Azure by running the Login-AzureRMAccount cmdlet. This will prompt to provide credentials and, once complete, you'll have access to your Azure subscription.
Amazon provides their PowerShell module via an MSI software installer. This requires downloading and installing outside of PowerShell. Once you've run the installer and accepted all the defaults, Amazon AWS Tools for PowerShell is installed. This will install a PowerShell module called AWSPowerShell.
The next step is to authenticate to your AWS account. You'll do this by using the Set-AWSCredentials command. However, you'll need to know an access key and secret key. If this is the first time using PowerShell to access AWS, the keys will have to be generated. To either generate or find existing keys, log into the AWS management console and go to My Account --> Security Credentials.
You will then see an area called Access Keys were these two values can be found. If you don't know your secret access key, you'll have to create another. Once you have these two values, run the Set-AWSCredentials command to save them.
Set-AwsCredentials -AccessKey XXXXXXX -SecretKey XXXXXX
Now you have everything you need to authenticate to your AWS account. At this point, you can run the various commands that come as part of the AWSPowerShell module.
Finally, there's Google. To manage the Google cloud from PowerShell, download and install Cloud Tools for PowerShell. Once downloaded and installed, you'll now have all the Google Cloud PowerShell commands available. Once installation has completed, the gcloud init command will run and prompt for your Google credentials. Once this command has completed, you're ready to manage the Google Cloud platform.
We only had time to get each PowerShell module downloaded and installed. However, at this point, you should now be connected to all three cloud services and ready to explore! As you've seen, all the major cloud vendors offer PowerShell support. Using PowerShell to automate cloud tasks allows you to combine cloud automation with many other common tasks that you and your team are already automating.
If your cloud vendor wasn't covered here, chances are they still have PowerShell support. Simply search for their name and PowerShell and it's likely they or the community has developed a project around PowerShell.
Adam Bertram is a 20-year veteran of IT. He’s currently an automation engineer, blogger, independent consultant, freelance writer, author, and trainer. Adam focuses on DevOps, system management, and automation technologies as well as various cloud platforms. He is a Microsoft Cloud and Datacenter Management MVP and efficiency nerd that enjoys teaching others a better way to leverage automation.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.Learn More
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.