Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
KoenVdB
Advocate I
Advocate I

DevOps Deployment - Error using Azure modules

Hi,

 

we're creating some powershell scripts to do different actions on workspaces

- Deploy datasets and reports

- Change parameters

- Update credentials

- ...

 

Now when i run all the code in Visual Studio Code everything is working fine. I moved everything to DevOps to do all the actions. I receive the following error when i want to get a specific workspace:

 

Get-powerbiworkspace : Attempted to access an element as a type incompatible with the array.
2021-05-29T13:28:21.8087325Z At D:\a\r1\a\PowerBI\PowerBI\DeployPowerBI.ps1:42 char:1
2021-05-29T13:28:21.8088179Z + Get-powerbiworkspace
2021-05-29T13:28:21.8088738Z + ~~~~~~~~~~~~~~~~~~~~
2021-05-29T13:28:21.8089678Z     + CategoryInfo          : WriteError: (Microsoft.Power...owerBIWorkspace:GetPowerBIWorkspace) [Get-PowerBIWorkspac 
2021-05-29T13:28:21.8179957Z    e], ArrayTypeMismatchException
2021-05-29T13:28:21.8183220Z     + FullyQualifiedErrorId : Attempted to access an element as a type incompatible with the array.,Microsoft.PowerBI. 
2021-05-29T13:28:21.8183924Z    Commands.Workspaces.GetPowerBIWorkspace

 

I also did a little test to use the Get-powerbireport for instance and this also give an error like above.

 

Now i allready found some part what is triggering this error but did not find any solution.

 

This error is triggerd when i use a "Azure PowerShell task" to do the deployment. i have choosen to use a azure powershell task because i need to retrieve also data from key vault (the credentials are stored there for the data sources)

The power bi Modules are installed and imported correctly, because the command "

Connect-PowerBIServiceAccount" is working. 

 

Another try i did is using a "powerShell Task" instead of a "Azure PowerShell task" their it is going good when i do not import the needed Azure Az modules ( AZ.Accounts and AZ.KeyVault). From the moment i import those 2 module or only one, the same error occurs.

 

Any ideas how i can fix this so we're able to use secrets stored in Azure Key vault?

 

Thanks in advance,

Koen

 

4 REPLIES 4
GilbertQ
Super User
Super User

Hi @KoenVdB 

 

I would possibly then log a support ticket for this to be looked into?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

I will create a support ticket because still did not find an accepatble solution

KoenVdB
Advocate I
Advocate I

Hi @GilbertQ ,

 

It works fine on my and also other local machines running it in different versions of Powershell. 

From the moment i move to Devops it is going wrong.

Using a Azure PowerShell task, we receive the error.

using a normal Powershell task and only importing the powerbi modules, we can do everyting in the powerbi modules, but we need the az modules for key vault access. 
From the moment we import only the 2 needed modules, it throws that error message. I also did a test en installing the full az modules before of after importing the powerbi modules. It gives allways that error message.

GilbertQ
Super User
Super User

Hi @KoenVdB 

 

I would see if you can use the normal PowerShell to get the Azure Key Vault details?

 

It would appear that Azure PowerShell is missing some of the Power BI Modules.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors