gpt4 book ai didi

powershell - 调用-ASCmd : Authentication failed: User ID and Password are required when user interface is not available

转载 作者:行者123 更新时间:2023-12-04 14:11:20 44 4
gpt4 key购买 nike

我正在尝试使用 Azure DevOps 通过 CICD 刷新(已经)部署的表格模型的凭据。在 PowerShell 中使用 Invoke-ASCmd 刷新凭据。当我提供租户 ID、应用程序 ID 和 key 时,脚本在本地运行良好。但是,当我从 Azure Devops 运行它并出现错误时它失败了 - 当用户界面不可用时需要用户 ID 和密码。这是脚本:

$azureTenantId= "TenantId"
$azurePassword = ConvertTo-SecureString "Key" -AsPlainText -Force
$azureAplicationId ="AppID"

$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)
Connect-AzAccount -Credential $psCred -TenantId $azureTenantId -ServicePrincipal

Invoke-ASCmd `
-Server "AnalysisServerName" `
-Database "AdventureWorks" `
-Query "{
""createOrReplace"": {
""object"": {
""database"": ""AdventureWorks"",
""dataSource"": ""AzureBlobs/https://abc blob core windows net/""
},
""dataSource"": {
""type"": ""structured"",
""name"": ""AzureBlobs/https://abc blob core windows net/"",
""connectionDetails"": {
""protocol"": ""azure-blobs"",
""address"": {
""account"": ""abc"",
""domain"": ""blob.core.windows.net""
},
""authentication"": null,
""query"": null
},
""credential"": {
""AuthenticationKind"": ""Key"",
""kind"": ""AzureBlobs"",
""path"": ""https://abc.blob.core.windows.net/"",
""PrivacySetting"": ""Organizational"",
""Key"": ""Key""
}
}
}
}"

最佳答案

您可以尝试使用 Add-AzureAnalysisServicesAccount 登录到 Azure Analysis Services 服务器实例。见下文:

$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)

Add-AzureAnalysisServicesAccount -RolloutEnvironment 'eastus.asazure.windows.net' -Credential $psCred -TenantId $azureTenantId -ServicePrincipal

Invoke-ASCmd ...

检查文档Add-AzureAnalysisServicesAccount想要查询更多的信息。看到这个类似的 thread .

您还可以尝试为 Invoke-ASCmd 命令提供凭据:

Invoke-ASCmd -Server "" -Database "" -Credential $psCred -TenantId $azureTenantId -ServicePrincipal -Query ""

关于powershell - 调用-ASCmd : Authentication failed: User ID and Password are required when user interface is not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63997541/

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