Closed vinayprakash893 closed 2 months ago
You could do this by adding a PowerShell task to your Pipeline that retrieves the values from PowerBi. These values can then be passed as a variable to the next task
Yes, i have tried using the powershell script which will provide the list of files deleted in ARRAY,
But do i pass this to the below task..?
task: maikvandergaag.maikvandergaag-power-bi-actions.PowerBIActions.PowerBIActions@5 displayName: 'Demo-itworks : Delete Report' inputs: PowerBIServiceEndpoint: 'sasa' Action: DeleteReport WorkspaceName: "will this accept array" ReportName: "will this accept array"
because you know there is a limitation in Azure Devops, we can only loop task with parameters (which is defined during compile time, ie during the yml file creation), and the above scenario it creates variable during run time and cannot be used for looping task
It is possible to start multiple tasks based on a dynamic variable. You should look into that.
Sure, I will look for a solution, if i find anything useful, i will update in the comments, so that it may be useful for others,
Thank you for building the wonderful APP.
Great, this it succeed. Is is ok for me to close the issue?
Thank you, yes this can be closed.
In repo, im deleting the few files eg: out of 4 pbix files, i have deleted 2 files in repo , so those two should be removed from PowerBI workspace as well.
im using the below script to get the diff which files got deleted Write-Host "Source file '$sourceFile' does not exist. Marked for deletion..." $destsubfolder = Split-Path $sourceFile $deletedFolderPath = Join-Path $deletedfolder $destsubfolder $dummyFileName = Split-Path $sourceFile -Leaf $dummyFilePath = Join-Path $deletedFolderPath $dummyFileName if (-not (Test-Path -Path $deletedFolderPath)) { $null = New-Item -ItemType Directory -Path $deletedFolderPath } $null = New-Item -ItemType File -Path $dummyFilePath }
but if i want to send these in the azure devops pipline, i cannot hardcode thevalues in the repot names, how do i pass dynamically with array or loop..?
task: maikvandergaag.maikvandergaag-power-bi-actions.PowerBIActions.PowerBIActions@5 displayName: 'Power BI Action: DeleteReport' condition: eq(variables['Demo_deleted'], True) inputs: PowerBIServiceEndpoint: 'powerbi-actions' Action: DeleteReport WorkspaceName: 'Demo-workspace' ReportName: 'Demofile-1'
reference : https://github.com/maikvandergaag/msft-extensions/issues/245