Questions tagged [azure-automation]
Azure Automation handles the creation, deployment, monitoring, and maintenance of Azure resources and third-party applications. It uses uses Windows PowerShell scripts or Azure Runbooks to achieve this.
868
questions
0
votes
2
answers
21
views
I am unable to set an email alias in an Azure Runbook
I have a need to create email aliases for exchange accounts. I am attempting to do this with an Azure Automation Runbook.
Connect-ExchangeOnline -ManagedIdentity -Organization "myorg.onmicrosoft....
0
votes
1
answer
12
views
Azure Automation Account & Runbooks ARM Template, uri problem?
i need to deploy Storage Automation Account & 5 runbooks using ARM templates & Azure Devops Pipeline.
I created dev.parameters.json. Here are contents of file.
{
"$schema": "...
0
votes
1
answer
35
views
How do I add child resources when the parent resource was created inside a Bicep module
I have this Bicep code...
param location string = resourceGroup().location
module autacc './../bicepmodules/BICEP/modules/automationAccount.bicep' = {
name: 'automationaccount'
params : {
...
0
votes
1
answer
33
views
How do you turn Managed Identity on an Azure Automation Account with either the cli or rest
We have many scripts that manage our Azure environment. They are PowerShell scripts that use the az CLI to manipulate Azure.
We have Runbooks that use 'Run-as' accounts and we want to switch them to '...
0
votes
1
answer
107
views
Azure Automation PowerShell Error "Assembly with same name is already loaded"
I have a script that runs locally but I can't make it run on Azure Automation cloud.
This script records data to the Azure blob and the error is related to the Az module that is the default in Azure ...
0
votes
1
answer
49
views
In Azure how to join a VM to the Update Manager (automation account) as a post provisioning step from PowerShell?
I'm trying to automate the onboard process of a VM in the Update Manager (automation account) as a post provisioning step from PowerShell.
Make the test with 4 VMs. I onboarded 2 of them manually from ...
0
votes
1
answer
29
views
Passing multi-line KQL query to Az PowerShell cmdlet - error parsing query
Trying to pass a KQL string as parameter to cmdlet inside an Azure Automation Powershell 5.1 Runbook. But seems here-doc is giving error.
Please note need to avoid error-prone way of escaping each ...
0
votes
1
answer
34
views
How to Store Azure VM Snapshot from one subscription into an RG of another subscription via PS Runbook
I am taking OS and Data disk Snapshots of VM's part of an array of declared subscriptions, but want to store it in an RG which is part some other subscription (in the same tenant).
Within foreach loop ...
1
vote
1
answer
71
views
Identify Storage Accounts that are not having any resources like tables, containers.. using Python Sdk
List the storage accounts that are not having containers,tables,queues,fileshares using python sdk on azure automation account python version 3.8. Below is the script which im trying to get the same ...
0
votes
1
answer
31
views
Finding duplicate hybrid workers and delete them
I noticed that some of our (meaning if not all) have duplicate Hybrid workers on our servers which can lead to issues during patching (hybrid workers are doing patching in Azure).
I have now created ...
0
votes
1
answer
52
views
How to avoid the 1GB $env:TEMP) in Azure Automation Powershell
I'm having a problem in a Powershell Runbook. We scan the O365 AuditLogs and write the results to disk, up to this moment we userd the $env:TEMP disk.
After the scan we upload the csv files into a ...
0
votes
1
answer
68
views
Azure Python SDK ClientSecretCredential fetch the values from Azure keyvault
Unable to get the values of tenant_id, client_id,client_secret which are stored in Azure Keyvault, by using library from azure.identity import ClientSecretCredential. I have installed and imported the ...
1
vote
0
answers
75
views
Is there any way to bypass MFA Authentication for Selenium Test Cases ? apart from disabling the MFA for test account
Using Selenium when we are opening one URL and enters email id and click on submit button then the URL redirects to Microsoft login where it ask for MFA code from authenticator app. When using ...
0
votes
0
answers
28
views
list orphan disks using python sdk
Trying to get the list unattached disks/orphan disks on Azure automation account using python sdk runbook version is 3.8, getting error as ** Failed
Traceback (most recent call last): File "C:\...
0
votes
1
answer
73
views
Azure Automation unable to transfer files to storage account
I am attempting to have an Azure Automation account export a .CSV to a Storage Account however I am running into a significant amount of trouble doing so. As most documentation says to use AzureRM and ...
0
votes
0
answers
26
views
Azure Auto update Management
We are doing a POC on Azure Arc servers. We have successfully onboarded one onprem server to Azure Arc successfully. Now we need to configure auto update management for which we have scheduled a ...
0
votes
1
answer
137
views
Unable to connect-AZAccount in Azure Automation with a Service Principal
I have an Azure Automation Runbook that needs to Connect-AzAccount to export a CSV from the Automation Account to a Blob Storage Account. My Service Principal has an ApplicationID and a Secret. per ...
1
vote
1
answer
101
views
What level of Permission requires to enable MFA on Azure AD
Need to enable MFA on Azure AD to the users accounts which iam creating using powershell through Automation account which will runs on Hybrid Worker, so when the user is created will set the timer for ...
0
votes
1
answer
46
views
Azure PowerShell Runbook - Error output details column empty
I have an Azure PowerShell 7.1 runbook in an automation account that is executing as expected. The only issue I have is that my Error Output within the running job screen is always missing the details ...
0
votes
1
answer
97
views
Enabling OMS Agent monitoring on aks machines
we are looking for a solution to setup the alert when OMS agent stopped on AKS
machines, through azure monitor, however we could not find any query or solution which
can monitor the oms agent process ...
0
votes
1
answer
169
views
Trouble using Microsoft.Graph with Azure Automation Runbooks
I'm working on integrating Microsoft.Graph functionality in Azure Automation Runbooks with Powershell, but I keep encountering an error when trying to connect to Microsoft.Graph in the runbook itself. ...
-1
votes
2
answers
51
views
Is there a pattern for including Release Pipelines in Azure Dev Ops via Source Control and Automation?
Our team uses Azure Dev Ops for our source control and release pipelines. The release pipelines are not included in our source control and are created through ADO UI. These can be very complex; I ...
0
votes
2
answers
125
views
Find/list the Unused storage accounts in azure using powershell
Trying to get the list of unused/inactive storage accounts in azure using powershell. Below is my script which im trying it will provide the storage account name and last modified date of your Azure ...
1
vote
2
answers
115
views
Azure Automation powershell runbook hung up issue
I am creating an Azure Automation account having a powershell runbook. The script is simply looping over each VM in a resource group and deleting all files under a particular folder.
$ResourceGroup = '...
0
votes
1
answer
119
views
Export a CSV from Azure Automation to Microsoft Teams instead of blob storage?
I am attempting to run a daily report with Azure Automation that will produce a CSV. Per Microsoft's documentation this report can be exported to Azure blob storage. However I was curious if it is ...
0
votes
1
answer
149
views
How to overcome WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2?
I have provided my code and JSON format below. I'm using Powershell runbook to retrieve the values from this json. But I am facing error. How can I fix it?
My JSON:
{"hunting": [
{
&...
0
votes
1
answer
95
views
How to create a schedule which triggers the runbook using PowerShell command?
I'm trying to create a schedule to trigger a runbook using PowerShell commands in Azure Automation account. Runbook is taking resourcevariable which is an automation variable as an input parameter.
I ...
-1
votes
1
answer
114
views
Can we call a runbook from another runbook in Powershell?
I'm having two runbooks of two different Powershell versions (5.1, 7.1). How to call a runbook (7.1) from runbook (5.1)?
Modules used:
AZ-SecurityInsights - 5.1 version (runbook 5.1)
AzSentinel - 7.1 ...
0
votes
1
answer
87
views
How can we take user inputs in azure runbooks using powershell? does It supports user interaction?
I have a PS script that register's an app in Azure AD. I want to add redirect URLs using ps script. I tried to take user inputs like,
$uri = Read-Host -Prompt "enter URI"
but this didn't ...
0
votes
1
answer
176
views
Azure Automation Account: Setup Update management for Azure VMs
I have created a Windows VM in Azure and configured the diagnostics settings pointing to a log analytics workspace.
Below is the VM module
resource "azurerm_windows_virtual_machine" "...
-1
votes
1
answer
32
views
How to Fix "The program is blocked by Group policy " issue while executing the .exe in Azure Automation (Powershell runbook)
I have a runbook which uses C# dll as module. This C# code starts the process(.exe) internally. which is not working in Azure automation(powershell runbook). can someone please help me with this.
I ...
0
votes
1
answer
101
views
Stop an Azure Function App by using Runbook
I have an Azure Function app running which I need to stop and start on a schedule.
tried to automate it by Azure Automation Account using Runbook with PowerShell script.
Will a single line of command ...
0
votes
0
answers
49
views
ADO - How do I call different parameters for a script depending on the context? / RUN THE SAME SCRIPT w/Dynamic Parameters according to the context
AZURE ADO
I am working currently on a script to automate clean up unused storage accounts from Azure. This script would run on a Runbook. There are 4 subscriptions specifically created to contain ...
0
votes
2
answers
540
views
How to connect with Storage account in Azure automation runbook
In Azure automation runbook I want to connect with storage account and get the context without the account key. I can connect with the storage account key but I don't want to connect with storage key.
...
0
votes
2
answers
40
views
How do I parse Kusto Query output into Automation Script (Powershell or Python)
I have a Kusto query that will output for me processes from my VMs (whether they are stopped or not).
Here is the query:
ConfigurationData
| project Computer, SvcName, SvcDisplayName, SvcState, ...
-1
votes
2
answers
83
views
Downgrading Azure Resources during weekends using PowerShell Automation
In order to save expenses in Azure DevOps, I'm trying to scale the resources, which can scale depending on the requirement. Team leads will update the resource requirements in SharePoint, and the ...
0
votes
1
answer
154
views
Azure Automation / Runbooks / Authentication
I would like to run a Azure Automation Runbook (PowerShell) and run
connect-PnPOnline or connect-MicrosoftExchange
clientid & clientsecret will be deprecating
User is MFA enabled
Can't I connect ...
-1
votes
1
answer
63
views
Can I reuse my Azure DevOps agents with Azure Automation?
My VMs all have Azure DevOps agents installed on them to automate deployments. We have a need to automate runbook tasks on these agents as well, and are investigating Azure Automation as a solution.
...
0
votes
1
answer
86
views
Bicep add parameters to Automation Account Job Schedule
Bumping up against Bicep documentation as usual. I can't seem to find any help on how to add parameters to a Job Schedule for an Automation Account Runbook.
Example from MS is
name: 'string'
...
0
votes
1
answer
75
views
Terraform - how to disable azure automation schedule
How do I disable an azure automation job via terraform? I have all the resources defined/applied via terraform, and when I disable the schedule via UI, terraform plan does not show any changes and I ...
0
votes
1
answer
117
views
Python function not executing in azure automation runbook
I am working on writing a function in python azure automation runbook, where the basic gist of what I'm trying to accomplish is shown in the code below. But, I'm perplexed as when I take the code out ...
0
votes
1
answer
100
views
If/then statement for Powershell to check Azure Automation Runbook Schedule
I am stumped on what exactly I am missing here. I am trying to author a script to check if a schedule is enabled or not enabled in an Azure Automation Account, and then take an action with an if/then ...
1
vote
3
answers
98
views
New-AzResourceLock: A positional parameter cannot be found that accepts argument
When iam trying to create lock using powershell Azure automation runbook by using below script
New-AzResourceLock -LockName test -LockLevel CanNotDelete -ResourceGroupName rg -ResourceName resorcename ...
0
votes
1
answer
83
views
Terraform import runbook to Azure Automation Account from PSGallery
I'm trying to import a runbook from the PS Gallery with a Terraform script. The script and the Azure API both throw no errors and a runbook is created as expected. The problem is, the content of the ...
0
votes
1
answer
51
views
Can not run browser automation with head on hybrid worker using Azure Automation
When I start the runbook with the following test code, it is completed and shows the result but I cannot see the browser UI while it is running.
from time import sleep
from selenium import webdriver
...
2
votes
0
answers
78
views
azure automation runbook python parameter and path on data lake
I'm working on generating json schema documents based on json documents we import from our vendors and partners.The below code works fine. But, now as I'm working on building on it to create a module ...
0
votes
1
answer
114
views
Architecture decisions relating to multiple Automation Accounts per subscription
As an MSP, we manage multiple customer subscriptions through Azure Lighthouse.
Historically we've used a single Automation Account per subscription to contain solutions such as runbooks related to the ...
0
votes
1
answer
301
views
Set-AzKeyVaultAccessPolicy: Operation returned an invalid status code 'NotFound'?
I'm following an educative course, where i need to put the webhook in the Azure Key Vault.
When i run below on powershell
New-AzKeyVault -Name "dev-avm-kvz" -ResourceGroupName "shared-...
0
votes
1
answer
73
views
is there any rest api url for get all virtual machine compliance status?
I am using this api url for getting virtual machine compliance status, however its giving me 202 Accepted response.
I have attached image for reference, I wanted to get these information through api.
-1
votes
1
answer
59
views
How to trigger an Azure Policy from an Azure Runbook
How can we trigger an Azure Policy from an Azure Runbook? example - to may be stop provisioning of resources in a subscription temporarily.
I have basically created an Budget Action Group to an Azure ...