How to use ADOMD in Azure Automation Powershell Runbook?

Karthika Ganesamoorthi 20 Reputation points
2023-10-27T06:16:51.58+00:00

Hi,

I'm having a powershell script which is doing single table refresh for PowerBI dataset and it is working fine in my local system. I want to automate it using Azure Automation Account Runbook.

My code contains:

New-Object Microsoft.AnalysisServices.AdomdClient.AdomdConnection

For this I'm Zipping my Microsoft.AnalysisServices.AdomdClient.dll and uploading in Azure Automation Modules.ModuleImport

There, is only one file inside my zip file

InsideZip

The module is successfully imported. But there is nothing inside the module. Is it common for dll file or not I'm not sure.

InsideModule

I also tried to store this zip file into my blob container and using cloudshell I tried to uploaded the file to automation module. But it gave the error as, This file contains unreadable extension .dll and failed.

So directly I'm uploading from my local, Import is successfull.

I want to use this in my powershell script. I'm using the path as

Add-Type -Path "C:\Modules\User\Microsoft.AnalysisServices.AdomdClient\Microsoft.AnalysisServices.AdomdClient.dll"

This is the error am getting.

error

I'm not able to find how to achieve this.

Can anyone pls give some clear idea on how to use this assembly into my code.

Thank you in Advance.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
Windows for business | Windows Server | User experience | PowerShell
{count} votes

Answer accepted by question author
  1. tbgangav-MSFT 10,431 Reputation points Moderator
    2023-10-31T15:20:34.5966667+00:00

    Hi @Karthika Ganesamoorthi ,

    Hope the issue with the error shown in this question is resolved as you have mentioned here.

    To answer your question on "The module is successfully imported. But there is nothing inside the module. Is it common for dll file or not I'm not sure.", yes, in this case it is common to not have anything inside the module under the Activities section because the zip file which is imported or added as Custom PowerShell module is not having all required files in required format. For more information with regards to it, refer this, this and this documents.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.