In the Windows Azure portal, from my automation accounts (Automation accounts > myAutomation > Runbooks > MyRunbook > Edit PowerShell workflow Runbook > Test), I'm trying to test a powershell script with the Azure Resource Manager library, for migrations purposes. I wrote a small piece of a powershell script and tested it in the test pane. I'm facing an error message:
The term 'New-AzureRmHDInsightHiveJobDefinition' 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, verify that the path is correct and try again.
I want to test it directly from the Windows Azure Portal because I need to use some result of function like "Get-AutomationPSCredential".
PowerShell script sample
workflow Runbook_Test
{
param(
[parameter(Mandatory=$True)]
[string] $HDInsightAdminCredendialsName
)
$hdInsightCredentials = Get-AutomationPSCredential -Name $HDInsightAdminCredendialsName
InlineScript {
$creds = $using:hdInsightCredentials
$clusterName = 'clusterName'
$query = 'A QUERY INSIDE'
$jobDef = New-AzureRmHDInsightHiveJobDefinition -Query $query;
$hiveJob = Start-AzureRmHDInsightJob -JobDefinition $jobDef -ClusterName $clusterName -HttpCredential $creds
Wait-AzureRmHDInsightJob -JobId $hiveJob.JobId -ClusterName $clusterName -HttpCredential $creds
}
}
I have the same issue with cmdlet "Start-AzureRmHDInsightJob" and "Wait-AzureRmHDInsightJob". It's like azure portal don't recognize the ARM library.
For sure I'm miss something, but what? :) Thanks for your help.