mmajcica / DeploySsrs

Build-Release task for VSTS/TFS that manages Microsoft's SQL Server Reporting Services
MIT License
21 stars 21 forks source link

ImpersonateUser property, not ImpersonateUserSpecified #55

Closed JinrohBI closed 3 years ago

JinrohBI commented 3 years ago

Hi,

First of all, thank you very much for this very useful DevOps task.

I am in a case where I deploy a SSAS DataSource for which I need to use Impersonation (no Kerberos). image

So I configured the JSON Configuration File with the following properties, but I have the impression that the "ImpersonateUser" is not taken into account. image

By checking the PowerShell code of your task, I have the impression that there is a small error at this level in function New-DataSource() image

Is it a problem of use on my part? Thank you for the feedback

mmajcica commented 3 years ago

Hi, -ImpersonateUser:$dataSource.ImpersonateUser is passed in the call to that cmdlet. That dataSource object is fetched by the cmdlet that parses the xml file. Can you check if GetXmlFolderItems returns you the object that has the ImpersonateUser property specified?

mmajcica commented 3 years ago

Can you share an example of your config file so that I can test it?

JinrohBI commented 3 years ago

Hi, Thanks for the quick answer.

I share with you a complete project with a "_Tools" folder containing the ConfigFile. ImpersonateUser.zip

As you say that DataSource is fully build by deployement, the original one don't contains this Impersonate.

JinrohBI commented 3 years ago

It's a JSON file, not XML. And DataSource a created with good parameters, except this ImpersonateUser.

mmajcica commented 3 years ago

I haven't had time to verify, but I gave a look and I suspect the problem is in the fact you are passing in the value as a string:

"ImpersonateUser": "True"

can you try passing in a boolean?

"ImpersonateUser": true

Let me know.

mmajcica commented 3 years ago

Same goes for WindowsCredentials too.

JinrohBI commented 3 years ago

Hi,

I just try with boolean, instead of string, and I have the same result. For information, with string, the WindowsCredentials was previously OK.

mmajcica commented 3 years ago

I'll test it this evening and make a fix if I find the reason why this is not working as expected.

JinrohBI commented 3 years ago

Thanks a lot for your tests.

mmajcica commented 3 years ago

I went through the code and made sure that the configuration is picked up correctly, which it is. However, in order for it to be picked up correctly both

"WindowsCredentials": false,
"ImpersonateUser": true

do need to be specified as Boolean and not strings. In case of strings, you'll always get True as a value.

I also checked the params passed to return

$Proxy.CreateDataSource($DataSourceName, $Path, $Overwrite, $Definition, $properties)

and all of them are correct.

Can you check this link https://powershellposse.com/2016/08/03/create-ssrs-data-source/ and indicate which fileds you do expect to be mapped, then you can validate if the correct properties are set here https://github.com/mmajcica/DeploySsrs/blob/3831e0f94b4d2e79764bf2910f95f1d88ff99bf9/task/ps_modules/ssrs.psm1#L37

Let me know.

mmajcica commented 3 years ago

The issue may be here,

$Definition.ImpersonateUserSpecified = $ImpersonateUser

I do set a property ImpersonateUserSpecified instead of maybe the ImpersonateUser but I'm not sure. Are you able to validate this via PowerShell from a PC running SSRS?

JinrohBI commented 3 years ago

The issue may be here,

$Definition.ImpersonateUserSpecified = $ImpersonateUser

I do set a property ImpersonateUserSpecified instead of maybe the ImpersonateUser but I'm not sure. Are you able to validate this via PowerShell from a PC running SSRS?

Yes, i think the issue is here. How can I test this part of code ?

mmajcica commented 3 years ago

I have a new version of the extension, but with a different ID.

I can invite you for testing if you agree and provide me with the organization name on which I can share it with.

Check here https://dev.azure.com/mummy/Azure%20DevOps%20Extensions/_build?definitionId=44&_a=summary

JinrohBI commented 3 years ago

I contact you in private with the organization name (through your blog ;) )

mmajcica commented 3 years ago

It has now been shared.

Let me know how it goes, then eventually I can push it in prod.

On Fri, 4 Sep 2020 at 16:12, Alexandre Chemla notifications@github.com wrote:

I contact you in private (through) your blog ;)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mmajcica/DeploySsrs/issues/55#issuecomment-687170339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXC456IWMSJSE5QO3YZBETSEDYTTANCNFSM4QQQSHLQ .

JinrohBI commented 3 years ago

Thanks for this quick update. I will ask to the DevOps admin, and give feedback as soon as possible.

mmajcica commented 3 years ago

Be aware that the identity (unique id) of the shared extension is different from the production extension. Same thing goes for the task in it. You can imagine why is that necessary.

JinrohBI commented 3 years ago

When i try to install the test extension, i get this error. image (same version 3.1.8) I delete the prod one (no problem), then installed the Sahred one.

After recreated my pipeline (with the test version), the log indicate v3.1.9 :+1: image

The DataSources have been deployed, but unfortunately the ImpersonateUser option is still unchecked.

mmajcica commented 3 years ago

Unfortunately I do not have an ssrs instance I can use for tests. Can you try to mimic the proxy call via ps1? Can we get in touch and check it together?

On Fri, 4 Sep 2020, 17:49 Alexandre Chemla, notifications@github.com wrote:

When i try to install the test extension, i get this error. [image: image] https://user-images.githubusercontent.com/29091575/92258078-8e895b80-eed6-11ea-95db-3635b17cf2a3.png (same version 3.1.8) I delete the prod one (no problem), then installed the Sahred one.

After recreated my pipeline (with the test version), the log indicate v3.1.9 👍 [image: image] https://user-images.githubusercontent.com/29091575/92258216-c4c6db00-eed6-11ea-813a-1c710246c158.png

The DataSources have been deployed, but unfortunately the ImpersonateUser option is still unchecked.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mmajcica/DeploySsrs/issues/55#issuecomment-687232863, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXC455D2QIPJF4OHQCMMPDSEED77ANCNFSM4QQQSHLQ .

JinrohBI commented 3 years ago

Thanks for this correction and release. For information to all, 2 properties must be set to true: ImpersonateUser & ImpersonateUserSpecified

mmajcica commented 3 years ago

Thank you for finding it out and helping with the tests!

Cheers

mmajcica commented 3 years ago

And btw what you mention is true, however in the config file it is sufficient to set only ImpersonateUser to true.