Forum Discussion

Jannematz's avatar
Jannematz
Frequent Visitor
2 years ago
Solved

Deployment Pipeline looses bindings and creates duplicates

Hello,   we have the following configuration: We use dev, test, prod environments, while dev is using git integration and the others are just regular workspaces. Prod uses an app to deliver the co...
  • Jannematz's avatar
    2 years ago

    Hello Anonymous and everyone else visiting this thread.

    I opened up a microsoft ticket, but was able to analyse the problem in depth and provide my own solution to it in the meantime:

     

    The Problem revisited:

    The problem about the deployment pipeline loosing its binding is a direct result of the workaround I am using to get around a “Alm_InvalidRequest_PurgeRequired” error (See here how I do it: Other Community Thread). As soon as the object gets "deleted" in the workspace the deployment pipeline looses the binding. This is intended behaviour. So this problem is more about the occurrence of the Alm_InvalidRequest_PurgeRequired error. This error occurs, when major changes to the data model are happening (such as new joins within existing sources on powerquery level or schema modifications). The underlying data that is residing in the workspace is no longer matching the schema present in the updated data model. Therefore, the service recommends a so called “Purge” to delete the underlying data in the workspace (similar to deleting the /.pbi/cache.abf cache in local PowerBi Desktop). Now here is where you need to improve your product: I want to be able to use the frontend of the powerbi.com service to purge the data. This is not possible as of now. It’s not even possible to do this using the powerbi REST API nor the Power BI Powershell cmdlets. It is possible ONLY using the XMLA Endpoint of the workspace.

     

    My solution:

    So I wrote a little azure devops pipeline to do exactly that.

    Install-Module -Name SqlServer -force
    $securePassword = ConvertTo-SecureString "$(password)" -AsPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential ("$(username)", $securePassword)
    
    $tmsl = '{ "refresh": { "type": "clearValues", "objects": [ { "database": "" } ] } }' | ConvertFrom-Json 
    
    $($tmsl.refresh.objects)[0].database = "$(DatasetName)"
    
    $payload = ($tmsl | ConvertTo-Json -Depth 25)
    
    Write-Output $payload 
    
    Invoke-ASCmd -Server "$(server)" -Credential $credential -Query $payload

    This will send the xmla script using invoke-ascmd

    This will then purge the underlying data in the dataset, allowing us to update the new data model using the git integration while maintaining the development pipelines bindings.

     

    Conclusion:

    The product team should work on a way to purge the dataset directly from the frontend. The way this currently works is not feasible.