使用Azure SSAS中的自动化帐户刷新多维数据集 [英] Cube refresh with Automation Account in Azure SSAS
问题描述
我当前正在尝试创建一个自动化运行手册来处理Azure中的多维数据集.我已经尝试过多个像这样的PowerShell脚本:
$ AzureCred = Get-AutomationPSCredential-名称"RefreshTest"Add-AzureRmAccount-凭据$ AzureCred |空空Invoke-ProcessASDatabase-数据库名称"MKTGCube"-服务器"AzureServerName" -RefreshType完整"-凭据$ AzureCred
出现这种错误(尽管我安装了SQLServer模块).
Invoke-ProcessASDatabase:术语"Invoke-ProcessASDatabase"不是识别为cmdlet,函数
的名称脚本文件或可运行程序.检查名称的拼写,或者如果包含路径,请确认该路径为
正确,然后重试.
或者这个脚本:
$ connectionName ="AzureRunAsConnection"尝试{#获取连接"AzureRunAsConnection"$ servicePrincipalConnection =获取自动化连接-名称$ connectionName登录到Azure ..."Add-AzureRmAccount`-ServicePrincipal`-TenantId $ servicePrincipalConnection.TenantId`-ApplicationId $ servicePrincipalConnection.ApplicationId`-CertificateThumbprint $ servicePrincipalConnection.CertificateThumbprint}抓住 {如果(!$ servicePrincipalConnection){$ ErrorMessage =未找到连接$ connectionName."抛出$ ErrorMessage} 别的{写错误-消息$ _.Exception抛出$ _.Exception}}##获取我们之前存储的凭据.$ cred = Get-AutomationPSCredential-名称'CredMat'##提供服务器详细信息$ ServerName ="AzureServerName"调用-ProcessASDatabase-数据库名称"MKTGCube"-服务器$ ServerName -ProcessType"ProcessFull"$ error [0] .Exception.Message$ error [0] .Exception.StackTrace
显示该错误消息.
Invoke-ProcessASDatabase:身份验证失败:用户标识和密码如果用户界面不是
,则需要可用.
在第32行:1个字符
调用ProcessASDatabase-数据库名称"MKTGCube"-服务器$ ServerName ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo:未指定:(:) [Invoke-ProcessASDatabase],ArgumentException
FullyQualifiedErrorId:System.ArgumentException,Microsoft.AnalysisServices.PowerShell.Cmdlets.ProcessASDatabase
我认为问题与凭据有关,因为我们需要提供凭据来访问源数据库,但是我不知道如何通过PowerShell脚本来实现.有什么主意吗?
非常感谢.
您需要将模块 Azure.AnalysisServices
和 SqlServer
导入您的自动化帐户.
您可以从此
注意:您的脚本有误.您应该使用 Login-AzureASAccount
而不是 Add-AzureRmAccount
进行登录,您可以使用以下示例:
$ Conn = Get-AutomationConnection-名称AzureRunAsConnectionAdd-AzureAnalysisServicesAccount -RolloutEnvironment"southcentralus.asazure.windows.net" -ServicePrincipal -ApplicationId $ Conn.ApplicationID -CertificateThumbprint $ Conn.CertificateThumbprint -TenantId $ Conn.TenantID调用ProcessTable-服务器"asazure://southcentralus.asazure.windows.net/myserver" -TableName"MyTable"-数据库"MyDb" -RefreshType"Full"
有关此的更多信息,请检查此 With that kind of error (despite the fact that I installed the SQLServer module). Invoke-ProcessASDatabase : The term 'Invoke-ProcessASDatabase' 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. Or this script : With that error message. Invoke-ProcessASDatabase : Authentication failed: User ID and Password
are required when user interface is not available. At line:32 char:1 Invoke-ProcessASDatabase -databasename "MKTGCube" -server $ServerName ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Invoke-ProcessASDatabase], ArgumentException FullyQualifiedErrorId : System.ArgumentException,Microsoft.AnalysisServices.PowerShell.Cmdlets.ProcessASDatabase I think the problem is linked to the credentials because we need to provide ones to access the source database but I have no ideas on how to do it through a PowerShell script. Any idea ? Thanks a lot. You need import module You could import these two module from this link and this link. Note: There is a mistake in your script. You should use More information about this please check this blog. 这篇关于使用Azure SSAS中的自动化帐户刷新多维数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$connectionName = "AzureRunAsConnection"
try
{
# Get the connection "AzureRunAsConnection "
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
"Logging in to Azure..."
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
}
catch {
if (!$servicePrincipalConnection)
{
$ErrorMessage = "Connection $connectionName not found."
throw $ErrorMessage
} else{
Write-Error -Message $_.Exception
throw $_.Exception
}
}
##Getting the credential which we stored earlier.
$cred = Get-AutomationPSCredential -Name 'CredMat'
## Providing the Server Details
$ServerName = "AzureServerName"
Invoke-ProcessASDatabase -databasename "MKTGCube" -server $ServerName –ProcessType "ProcessFull"
$error[0].Exception.Message
$error[0].Exception.StackTrace
Azure.AnalysisServices
and SqlServer
to your automation account. Login-AzureASAccount
not Add-AzureRmAccount
to login, you could use the following example:$Conn = Get-AutomationConnection -Name AzureRunAsConnection
Add-AzureAnalysisServicesAccount -RolloutEnvironment "southcentralus.asazure.windows.net" -ServicePrincipal -ApplicationId $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint -TenantId $Conn.TenantID
Invoke-ProcessTable -Server "asazure://southcentralus.asazure.windows.net/myserver" -TableName "MyTable" -Database "MyDb" -RefreshType "Full"