首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用-ASCmd:身份验证失败:当用户界面不可用时,需要用户ID和密码

调用-ASCmd:身份验证失败:当用户界面不可用时,需要用户ID和密码
EN

Stack Overflow用户
提问于 2020-09-21 17:50:27
回答 2查看 1.9K关注 0票数 3

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

代码语言:javascript
复制
$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""
      }
    }
  }
}" 
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-09-23 05:25:27

代码语言:javascript
复制
Import-Module Azure.AnalysisServices
$azureappid ="tesappid"
$azureTenantId= "testid"

[ValidateNotNullOrEmpty()] $userPassword = "testpwd"

$userPassword = ConvertTo-SecureString -String $userPassword -AsPlainText -Force
$userCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $azureappid, $userPassword
    
Add-AzureAnalysisServicesAccount -RolloutEnvironment 'eastus.asazure.windows.net' -Credential $userCredential -TenantId $azureTenantId  -ServicePrincipal 

Invoke-Ascmd ....
票数 1
EN

Stack Overflow用户

发布于 2020-09-22 03:53:23

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

代码语言:javascript
复制
$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)
    
Add-AzureAnalysisServicesAccount -RolloutEnvironment 'eastus.asazure.windows.net' -Credential $psCred -TenantId $azureTenantId  -ServicePrincipal 

Invoke-ASCmd ...

有关更多信息,请查看文档添加-AzureAnalysisServicesAccount Add。请参见类似的线程

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

代码语言:javascript
复制
Invoke-ASCmd -Server "" -Database "" -Credential $psCred -TenantId $azureTenantId -ServicePrincipal -Query ""
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63997541

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档