maikvandergaag / msft-extensions

Repository for extensions mainly used for Azure DevOps Extensions
https://msftplayground.com
MIT License
126 stars 81 forks source link

Expanding the TabularEditor zip file causes error after first run #470

Closed daj102 closed 1 year ago

daj102 commented 1 year ago

I'm trying to use the PowerBIActions module (v 5.4.39) on a self-hosted Azure DevOps runtime. I'm trying to publish a Power BI tabular model to Power BI. It works the first time, but it then fails every time after, unless I go in and remove the task completely before running.

The error message is this:

Starting: Publish Power BI model C:\agent\_work\27\BuildPipeline\PowerBiModels\TSPTabularModels\ProjectScores\Model.bim to TDW Dev
==============================================================================
Task         : Power BI Actions
Description  : Release Task Power BI Actions
Version      : 5.4.39
Author       : Maik van der Gaag
Help         : 
==============================================================================
Starting Power BI Actions extension
### Required Module is needed. Importing now...
### Trying to import the incorporated module for PowerBI
Done processing Power BI Actions
##[error]Failed to create file 'C:\agent\_work\_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\license-FastWildcardMatching.txt' while expanding the archive file 'C:\agent\_work\_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\TabularEditor.zip' contents as the file 'C:\agent\_work\_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\license-FastWildcardMatching.txt' already exists. Use the -Force parameter if you want to overwrite the existing directory 'C:\agent\_work\_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.39\license-FastWildcardMatching.txt' contents when expanding the archive file.
Finishing: Publish Power BI model C:\agent\_work\27\BuildPipeline\PowerBiModels\TSPTabularModels\ProjectScores\Model.bim to TDW Dev

I believe that it's trying to expand the TabularEditor.zip file on top of already expanded files, and when it finds the previous run - it errors. This is one line that I think needs the -force flag put on it:

https://github.com/maikvandergaag/msft-extensions/blob/fba0aba6545d600e684a019a80dbad64dd656e4c/azuredevops/powerbiactions-new/powerbiactionsnew/ps_modules/PowerBi/powerbi.psm1#L1133

I would create a PR myself for you, but my company does not allow working with public GitHub like that :/

maikvandergaag commented 1 year ago

Done the change let me know if that fixed it

daj102 commented 1 year ago

I will; thank you so much for the quick response! As I don't have any control over the DevOps org, I cannot install the new build - I'll have to wait for the new version to be published and then I will get the admins to pull it. Thanks again.