liprec / vsts-release-aas

Repository for my Analysis Service Azure pipelines tasks related to Azure Analysis Service or Power BI Premium
Other
27 stars 28 forks source link

Error when setting 'remove old model before deployment' option. #38

Closed sebaruehl closed 4 years ago

sebaruehl commented 4 years ago

When setting remove to 'true' for the deploy-aas-db task the following error is produced:

Error during deploying the model (The property 'database' cannot be found on this object. Verify that the property exists and can be set.)

I suspect the reason lies in a missing ConvertFrom-Json statement at line 158 in the following code which when produces the error in line 161:

https://github.com/liprec/vsts-release-aas/blob/1ff3e3a638e1aba3defa3952fa341e796ed11a37/deploy-aas-db/1.2.0/deploy-aas-db.psm1#L157-L161

I can create a pull request for this issue.

liprec commented 4 years ago

Hi @sebaruehl,

Thanks for the feedback and indeed there is a | ConvertFrom-Json missing. I will include this in the next release, which also will contain some other fixes.

For now you can first execute the TMSL command as a separate task before the deployment.

-JP

sebaruehl commented 4 years ago

Hi @liprec,

Thanks for the fast closure of the bug. I saw that you already pushed a new version to the marketplace. Unfortunately I think there is still something wrong. I think you have to convert $tsml back into JSON before running Invoke-ASCmd in: https://github.com/liprec/vsts-release-aas/blob/5ee8cd2f11e5ff93dce048f05d34810611db5281/deploy-aas-db/v1/deploy-aas-db.psm1#L167

Similar to the code in the PrepareCommand function.

The solution with first executing the TMSL command as a separate task before the deployment works fine for me, thank you very much!

liprec commented 4 years ago

Hi @sebaruehl,

Thanks for the test and indeed there was one step missing. New version (1.3.1) is build and uploaded to the marketplace.

-JP