azure-automation

Create Azure Automation Start/Stop solution through Terraform

守給你的承諾、 提交于 2020-08-10 19:39:16
问题 I'm trying to set up machines to be automatically start/stopped using the newish Azure Automation add-in (https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management) with this being set up by Terraform. I can create the automation account but I don't know how to create the start-stop functionality, can someone help fill in the blanks? 回答1: the AzureRM provider can manage aspects of runbooks. If you have a look at the documentation here. Using azurerm_automation

Scale up and scale down of azure app service plan (Based on non-business hours) using azure automation script

房东的猫 提交于 2020-06-28 04:24:07
问题 I have to Scale up and scale down of azure app service plan (Based on non-business hours) using azure automation service. I have visited lot of websites but everywhere it is about scale out or increasing/decreasing the instance count. But my requirement is I want to change app service plan from S2 to S1 and vice versa based on timings. Please help me.... 回答1: this is what you are looking for: Set-AzureRmAppServicePlan -ResourceGroupName $ResourceGroupName -Name $ServicePlanName -Location

Powershell copy-item not working with azure automation

给你一囗甜甜゛ 提交于 2020-06-17 09:43:30
问题 Trying to execute ps script on azure vm's using azure automation using the approach defined at https://stackoverflow.com/a/62258063/1014275. Script below does copy files between azure vm's. Both Vm's are in same subnet and if we run the copy-item command from VM powershell it copies the files to target VM folder. The same script executes successfully with azure automation runbooks, but without copying files. Script used: Copy-Item -Path C:\folder\sample.txt -Destination \\\VmHostname\C$

Issue on executing Invoke-AzureRmVMRunCommand on azure automation

耗尽温柔 提交于 2020-06-13 11:22:50
问题 Trying to run custom script on azure vm through azure automation run-books using Invoke-AzureRmVMRunCommand. But getting below exception InvokeAzureRmVMRunCommand begin processing with ParameterSet 'DefaultParameter'. using account id 'qwerqe-xxxxx-4fde-9f1a-3d4d92ed055c'... System.Management.Automation.Host.HostException: A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with

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 ` "-

Error while executing Pause Azure SQLDatawarehouse ps script

南笙酒味 提交于 2020-03-25 18:52:12
问题 I am using Automation Account with execution of PowerShell Runbook for Pausing my Azure Datawarehouse database. Setup is completed with creation of crendentials, certificate for Thumbprints. When I executed the PS script and completed with error message No Azure SQL Data Warehouse named ADWPOC exist on SQL Server At SuspendOrPauseAzureSQLDataWarehouse:72 char:72 + + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands

Automation account rerun, a jobshedule already exist

╄→尐↘猪︶ㄣ 提交于 2020-01-25 10:14:16
问题 I have created a CD pipeline in Azure DevOps that will deploy an Azure Automation account and a runbook , shedule , jobshedule through ARM templates. All working fine except when rerunning the template. My template is a part of a large deployment process that is still under construction so until the total scope is finished the ARM template that creates the runbook, shedule, jobshedule will rerun with every release. The problem right now is the following: Whenever I rerun the template with a

Azure runbook powershell script to copy all webapp settings

℡╲_俬逩灬. 提交于 2020-01-06 22:03:30
问题 I am trying to run the following script as a runbook to copy all settings from one webapp to another but I get the following error. try { $acct = Get-AzureRmSubscription } catch { Login-AzureRmAccount } $fromResourceGroup = 'resourceG1' $fromSite = 'website1' $toResourceGroup = 'resourceG2' $toSite = 'website2' $props = (Invoke-AzureRmResourceAction -ResourceGroupName $fromResourceGroup -ResourceType Microsoft.Web/sites/Config -Name $fromSite/appsettings -Action list -ApiVersion 2015-08-01

Azure runbook powershell script to copy all webapp settings

依然范特西╮ 提交于 2020-01-06 22:00:58
问题 I am trying to run the following script as a runbook to copy all settings from one webapp to another but I get the following error. try { $acct = Get-AzureRmSubscription } catch { Login-AzureRmAccount } $fromResourceGroup = 'resourceG1' $fromSite = 'website1' $toResourceGroup = 'resourceG2' $toSite = 'website2' $props = (Invoke-AzureRmResourceAction -ResourceGroupName $fromResourceGroup -ResourceType Microsoft.Web/sites/Config -Name $fromSite/appsettings -Action list -ApiVersion 2015-08-01