Azure / Azure/azure-powershell

Register-AzureRmAutomationScheduledRunbook parameters was not input correctly

Open
#3,354 5 comments 0 reactions 1 assignee Claimed by @Bpoe View on GitHub
act-codegen-extensibility-squad Automation automation-cheetah customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Cmdlet(s)
Register-AzureRmAutomationScheduledRunbook

### PowerShell Version
5.1.14393.206

### OS Version
10.0.14393.206

### Description
When I use Register-AzureRmAutomationScheduledRunbook to create a Runbook's cedule parameters in portal contain quotes see file to screenshot. This make my workbook to fail.

![capture](https://cloud.githubusercontent.com/assets/8504152/21427372/39cfc2ca-c822-11e6-84d3-8429a6b59762.PNG)

### Debug Output

```
HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/c7d3e3e4-bd2a-44e2-9ed0-03b2b38c78b7/resourceGroups/MyAzureAutomationProd/providers/Microsoft.Automation/automationAccounts/MyAutomationProd/jobSchedules/4676249d-1a82-4ac2-a863-99229f7feecb?api-version=2015-10-31

Headers:
Accept : application/json
x-ms-version : 2014-06-01

Body:
{
"properties": {
"schedule": {
"name": "CeduleAutoExport"
},
"runbook": {
"name": "AutoExport"
},
"parameters": {
"sqlDatabaseName": "\"myDb\"",
"SqlServerName": "\"myServer\"",
"sqlUserName": "\"myDbUser\""
}
}
}
```

### Script/Steps for Reproduction

You need

- Automation account
- Runbook named AutoExport
- Parameters of type [string] in the RunBook
- SqlServerName
- SqlDatabaseName
- SqlUserName

Login-AzureRmAccount

$params = @{"SqlServerName"="myServer";"SqlDatabaseName"="myDb";"SqlUserName"="myDbUser"}

Register-AzureRmAutomationScheduledRunbook `
-Name "AutoExport" `
-ResourceGroupName "myAzureAutomation" `
-AutomationAccountName "myAutomation" `
-ScheduleName "mySchedule" `
-Parameters $params `
-ErrorAction Stop;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.