-1

我正在尝试打开与ssas 服务器的连接并执行dmv 查询,以便通过 Azure Automation Account 中的 powershell Runbook 提取表数据

我已经编写并测试了一个似乎在我的本地机器上运行良好的 powershell 脚本,但是当我在上运行相同的脚本作为 azure runbook 时,似乎无法打开连接。

我使用此代码打开与 ssas 的连接:

 $connectionString = "Provider=msolap; Data Source=asazure://westeurope.asazure.windows.net/servername;User Id={0};Password={1}; Initial Catalog=DataModel" -f $ssasUser, $ssasPassword;
    
 ## Connect to the data source and open SSAS
 $connection = New-Object System.Data.OleDb.OleDbConnection $connectionString
 $connection.Open()

我似乎无法打开连接,因为我运行此代码时收到以下错误

 System.Management.Automation.MethodInvocationException: Exception calling "Open" with "0" argument(s): "The .Net Framework Data Providers require Microsoft Data Access Components(MDAC).  Please install Microsoft Data Access Components(MDAC) version 2.6 or later."

在网上搜索,我发现的唯一解决方案似乎是简单地下载并安装 MDAC sdk,但这在云上运行时无法完成。

我需要帮助来修复此错误或找到替代解决方案。谢谢你。

4