0
votes

Could Azure CLI upload/update a script which was code by azure cli and powershell?

e.g
there's a demo.ps1:

$json = az group list;
sendemail --body $json --to "[email protected]" --title "xxx";

I'd like to upload demo.ps1 & create a taskjob on azure like

az somecommand create task --time "every 3 hour" --file demo.ps1

upload taskjob like :

az somecommand update task --time "every 3 hour" --file demo.ps1

What I've tried & know :

  • I tried automation runbook but it can't support azure cli
  • I tried azure logic but it only support javascript
  • I can create a ubuntu VM and use crontab to do it, but it's too heavy for light job
1

1 Answers

1
votes

It's meaningless to upload scripts scheduled, but it meaningful to run scripts scheduled.

As you know, Azure automation runbook don't support Azure CLI. But power shell con do most jobs CLI do, you can try using power shell command in runbook, and link schedules to run the scripts.