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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors