I have a PowerShell script that i want to run every 6 hours as a task scheduler on Azure. But the concern is that I don't want any Virtual machine for that. So is there any way so that it can be done without the creation of any virtual machine?
-
Take a look at Azure Automation - azure.microsoft.com/en-au/services/automation. You can run PowerShell scripts on a schedule using this service.Gaurav Mantri– Gaurav Mantri2017-11-28 10:35:12 +00:00Commented Nov 28, 2017 at 10:35
-
I have gone through the blog and found Runbook.Sandeep Anand– Sandeep Anand2017-11-28 12:27:53 +00:00Commented Nov 28, 2017 at 12:27
-
@SandeepAnand You could select Runbook or Azure function app. I add it as an answer. Hope it helps.Shui shengbao– Shui shengbao2017-11-29 07:51:53 +00:00Commented Nov 29, 2017 at 7:51
2 Answers
There is many choices you could do this in Azure.
1.As Gaurav Mantri said, you could use Azure Automation, you could create a runbook and schedule it starting at a specified time. More information please refer to this link.
2.Use Azure Function App. You could create a TimerTrigger - PowerShell, like below:
More information please refer to this link.
Note: Azure automation and function app all provide FREE UNITS (PER MONTH).
Hope it helps.
1 Comment
For PowerShell currently Azure Automation is the preferred service as it is experimental currently in Functions.
https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages
Experimental support for PowerShell is limited to version 4.0 because that is what's installed on the VMs that Function apps run on. If you want to run PowerShell scripts, consider Azure Automation.
