azure-automation

Starting Runbook via Azure API, Portal, or ISE Add-On yields “input parameter type mismatch” error

∥☆過路亽.° 提交于 2020-01-06 20:13:01
问题 Given a simple runbook: workflow test { [CmdletBinding()] param([string] $NumericString) write-output $NumericString } When starting it with a numeric value (ie: 5) via the Azure Portal as a new Job (published), via the Test Pane, or using the Azure Automation PowerShell ISE Add-On, the following error is returned and the execution Fails. [edit] Just out of curiosity I tried some other values. 'true' or 'false' (without quotes in ise/the ui) will also cause the error (and are sent to the API

Get-AzureRmAppServicePlan and Get-AzureRmWebApp return exceptions in Runbook

隐身守侯 提交于 2020-01-03 17:04:17
问题 I'd like to get all properties with Get-AzureRm* commands in Automation Runbook, but the followings return exception. How to code so as to work these commands properly? Returns exception Get-AzureRmAppServicePlan Get-AzureRmWebApp Returns expected result Get-AzureRmStorageAccount input - Powershell Runbook (not Workflow) Write-Output $PSVersionTable $resourceGroupName = "(snipped)" $appServicePlans = Get-AzureRmAppServicePlan -ResourceGroupName $resourceGroupName $Cred = Get

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

Stop-AzureVM does not shutdown my Azure-VM (Runbook)

戏子无情 提交于 2019-12-25 01:39:48
问题 Hy I've an Azure VM with Visual Studio installed. When I run the Shutdown script (Runbook)from here: https://gallery.technet.microsoft.com/scriptcenter/Stop-Azure-Virtual-Machine-0b1fea97 Script Status says it is completed but it did not shut down my VM. Output says Shutting down but nothing happens. Any suggestions on this? Thanks for your Help. Peter 回答1: I would suggest you few things- a. Most imp- Go to ASSET tab and add proper windows powershell credentials (simply you can use username

Azure automation: Authentication succeeds but no subscriptions are returned, works in local powershell though

倖福魔咒の 提交于 2019-12-24 19:19:49
问题 Having a problem with creating an azure automation runbook that will copy a database on demand; I've created a credential and stored the u/p of the account I use to log into the portal in it. Password was written in notepad and pasted in to ensure correct. $Cred = Get-AutomationPSCredential -Name 'automationCredential' Write-Output "UN: $($Cred.Username)" Write-Output "PW: $($Cred.Password.Length)" Add-AzureRmAccount -Credential $Cred Write-Output "Deleting the old $TargetDatabaseName" Remove

Azure Runbook Start/Stop Schedule Lists

纵然是瞬间 提交于 2019-12-24 10:26:34
问题 I've set up a Runbook using the Start/Stop templates from the Gallery. All set up, no errors, no warnings. Why don't any of the schedules appear under the "Schedule Runbook" but appear elsewhere in the Azure portal? Runbook_Blade Scheduler_List 回答1: Why don't any of the schedules appear under the "Schedule Runbook" but appear elsewhere in the Azure portal? Because you create the autoStopVM schedule in Azure Automation Account, this schedule just a time settings, not associate any runbook with

New-PSSession in an Azure-runbook: Access denied (ARM)

家住魔仙堡 提交于 2019-12-24 09:58:25
问题 With the advice provided in this answer I was able to set up the winrm on a Azure VM(1). Right now, I can open a PS-Session with New-PSSession from any Azure VM(2) to the Azure VM(1) my local machine which to the Azure VM(1) But if I do exactly the same within an Azure runbook, $cred = Get-AutomationPSCredential -Name "admin" InlineScript { $vmSession = New-PSSession -ConnectionUri 'https://xxx.yyy.cloudapp.azure.com:5986' -Credential $cred -SessionOption (New-PSSessionOption -SkipCACheck

How do I automatically install New Relic extension using Azure ARM Template?

て烟熏妆下的殇ゞ 提交于 2019-12-23 17:10:10
问题 I am using a azure arm template to create a web app in azure. Now I need to install New Relic Extension in the webapps which will be created using this template. So I was unable to find specific json format. Please help me out! 回答1: Please have a try to add the json code snipped in the ARM template. "resources": [ { "apiVersion": "2015-08-01", "name": "NewRelic.Azure.WebSites", "type": "siteextensions", "dependsOn": [ "[resourceId('Microsoft.Web/Sites', variables('webSiteName'))]" ],

How to AcquireToken with PromptBehavior in the latest Microsoft.IdentityModel.Clients.ActiveDirectory

ⅰ亾dé卋堺 提交于 2019-12-22 06:49:46
问题 In the older versions of Microsoft.IdentityModel.Clients.ActiveDirectory there is AcquireToken with PromptBehavior parameter var context = new AuthenticationContext("https://login.windows.net/tenantId"); var result = context.AcquireToken(clientId: clientIdValue, redirectUri: new Uri("http://localhost/Appcycle"), resource: "https://management.core.windows.net/", promptBehavior: PromptBehavior.Auto); In Microsoft.IdentityModel.Clients.ActiveDirectory v3.10 there is only AcquireTokenAsync var

Active Directory Password Connection Azure SQL Failure from Azure Automation

微笑、不失礼 提交于 2019-12-20 03:52:29
问题 I need to connect via Azure Automation to an Azure SQL Server using my Azure Active Directory Admin account that is set as the Azure SQL Server AZ AD Admin. I am able to connect to Azure SQL: Using SSMS with the Azure AD Admin Account Using the PowerShell ISE with the Azure AD Admin Account in a SQL ConnectionString Using Azure Automation with the Azure SQL Admin account (the one created when a new Azure SQL Server is created) in a SQL ConnectionString However, when attempting to connect to