DrJohnT / DeployCube

Publish / Deploy a Tabular or Multidimensional Cube to SSAS or AAS
MIT License
11 stars 8 forks source link

Using Update-TabularCubeDataSource with Multiple Data Sources #5

Closed tylercranston closed 3 years ago

tylercranston commented 3 years ago

Hello,

We have a need to update data sources on a SSAS cube. The cube has multiple data sources that need to be updated:

I attempted to implement this using the Update-TabularCubeDataSource cmdlet but I found that only the first data source was updated.

I reviewed the code in Update-TabularCubeDataSource.ps1 and found when more than one row is returned for $rows, only the first row is affected. I'm wondering if you want to resolve this issue in your module yourself, or perhaps would be open to me doing a pull request. Or perhaps you don't want to handle this problem at all.

Please let me know.

Regards, Tyler

DrJohnT commented 3 years ago

Tyler,

The biggest issue with multiple connections is how to change the interface to Update-TabularCubeDataSource to cater for multiple server names/database names and userID/password combinations. I suppose an array with a specific structure would do, but may get difficult for people to create before calling Update-TabularCubeDataSource.

Let's have a discussion here about options. Ultimately, I am happy for you to make the change and issue a pull request.

Note there is a full Pester test suite for the module in the test sub-folder and some simple example Visual Studio projects in the examples sub-folder which the tests use.

Glad to have you on board!

tylercranston commented 3 years ago

What about having the command only update one data source as it does now, but being able to optionally specify which data source to update using an additional parameter like DataSourceName. Using this method we would avoid changing the existing logic without the parameter, but if the parameter is added then a specific data source would be updated. If there are two data sources, the command would be run twice specifying the data source name each time.

This method would avoid arrays and having to pass multiple values for each parameter at once.

Let me know your thoughts, Thanks!

DrJohnT commented 3 years ago

Tyler, actually that is a great idea! Simple and effective. Go for it!

tylercranston commented 3 years ago
tylercranston commented 3 years ago

@DrJohnT Any comments, questions, suggestions?

DrJohnT commented 3 years ago

Tyler I have merged your pull request. Looks good! I am having an issue with my Azure subscription. Will test and release the updated module to PowerShell Gallery as soon as I have that fixed.

Thanks for your update!

John

DrJohnT commented 3 years ago

This has now been published to the PowerShell Gallery as v 1.2.3

Note that the Example you added to the Update-TabularCubeDataSource.md should have been added to the Update-TabularCubeDataSource.ps1 PowerShell script and then the UpdateHelp.ps1 would have simply picked it up. I moved the example over.

Thanks for your help on this!