Invoke-AzureRmHDInsightHiveJob:远程服务器返回错误:(404)找不到

时间:2019-01-21 14:17:55

标签: azure azure-storage hadoop2 azure-powershell hdinsight

我正在尝试使用Powershell对我的HDInsight集群运行Hive查询。 Hadoop作业成功完成,因为我可以在yarn UI中看到日志。但是Invoke-AzureRmHDInsightHiveJob命令失败,并显示以下错误。我做错了什么?

enter image description here

这是完整的代码:

$RunAsConnection = Get-AutomationConnection -Name AzureRunAsConnection;

try 
{
    $Login=Add-AzureRmAccount -ServicePrincipal -TenantId $RunAsConnection.TenantId -ApplicationId $RunAsConnection.ApplicationId -CertificateThumbprint $RunAsConnection.CertificateThumbprint -ErrorAction Stop
}
catch
{
    Sleep 10;
    $Login=Add-AzureRmAccount -ServicePrincipal -TenantId $RunAsConnection.TenantId -ApplicationId $RunAsConnection.ApplicationId -CertificateThumbprint $RunAsConnection.CertificateThumbprint
};

Set-AzureRmContext -SubscriptionId $RunAsConnection.SubscriptionID

Connect-AzureRmAccount -ServicePrincipal -Tenant $RunAsConnection.TenantID -ApplicationId $RunAsConnection.ApplicationID -CertificateThumbprint $RunAsConnection.CertificateThumbprint

$ResourceGroupName = "xxxxxx"
$StorageAccountName = "xxxxxx"
$StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName).Value[0]
$StorageAccountName -StorageAccountKey $StorageAccountKey
$StorageAccountContainer = "xxxxxx"

$clusterName = "xxxxxx"
$creds=Get-Credential -Message "Enter the login for the cluster"

Use-AzureRmHDInsightCluster -ClusterName $clusterName -HttpCredential $creds

$queryString = "select 1"

Invoke-AzureRmHDInsightHiveJob -Query $queryString -Verbose -DefaultStorageAccountName "$StorageAccountName.blob.core.windows.net" -DefaultStorageAccountKey $StorageAccountKey -DefaultContainer $StorageAccountContainer

0 个答案:

没有答案