Schedule Azure CLI Script

m1nkeh

I've searched a bit about this, but is there documentation at all on how to schedule jobs that run with Azure CLI commands?

I want to run in the cloud, but azure automation doesn't support CLI (yet), so i am leaning towards perhaps using Azure Scheduler... but don't know the pros and cons...

Alternatively, is it possible to create a scheduled job, somehow, in the Azure Cloud Shell... i assume this is backed by some VM and therefore perhaps if it is Linux based we could whizz up a cron job... i don't really know how to do that though.

Ta!

kim

I tried finding some information on how to use Azure CLI in the cloud but there doesn't seem to be much available.

There are two versions of Azure CLI:

  • v1.0
    • Built as a node.js module
    • Can be installed by running npm install -g azure-cli
  • v2.0
    • Standalone package
    • Install MSI on Windows or using some package manager, e.g. apt/yum/zyper/etc, on Linux.

Azure App Service

Azure Web Apps support running applications built ontop of node.js. Technically you could then install the v1.0 module in a Web App and run your script on a schedule there.

However, recommended is to use v2.0. But this would offere one possibility of automation.

Azure Automation

Current Azure CLI is not support but it's under review at the time of writing. See this link for the uservoice suggestion and vote on it if this a desired feature.

Azure Functions

As far as I can tell, there's no way to run Azure CLI on an Azure Function.

Azure Scheduler

Azure Scheduler is a service for only invoking code hosted elsewhere. This would still mean you need to host your code somewhere else, i.e. cloud or on-premises, then have the scheduler run it for you.

Triggering mechanisms that are supported are:

  • HTTP, HTTPS
  • Azure Storage queue
  • Azure Service bus queue
  • Azure Service bus topic

Azure Cloud Shell

It's a shell that contains tools needed for running commands and scripts without the needed to locally install anything. Scheduling anything, using cron does not seem to be possible.

Suggestion

At the moment, if you want to script something, and run it in the cloud, I recommend you have a look at PowerShell. Running PowerShell scripts, with a time trigger is possible on Azure Functions and support adding your own custom modules as well.

If you need to use Azure CLI and serverless, then you could run it inside of a Docker container and host the container in the cloud, e.g. in an Azure Container Instances. See this link on how to create it.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Schedule scripts/jobs using azure cli

分類Dev

How to run a job in openshift to schedule a particular script?

分類Dev

Schedule shell script to display output in terminal

分類Dev

schedule automate shell script running not as ROOT

分類Dev

In Azure Devops, how can i use pipeline variables in a "Azure CLI task v.2" running shell script?

分類Dev

Azure CLI vs Powershell?

分類Dev

Azure CLI vs Powershell?

分類Dev

PHP Run background script from cli script

分類Dev

Build python package for CLI script

分類Dev

Schedule php script at certain date to just run once in Openshift

分類Dev

How do I use `at` to schedule a script to execute on macOS?

分類Dev

Creating application insights with azure cli

分類Dev

azure cli vmcreateタグ

分類Dev

Azure CLI to check VM status

分類Dev

Calling Azure functions through the Azure CLI

分類Dev

Is there a way to schedule "Reminders" in Durable Entities of Azure Durable Functions?

分類Dev

PHP cli script does not output anything

分類Dev

How to run hive script from hive cli

分類Dev

Telegram-cli : Script not sending message

分類Dev

Azure関数CLIのServiceBusTrigger?

分類Dev

Azure CLI: Accept SendGrid's legal terms

分類Dev

How to create an Azure DevOps Repository using Azure CLI

分類Dev

how can I schedule a custom script to run whenever I restart a service

分類Dev

How do you delay and schedule a stage to only run the latest build in an Azure Devops yaml pipeline?

分類Dev

Azure Data Factory Scheduleプロパティの使用方法は?

分類Dev

Bash script to run a dotnet command line app getting ' as cli argument

分類Dev

How to parse commands from a text file to a bash script in the CLI

分類Dev

azure-functions-cli:func init spits error "No such file or directory"

分類Dev

Azure CLIとエスケープ引用

Related 関連記事

  1. 1

    Schedule scripts/jobs using azure cli

  2. 2

    How to run a job in openshift to schedule a particular script?

  3. 3

    Schedule shell script to display output in terminal

  4. 4

    schedule automate shell script running not as ROOT

  5. 5

    In Azure Devops, how can i use pipeline variables in a "Azure CLI task v.2" running shell script?

  6. 6

    Azure CLI vs Powershell?

  7. 7

    Azure CLI vs Powershell?

  8. 8

    PHP Run background script from cli script

  9. 9

    Build python package for CLI script

  10. 10

    Schedule php script at certain date to just run once in Openshift

  11. 11

    How do I use `at` to schedule a script to execute on macOS?

  12. 12

    Creating application insights with azure cli

  13. 13

    azure cli vmcreateタグ

  14. 14

    Azure CLI to check VM status

  15. 15

    Calling Azure functions through the Azure CLI

  16. 16

    Is there a way to schedule "Reminders" in Durable Entities of Azure Durable Functions?

  17. 17

    PHP cli script does not output anything

  18. 18

    How to run hive script from hive cli

  19. 19

    Telegram-cli : Script not sending message

  20. 20

    Azure関数CLIのServiceBusTrigger?

  21. 21

    Azure CLI: Accept SendGrid's legal terms

  22. 22

    How to create an Azure DevOps Repository using Azure CLI

  23. 23

    how can I schedule a custom script to run whenever I restart a service

  24. 24

    How do you delay and schedule a stage to only run the latest build in an Azure Devops yaml pipeline?

  25. 25

    Azure Data Factory Scheduleプロパティの使用方法は?

  26. 26

    Bash script to run a dotnet command line app getting ' as cli argument

  27. 27

    How to parse commands from a text file to a bash script in the CLI

  28. 28

    azure-functions-cli:func init spits error "No such file or directory"

  29. 29

    Azure CLIとエスケープ引用

ホットタグ

アーカイブ