Nikita Seliverstov
Nikita Seliverstov

Reputation: 175

How to run powershell script in azure functions in schedule

I need to run a powershell script on a schedule using azure functions, I tried to execute the file using node.js but it's not working and i can't figure out why.

Upvotes: 0

Views: 7927

Answers (1)

Jeremy Lattimore
Jeremy Lattimore

Reputation: 296

While my original answer was correct at the time, Azure has been updated to support Azure Functions utilizing Powershell: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell


Original Answer:

To me Azure Automation (https://learn.microsoft.com/en-us/azure/automation/) seems like a better model for running a Powershell script on a schedule in Azure since it really is a native capability of that tool.

If you really want to do it in an Azure Function it does look like there are some resources you could try (I have not tested them):

https://blogs.msdn.microsoft.com/powershell/2017/02/24/using-powershell-modules-in-azure-functions/

https://github.com/Azure/azure-functions-powershell-worker

Best of luck!!

Upvotes: 5

Related Questions