Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImpersonateUser property, not ImpersonateUserSpecified #55

Closed
JinrohBI opened this issue Aug 31, 2020 · 22 comments · Fixed by #56
Closed

ImpersonateUser property, not ImpersonateUserSpecified #55

JinrohBI opened this issue Aug 31, 2020 · 22 comments · Fixed by #56

Comments

@JinrohBI
Copy link

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
Copy link
Owner

mmajcica commented Sep 1, 2020

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
Copy link
Owner

mmajcica commented Sep 1, 2020

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

@JinrohBI
Copy link
Author

JinrohBI commented Sep 2, 2020

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
Copy link
Author

JinrohBI commented Sep 2, 2020

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

@mmajcica
Copy link
Owner

mmajcica commented Sep 2, 2020

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
Copy link
Owner

mmajcica commented Sep 2, 2020

Same goes for WindowsCredentials too.

@JinrohBI
Copy link
Author

JinrohBI commented Sep 2, 2020

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
Copy link
Owner

mmajcica commented Sep 2, 2020

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

@JinrohBI
Copy link
Author

JinrohBI commented Sep 2, 2020

Thanks a lot for your tests.

@mmajcica
Copy link
Owner

mmajcica commented Sep 3, 2020

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

if ($CredentialRetrieval -eq "Store")

Let me know.

@mmajcica
Copy link
Owner

mmajcica commented Sep 3, 2020

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
Copy link
Author

JinrohBI commented Sep 3, 2020

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
Copy link
Owner

mmajcica commented Sep 4, 2020

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
Copy link
Author

JinrohBI commented Sep 4, 2020

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

@mmajcica
Copy link
Owner

mmajcica commented Sep 4, 2020 via email

@JinrohBI
Copy link
Author

JinrohBI commented Sep 4, 2020

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

@mmajcica
Copy link
Owner

mmajcica commented Sep 4, 2020

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
Copy link
Author

JinrohBI commented Sep 4, 2020

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 👍
image

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

@mmajcica
Copy link
Owner

mmajcica commented Sep 4, 2020 via email

@JinrohBI
Copy link
Author

JinrohBI commented Sep 5, 2020

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

@mmajcica
Copy link
Owner

mmajcica commented Sep 6, 2020

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

Cheers

@mmajcica
Copy link
Owner

mmajcica commented Sep 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants