runbooks
6 TopicsHow to Automate Cross-OS File Fixes with Azure Automation and PowerShell
Build a serverless file fixer in Azure using Automation, PowerShell, Blob Storage, and Event Grid. Learn how to set up the necessary resources, configure permissions, and automatically detect and correct cross-OS file issues—such as CRLF vs LF line endings and file permission mismatches. This streamlined approach saves time and eliminates manual fixes, ensuring smoother, error-free workflows for developers working across different operating systems.210Views0likes0CommentsEvent Grid for Intune?
Hi! I have an app (TOPdesk) where I am currently trying to integrate with Intune. I have learned that Azure has Event Grids and I can use this to fire off PowerShell Runbooks to execute a PS script which will then send off an HTTP request to connect to my app. The question that came to mind is whether it's possible for Event Grids to listen in to activities from Intune? Basically, I was thinking that whenever a new device is created, the Event Grid can help trigger a runbook to send off a HTTP request to connect to the app. Unfortunately, I have no access to Intune and Event Grid so I cannot confirm this myself. Any insight or alternatives will be appreciated! Thanks!1.2KViews0likes0CommentsAzure Automation Runbooks using Powershell: Push notifications error?
I'm trying to run some PnP PowerShell commands in an Azure Runbook (e.g. Get-PnPContentType, Apply-PnPProvisioningTemplate, etc. ) over a SharePoint site, but it keeps returning the error below: The Push Notifications feature is not activated on the site The correct modules have been imported and it only errors on some commands. Running the commands in a PowerShell window with the same credentials doesn't produce any errors, and activating the 'Push Notifications' feature manually and retriggering the Runbook won't produce any error output, but will say that the Runbook failed to run 3 times.4.2KViews0likes1CommentAzure Automation VM Start and Stop in Python runbook
Hello , We are trying to do VM Start and Stop by using Python. And we did for single VM and we tested it in Azure Portal, It was successfully done both start and stop. Now we have to do for Multiple VMS, start and stop. Can anyone please help us to do for multiple VMS, start and stop in Python. Please find the attached script for the single VM. source from - https://docs.microsoft.com/en-us/azure/automation/automation-first-runbook-textual-python2 Python Script: import os import traceback import os import sys from azure.mgmt.compute import ComputeManagementClient import azure.mgmt.resource import automationassets def get_automation_runas_credential(runas_connection): from OpenSSL import crypto import binascii from msrestazure import azure_active_directory import adal # Get the Azure Automation RunAs service principal certificate cert = automationassets.get_automation_certificate("AzureRunAsCertificate") pks12_cert = crypto.load_pkcs12(cert) pem_pkey = crypto.dump_privatekey(crypto.FILETYPE_PEM,pks12_cert.get_privatekey()) # Get run as connection information for the Azure Automation service principal application_id = runas_connection["ApplicationId"] thumbprint = runas_connection["CertificateThumbprint"] tenant_id = runas_connection["TenantId"] # Authenticate with service principal certificate resource ="https://management.core.windows.net/" authority_url = ("https://login.microsoftonline.com/"+tenant_id) context = adal.AuthenticationContext(authority_url) return azure_active_directory.AdalAuthentication( lambda: context.acquire_token_with_client_certificate( resource, application_id, pem_pkey, thumbprint) ) # Authenticate to Azure using the Azure Automation RunAs service principal runas_connection = automationassets.get_automation_connection("AzureRunAsConnection") azure_credential = get_automation_runas_credential(runas_connection) # Initialize the compute management client with the RunAs credential and specify the subscription to work against. compute_client = ComputeManagementClient( azure_credential, str(runas_connection["SubscriptionId"]) ) # Resource Group resource_group_name = str(sys.argv[1]) vm_name = str(sys.argv[2]) # Start the VM print('\nStart VM') async_vm_start = compute_client.virtual_machines.start(resource_group_name, vm_name) async_vm_start.wait() In the below mentioned screen shot, if we enter the multiple parameter/VM name, it is taking only the first name (parameter/VM name) Please Suggest.11KViews0likes0CommentsEnable automated auditing of resource groups without owner tag - Create Runbook
Hello Guys, I want to see the Resource Groups without owner Tag with the help of run book if possible. Basically IF we can create the run book for this so that I can do the automated auditing of resource groups without owner tag. Could someone help me creating the Run book please. Regards, Sachin628Views0likes0Comments