Reputation: 20169
Can I use an Azure Web Job in order to run some scheduled scripts against my Azure environment? I've installed Azure Powershell and am able to connect to my Azure subscription locally and run the commands.
https://github.com/Azure/azure-powershell/releases
However, I'd like to have the script run at a specific time in order to scale up/down a database. When I upload the zip of the PS1 file, will it just run, or do I need to somehow include the Azure powershell bits as a dependency? Anything else I need to consider?
https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduled
Upvotes: 0
Views: 368
Reputation: 11256
If you want to use a specific PowerShell module such as Azure PowerShell, then you would have to deploy the bits to the Web App environment. You can do that pretty easily using FTP or Kudu to copy the bits up there.
As an alternative, you may want to consider using Automation Runbooks instead for this task. You can create a schedule for the job just as you can for Web Jobs, but for PowerShell scripts I think you may find this is more natural than trying to do it from a web job. Information to get started on this path is available here.
Upvotes: 2