Creating Azure runbooks in Azure portal with the normal powershell script

Anto Reni Huxley Antokinsley 81 Reputation points
2021-11-10T15:01:39.557+00:00

I need to create azure runbooks (Powershell) to automate the task that is manually triggered in Windows Powershell ISE.
Script design :
Need to connect to Azure SQL tables, fetch data from there, do some transformation using the values from azure tables and push the output to Azure blob storage.
I guess I cannot use the same script used in powershell ISE in Azure runbooks.
Is there any docs/modules/idea for connecting to blob and azure sql using powershell for runbook?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,305 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,625 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,476 Reputation points
    2021-11-11T15:22:29.217+00:00

    Hi @Anto Reni Huxley Antokinsley ,

    Welcome to Microsoft Q&A! Thanks for posting the question.

    Most of the PowerShell scripts which run locally on your machine using ISE/PowerShell will also run as Azure Automation runbook after making minor changes. Most of these changes are related to setting correct context, account, and connections to respective resource. Some of the tutorials available here are a good place to get started with Azure Automation.

    I also created a sample runbook which is available here, which contains the scenarios described in the question. It simply reads some values from Azure SQL, then reads some related information from Azure table storage and finally uploads the read value to Azure blob. The comments in the runbook ( runbook.ps1 ) and the associated help.md file should help you get started.

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.