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

Data Source Connection and Role Issue #26

Closed nandangajananhegde closed 3 years ago

nandangajananhegde commented 5 years ago

Hi Team, I am using AAS model:1400 and have only 1 data source: Azure data warehouse image

So after running the task, all the roles are getting deleted and the connection string details of the data source(Azure data warehouse) are not getting updated as per the details provided in the task. So am I missing out anything? Isn't there any feature similar to Deployment wizard: To retain existing configurations?

ckupferschmid commented 5 years ago

Having the same issue here. The data entered into the task is not put into the connection of the model. Also assuming, that we are missing out something.

Thanks for any hint.

ckupferschmid commented 5 years ago

Having the same issue here. The data entered into the task is not put into the connection of the model. Also assuming, that we are missing out something.

Thanks for any hint.

Just found the problem. We use models that have been updated from 1200 to 1400. These models use legacy data sources. That's why the connection parameters are not updated.

Would it be possible to add an option to use legacy data sources?

ckupferschmid commented 5 years ago

Having the same issue here. The data entered into the task is not put into the connection of the model. Also assuming, that we are missing out something. Thanks for any hint.

Just found the problem. We use models that have been updated from 1200 to 1400. These models use legacy data sources. That's why the connection parameters are not updated.

Would it be possible to add an option to use legacy data sources?

Could you change it to something like this in your package? (not tested)

function ApplySQLSecurity($Model, $Server, $Database, $UserName, $Password) { $connectionDetails = ConvertFrom-Json '{"connectionDetails":{"protocol":"tds","address":{"server":"server","database":"database"}}}' $credential = ConvertFrom-Json '{"credential":{"AuthenticationKind":"UsernamePassword","kind":"kind","path":"server","Username":"user","Password":"pass","EncryptConnection":true}}' $dataSources = $Model.model.dataSources foreach($dataSource in $dataSources) { if ($dataSource.type) { $connectionDetails = ConvertFrom-Json '{"connectionDetails":{"protocol":"tds","address":{"server":"server","database":"database"}}}' $credential = ConvertFrom-Json '{"credential":{"AuthenticationKind":"UsernamePassword","kind":"kind","path":"server","Username":"user","Password":"pass","EncryptConnection":true}}' $connectionDetails.connectionDetails.protocol = $dataSource.connectionDetails.protocol $connectionDetails.connectionDetails.address.server = $Server $connectionDetails.connectionDetails.address.database = $Database $dataSource.connectionDetails = $connectionDetails.connectionDetails $credential.credential.kind = $dataSource.credential.kind $credential.credential.EncryptConnection = $dataSource.credential.EncryptConnection $credential.credential.AuthenticationKind = $dataSource.credential.AuthenticationKind $credential.credential.path = $Server $credential.credential.Username = $UserName $credential.credential.Password = $Password $dataSource.credential = $credential.credential } else { $dataSource.connectionString = "Provider=SQLOLEDB.1;Data Source=" + $Server + ";User ID=" + $UserName + ";Password=" + $Password + ";Initial Catalog=" + $Database $dataSource.impersonationMode = "impersonateServiceAccount" } } return $Model }

indexample commented 4 years ago

I experience the same issue: after deployment the model wont process: "The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'Login failed for user 'xxx' .. The exception was raised by the IDbConnection interface."

after opening the connection string and resubmitting the password, it works again. So it looks like the password is not deployed correctly....?

indexample commented 4 years ago

i found a workaround solution: after the deployment step, also add a TMSL script that updates/replaces the connection with in there a hardcoded password in the connectionstring (you cannot use variables in a TMSL script task):

{ "createOrReplace": { "object": { "database": "MODELNAME", "dataSource": "DATASOURCENAME" }, "dataSource": { "name": "CONNECTIONNAME", "connectionString": "Data Source=DBURL;Initial Catalog=DBNAME;User ID=USERNAME;Persist Security Info=true;Encrypt=true;TrustServerCertificate=false;Password=PASSWORD",

........etc

liprec commented 4 years ago

Hi All,

Somehow this issue has been off my radar somehow: sorry about that. But the extension works indeed only with modern Get Data experience of the 1400+ data models.

For a future release I will take a look at the variable part of the TMSL script task and the option to use legacy data source connections.

-JP

indexample commented 4 years ago

yeah those issues are related as updating the connection string through TMSL also requires a variable part for DTAP environments.

for now, I can fix it by adding a new datasource (structured connection) and switching all tables to the new source.

Dank je, JP!

Derek

ckupferschmid commented 4 years ago

In my fork (ckupferschmid/vsts-release-aas), I have added support for legacy data source and also added some adjustment on how to handle firewall rules, if you do parallel deployment of models to the same AAS instance. Would be nice to see them in your future release.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.