Azure Automation for Azure VMs with PowerShell

preview_player
Показать описание
In this video we are going to have a look on how you can schedule and run PowerShell and Bash scripts against Azure virtual machines (VMs) using Azure Automation. For this we are going to use Azure Run Command and Azure Automation.

Run Command can run a PowerShell or shell script within an Azure VM remotely by using the Azure Virtual Machine Agent. This scenario is especially useful when you need to run scripts against Azure VMs where you do not have network access. You use Run Command for Azure VMs through the Azure portal, REST API, Azure CLI, or PowerShell. Like I showed you in my blog post on Microsoft Tech Community.

Azure Automation delivers a cloud-based automation, operating system updates, and configuration service that supports consistent management across your Azure and non-Azure environments. It offers a couple of distinctive features, in this blog we are going to use the process automation feature, which allows you to run automation inform of PowerShell runbooks. We are going to use Azure Automation to schedule the scripts to run on Azure VMs.

📺 Agenda
0:00 Intro
0:39 Azure Automation for Azure VMs
2:08 Azure VM RunCommand
4:17 RunCommand in Azure PowerShell
7:45 Azure Automation
15:34 Schedule a Runbook
17:24 Outro

⭐ About
Thomas works as a Senior Cloud Advocate at Microsoft. He engages with the community and customers around the world to share his knowledge and collect feedback to improve the Azure cloud platform. Prior to joining the Azure engineering team (Cloud + AI), Thomas was a Lead Architect and Microsoft MVP, to help architect, implement and promote Microsoft cloud technology.
If you want to know more about Thomas, check out:

#Azure #Automation #PowerShell
Рекомендации по теме
Комментарии
Автор

Thanks from London, this put the cherry on the cake of a personal project I have been working on for a while - and will no doubt help me out professionally too

able
Автор

Great material this is just what i was looking for

RicardoSantos-eifq
Автор

Thanks thomas for fantastic stuff... Can we run the invokeruncommand for aks node pool as well ??

rameshreddy
Автор

I tried to write a script, which allows to modify Dns-entries in a vm via powershell runbook. The problem is i cant get the key properties like IPAddress from Type A, because i wrote the Get-DnsRessourceRecordA Commands as a String like you. Do you know an better example to write a script for that or a better solution?

ekrem
Автор

Hello Thomas, on Azure DevTest Lab Microsoft created a simple scheduling policy where you can start/stop any of your VM without installation of any Automation, PS, run command etc. Easy by few clicks. Are you planning to copy this feature on main portal ? Thank you!

vrgl
Автор

The last parameter script path where should the script be stored. In local machine or VM. I am trying to run azcopy copy script.

ajayv
Автор

Hi, Am struggling with a scenario as with Restrictive client policy Network isnt allowing public access. How to Fetch the Inventory data and store it on a storage location using Automation account via managed identity...any solution please

varunk
Автор

I have a curly one... I have a VM running SQL server. I need to make a backup of a database on it, but copy that file to Azure storage. Do I need to "connect" to the VM still or can I declare the VM name and the DB name just as I would if I was backing up or copying a database from a full SQL server?

tonykuiper
Автор

Could you show how to execute the powershell scripts in VM using DevOps?

michaelmanangan
Автор

hey Thomas, Could you please explain how does it work/steps we need to perform when the VM is in a Virtual Network. Thanks.

srinivasjosyula
Автор

Why would you not show the creation of the Automation

NathanAshe-xt
Автор

I am struggling with vm creation using a existing resource and vnet using powershell

tekolawells