azure-runbook

Invoke-AzVMRunCommand and Start-Process under specific user on remote VM using Azure Runbook

大憨熊 提交于 2020-05-17 08:29:44
问题 I need to run Start-Process on a remote VM with specific user account using Azure Powershell Runbook function Install-Postgres { $username = "aact-import-vm1\aact-importer" $password = "ChangeMe!" $cred = New-Object System.Management.Automation.PSCredential -ArgumentList ` @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force)) write-output $cred # run pg installer Start-Process "C:\Program Files\WindowsPowerShell\Modules\Install-Postgres\postgresql.exe" -ArgumentList ` "-

Azure Runbook - Get a file from Azure File System Storage

耗尽温柔 提交于 2020-01-02 07:22:07
问题 I am creating a Azure workflow runbook wherein I have to get a file from Azure File System Storage and publish that to a azure web app. I tried with New-PSDrive but that command is not supported in runbook (even InlineScript doesn't work). Could anyone help me with the script. In the below code I need to populate file path from azure file system. $Conn = Get-AutomationConnection -Name AzureRunAsConnection Connect-AzureRmAccount -ServicePrincipal -Tenant $Conn.TenantID ` -ApplicationId $Conn

Azure Runbook can't modify Azure AD application

我怕爱的太早我们不能终老 提交于 2019-12-24 10:16:39
问题 I'm trying to execute this in an Azure Automation runbook $app = Get-AzureADApplication -ObjectId $ApplicationId $appRole = New-Object Microsoft.Open.AzureAD.Model.AppRole $appRole.AllowedMemberTypes = New-Object System.Collections.Generic.List[string] $appRole.AllowedMemberTypes.Add("User"); $appRole.DisplayName = $TenantName + " Users" $appRole.Id = New-Guid $appRole.IsEnabled = $true $appRole.Description = "Users of the tenant" $appRole.Value = $TenantName $app.AppRoles.Add($appRole) Set

Azure Automation: Parse WEBHOOKDATA with a python runbook

送分小仙女□ 提交于 2019-12-11 18:46:27
问题 In azure automation, when you define a webhook for a runbook the headers of the request are passed to the runbook via the WEBHOOKDATA input parameter. For python workbooks, the parameter is passed as first argument to the script. For example, here is a runbook: import json import sys print(sys.argv) if len(sys.argv) > 1 : test = json.loads(sys.argv[1]) print(test) Here is the input parameter WEBHOOKDATA {"WebhookName":"python-Test-Arguments","RequestBody":"","RequestHeader":{"Cache-Control":

Azure runbook for docker container

我是研究僧i 提交于 2019-12-11 18:43:22
问题 writing azure runbook for pushing docker image to acr. When i am running script i am getting error docker is not recognized as internal or external command. Simplified runbook as below. Import-Module hosts Import-Module docker Invoke-dockercommand -v docker -v When i run above nunbook i am getting below error. Docker.exe : The term 'Docker.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,