runbook | A framework for gradual system automation | DevOps library
kandi X-RAY | runbook Summary
kandi X-RAY | runbook Summary
Runbook provides a DSL for specifying a series of steps to execute an operation. Once your runbook is specified, you can use it to generate a formatted representation of the book or to execute the runbook interactively. For example, you can export your runbook to markdown or use the same runbook to execute commands on remote servers. Runbook has two modes for evaluating your runbook. The first mode, view mode, allows you to export your runbook into various formats such as markdown. The second mode, run mode, allows you to execute behavior based on the statements in your runbook. Runbook can be integrated into existing infrastructure in many different ways. It can be integrated into existing projects to add orchestration functionality, installed on systems as a stand-alone executable, or runbooks can be defined as self-executable scripts. In addition to being useful for automating common tasks, runbooks are a perfect bridge for providing operations teams with step-by-step instructions to handle common issues (especially when solutions cannot be easily automated). Lastly, Runbook provides an extendable interface for augmenting the DSL and defining your own behavior.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render the configuration output
- Create a new runbook .
- Setup the layout .
- Removes all dependencies from the directory
- Sets up the item identified by run_items .
- Initializes the Gemfile .
- Set the value
- Declare the timeout statement
- Access the value
runbook Key Features
runbook Examples and Code Snippets
Community Discussions
Trending Discussions on runbook
QUESTION
I have an AKS with 3 Node pools - 2 USER type and 1 SYSTEM type. I want to create an automation via Azure runbooks that will scale the 2 USER type Node pools to zero during off-hours and then re-enable auto-scaling to the Node pools with their previous Min and Max count.
As for re-enabling the auto-scaling I found the command for that:
...ANSWER
Answered 2022-Mar-28 at 15:00With the features that are currently available, to disable an AKS node pool's auto-scaling via Powershell, I would recommend to leverage Agent Pools - Create Or Update REST API and Invoke-RestMethod PowerShell cmdlets and create an Azure Automation runbook something as shown below.
QUESTION
I am trying to read the URL query params from a POST coming into my Azure webhook (PowerShell).
My webhook is receiving a POST request such as:
...ANSWER
Answered 2022-Mar-08 at 00:07Very specifically, Azure Runbooks
, do not support query strings. From the documentation:
Property Description WebhookName Name of the webhook. RequestHeader Hashtable containing the headers of the incoming POST request. RequestBody Body of the incoming POST request. This body keeps any data formatting, such as string, JSON, XML, or form-encoded. The runbook must be written to work with the data format that is expected.To receive data from the client, the runbook supports a single parameter called
WebhookData
. This parameter defines an object containing data that the client includes in a POST request.The
WebhookData
parameter has the following properties:
Azure Runbooks
has 2 parts to it, triggers and runbooks:
The Runbook
(Right Box) only accepts the single WebhookData
object to manage variable and data that Azure Runbooks
will operate with.
Webhooks
(Left Box), handles the triggering, receiving of data and passing it on to the Runbook
. Very specifically, the RequestBody
is specified as the:
Body of the incoming POST request. This body keeps any data formatting, such as string, JSON, XML, or form-encoded.This body keeps any data formatting, such as string, JSON, XML, or form-encoded.
With this definition, very specifically, even though WebHooks
can support query strings, in this case for triggering Azure Runbooks
they are explicitly ignored.
Aside, if the end desire is to subscribe to Microsoft Graph events, the "better" way is to use Event Hubs
to handle notifications:
Using Azure Event Hubs to receive change notifications differs from webhooks in a few ways, including:
- You don't rely on publicly exposed notification URLs. The Event Hubs SDK will relay the notifications to your application.
- You don't need to reply to the notification URL validation. You can ignore the validation message that you receive.
- You'll need to provision an Azure Event Hub.
- You'll need to provision an Azure Key Vault.
QUESTION
I am trying to get the difference in days between a string datetime and the current date. I tried following code on my local PC
...ANSWER
Answered 2022-Mar-07 at 10:50As requested, here my comment as answer
The date format in $DateInName
shows it is formatted as 'dd-MM-yyyy'
(2-digit Day, 2-digit Month, 4digit Year).
Either do
QUESTION
I'm trying to create a runbook in Azure to perform AzureAD commands. I'm receiving an error at the very beginning (skipping the parameters setup):
...ANSWER
Answered 2022-Feb-23 at 07:34This error occurs when the user account that is being used to run the Azure PowerShell cmdlets does not have the correct administrator role .
Get-AzureADUser command uses Azure AD graph in the backend.
You may need to add the Application permissions ,Directory.Read.All
of AAD graph (Azure Active Directory Graph) and make sure to grant admin consent for the same.
Check support-for-azure-ad-graph-permission
Go to Azure portal > Azure AD > Roles and Administrators > Select Directory Readers role and assign this role to the runbook required.
Reference: Authorization_RequestDenied error
edit:
QUESTION
I am relatively new to Azure. I am trying to figure out how to use Python to load files into an Azure storage account, such as Data Lake or Blob Storage. I read the info from the following two URLs, and I am stuck about how to proceed.
https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-directory-file-acl-python
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python
Maybe I missed something from those resource, or they are not right for what I am trying to do. I just want to get a simple example working so I can start to understand the process better. I would like to do either of the following.
copy a file from my desktop to Azure Blob Storage or Data Lake Storage
download a file from a URL and save it to Azure Blob Storage or Data Lake Storage
I want to run Python from Azure, so I want the code to run in a 'Runbook'. Can someone point me in the right direction to do either item 1 or 2, as described above, or ideally both 1 and 2? Thanks.
...ANSWER
Answered 2022-Feb-14 at 04:47You need to add the azure_storage_blob python package in your automation account
Then, you can use the python code below to upload file to azure blob storage from a URL:
QUESTION
I am trying to run some Python code in Azure, for the first time ever. I Googled 'how to run Python scripts in Azure' and came across the following link.
https://docs.microsoft.com/en-us/azure/automation/learn/automation-tutorial-runbook-textual-python-3
Essentially, I need to do this.
Open the textual editor by selecting Edit on the MyFirstRunbook-Python3 pane.
Add the following code to authenticate to Azure:
...ANSWER
Answered 2022-Feb-07 at 17:35Most likely you haven't created an Azure Run As Account
. Follow the steps here to do so.
QUESTION
I've got an Automation Account in Azure that runs a Powershell runbook. It runs perfectly fine when I trigger it via the portal, manually specifying the inputs
I've created a webhook with the same input settings. I call it from CURL like
curl -d '' https://800b2bec-b1ae-4fa1-ba30-8c7d32096828.webhook.ae.azure-automation.net/webhooks?[redactedtoken]
The webhook shows as triggered successfully in the portal, however the job fails with no visible error.
There is no output, even though the first line in my powershell function is Write-Output "Hello"
There are no exception messages, no logs at all.
Any idea how I might get more information as to what might be going wrong?
I've updated the Az modules and enabled verbose logging in the runbook.
Full source below, if it helps.
...ANSWER
Answered 2022-Feb-07 at 12:39We have tested this in our local environment it is working fine, Below statements are based on the analysis.
In our local environment, We have created a Powershell runbook running with different PowerShell Versions 7.1 & Version 5.1.
- Using the above share Script & webhook URI, when we are trying to invoke the runbook (PowerShell version 7.1) using the `Invoke-webRequest method it is continuously failing.
Alternatively, We have tried to invoke the runbook (PowerShell version 5.1) using the Invoke-webRequest
method it is working fine.
We would suggest you to use Powershell Version 5.1 instead of 7.1 in your Runbook.
Here is the sample Output for reference:
QUESTION
I'm new to Azure automation, and have a python script that runs fine on the local machine. The script runs a PowerShell command to get sign in logs, and does some string parsing on them before writing to a storage account table. I was able to install all dependencies for the script via the "Python Packages" blade in the automation account. Is there a way to add powershell.exe somewhere so that the subprocess library can be used to run the PowerShell command? Alternatively, is there a library you can import to be able to run the PowerShell command or grab sign in logs from Azure AD without directly using the powershell.exe file?
Also, Microsoft.Powershell.Core is added in the Modules within the automation account. Am I just using the wrong filename and should use something other than powershell.exe? Is there a different module you have to install, or am I referencing it wrong?
Here is the relevant portion of the script:
...ANSWER
Answered 2022-Feb-07 at 08:40I have tested in my environment
I get the same error as yours if I use subprocess in my python script to run PowerShell command
This is because the subprocess module is not able to find the powershell.exe path
For the workaround, you can use either of the options:
- You can use PowerShell script instead of python script
- You can use MS Graph API in your python code instead of PowerShell commands
QUESTION
As far as I can tell by looking at other posts, using the subprocess library in Python is the most popular way to execute PowerShell commands from within Python. For example:
...ANSWER
Answered 2022-Feb-07 at 04:00I have tested in my environment
You can use MS Graph API query in your python script to get the Azure AD sign in logs of the users
You can use below python code:
QUESTION
I have a runbook using automation in Azure. It is getting a single integer result from a table and it can return the correct value. The code I am using is below and it works.
...ANSWER
Answered 2022-Feb-04 at 07:00You can use the Start-AzAutomationRunbook cmdlet to trigger a child runbook from the another run book inside the automation account.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install runbook
Install runbook at a system level using gem:. Set any Runbook configuration in /etc/runbook.conf. Generate runbook files using runbook generate runbook. Execute runbook generate help runbook for more details. Installing Runbook at a system level can be useful for executing runbooks on remote hosts or within docker containers. One disadvantage of installing Runbook at a system level is that there is no built-in solution for dependency management.
Install runbook using gem:.
Add this line to your project's Gemfile:.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page