gpt4 book ai didi

powershell - 使用 Datalakestore 连接的证书执行 HDInsight 命令期间出现错误 powershell

转载 作者:行者123 更新时间:2023-12-03 03:01:52 33 4
gpt4 key购买 nike

我尝试使用 powershell 创建 HDInsight 群集,并使用 datalakestore 作为附加存储。我能够通过上传 pfx 格式的证书来使用门户创建集群。 Powershell 命令给我错误,附有屏幕截图。

New-AzureRmHDInsightClusterConfig `
| Add-AzureRmHDInsightClusterIdentity `
-ObjectID $objectId `
-AadTenantId $tenantId `
-CertificateFilePath $certificateFilePath `
-CertificatePassword $certificatePassword `
| New-AzureRmHDInsightCluster `
-ClusterName $clusterName `
-ResourceGroupName $clusterResourceGroupName `
-HttpCredential $httpCredentials `
-SshCredential $sshCredentials `
-Location $location `
-DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" `
-DefaultStorageAccountKey $storageAccountKey `
-DefaultStorageContainer $storageAccountContainer `
-ClusterSizeInNodes $clusterNodes `
-ClusterType Spark `
-Version "3.6" `
-OSType Linux

我也尝试过以下方法。

New-AzureRmHDInsightCluster `
-ClusterName $clusterName `
-ResourceGroupName $clusterResourceGroupName `
-HttpCredential $httpCredentials `
-SshCredential $sshCredentials `
-Location $location `
-DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" `
-DefaultStorageAccountKey $storageAccountKey `
-DefaultStorageContainer $storageAccountContainer `
-ClusterSizeInNodes $clusterNodes `
-ClusterType Spark `
-Version "3.6" `
-OSType Linux `
-ObjectID $objectId `
-AadTenantId $tenantId `
-CertificateFilePath $certificateFilePath `
-CertificatePassword $certificatePassword

我看到下面有一个错误。不确定缺少什么。这个错误并没有给我太多的见解(没有双关语的意思;))。 screenshot

不过,我可以在没有证书的情况下创建集群。我还希望能够提供 -CertificateFileContents 属性并传递从 azure key Vault 检索到的 byte[] 读取证书,一旦能够正常工作。任何指点都会很棒。

最佳答案

能够解决此错误。我提供的objectId是应用程序ObjectId,而当我提供与ADApp对应的服务主体的objectId时,它起作用了。

但是当我尝试提供参数 -CertificateFileContents 并输入从 keyvault 检索到的 byte[] 时,集群已创建,但用于访问 DLS 的服务主体设置未配置。不确定这里的设置出了问题。在作为参数传递之前,我将证书内容转换为字节数组。

$cert = Get-AzureKeyVaultSecret -VaultName 'keyvault' -Name $certName
$certBytes = [System.Convert]::FromBase64String($cert.SecretValueText)

New-AzureRmHDInsightCluster `
-ClusterName $clusterName `
-ResourceGroupName $clusterResourceGroupName `
-HttpCredential $httpCredentials `
-SshCredential $sshCredentials `
-Location $location `
-DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" `
-DefaultStorageAccountKey $storageAccountKey `
-DefaultStorageContainer $storageAccountContainer `
-ClusterSizeInNodes $clusterNodes `
-ClusterType Spark `
-Version "3.6" `
-OSType Linux `
-ObjectID $objectId `
-AadTenantId $tenantId `
-CertificateFileContents $certBytes

关于powershell - 使用 Datalakestore 连接的证书执行 HDInsight 命令期间出现错误 powershell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48258356/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com