mmajcica / DeploySsrs

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

Deploy reports error: error downloading asmx file #29

Closed bbecher closed 5 years ago

bbecher commented 5 years ago

When attempting to deploy reports, I am getting an error for the deploy phase of the process.

image I have confirmed that I am able to reach the ASMX endpoint manually with no issues.

The plugin is configured as follows: image

Note: When attempting this with both WinAuth and SQL Server Auth, the same error results.

I have tried users with various permission settings with no change in results.

sreeraj-rajendran commented 5 years ago

@bbecher were you able to get past this?

I am not sure if I am right here, but from what I understood from the code, upon selected Windows authentication the account with which the build agent is running would be used to try and connect to the SSRS endpoint (UseDefaultCredential ) :

$proxy = New-WebServiceProxy -Uri $url -Namespace SSRS.ReportingService2010 -UseDefaultCredential -Class "SSRS"

@mmajcica thanks for this extension, this would definitely help us. We have just started using this, and had hit the same issue that @bbecher was running into.

Can you please help with your thoughts on some of the observations:

  1. If we use SQL auth, we get a 401 as the credential for New-WebServiceProxy is being built based on that. I am not sure if we can authorize to SSRS using sql authentication. Wouldn't this need an account that has permission to SSRS itself rather than just the database?

$proxy = New-WebServiceProxy -Uri $url -Namespace SSRS.ReportingService2010 -Credential $credential -Class "SSRS"

Also with windows authentication it looks like we would be using the build agent's service account to connect to SSRS.

  1. If the ReportService2010 endpoint URL is provided as in the description - http://your.server/ReportServer/ReportService2010.asmx?wsdl, Format-SsrsUrl would convert it to http://your.server/ReportServer/ReportService2010.asmx?wsdl/ReportService2010.asmx

I am not a developer myself, but I'll check if I can submit a PR if these seem valid.

mmajcica commented 5 years ago

Using Windows Authentication option will imply that the code sets the UseDefaultCredential property in the resulting proxy object to True. This also means that the calls will assume the identity of your build agent. Again, it means that that account need to have sufficient permissions granted in SQL and SSRS.

Regarding the validation of the URL, the function expects that the provided URL ends up with .asmx. Just remove ?wsdl from your URL and you will not have issues anymore.

All of the authentications issues are not strictly related to this task, but to your SQL and infrastructure setup. If there are no issues with the task itself, I would like to close this thread and advise you to search for SQL and SSRS help in more indicated places.

sreeraj-rajendran commented 5 years ago

Thanks @mmajcica .

This was more of a usability suggestion, as the help text for ReportService2010 endpoint URL says, : The Report Server Web service ReportService2010 endpoint URL. E.g. http://your.server/ReportServer/ReportService2010.asmx?wsdl - which would throw an error, and then we had to spend some time to find why this was happening :)

Similar was the help text for Authentication and Username / Password. We are good now- Thanks!

mmajcica commented 5 years ago

If it really bothering you, it is a small change. Create an issue and I'll make the change and publish it.

Cheers

On Mon, 13 May 2019 at 11:55, sreeraj-rajendran notifications@github.com wrote:

Thanks @mmajcica https://github.com/mmajcica .

This was more of a usability suggestion, as the help text for ReportService2010 endpoint URL says, : The Report Server Web service ReportService2010 endpoint URL. E.g. http://your.server/ReportServer/ReportService2010.asmx?wsdl - which would throw an error, and then we had to spend some time to find why this was happening :)

Similar was the help text for Authentication and Username / Password. We are good now- Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mmajcica/DeploySsrs/issues/29#issuecomment-491757050, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXC45ZWTZCW6RXD4JEKQGTPVE3J7ANCNFSM4HLIHX4Q .

sreeraj-rajendran commented 5 years ago

We are good now, thanks. Sorry for hijacking the thread @bbecher

Thanks!

bbecher commented 5 years ago

After reviewing the comments, and looking over the agent jobs I have resolved this.

The machine the agent was running on did not have access to our servers.

After resolving this, everything appears to work correctly.

acds commented 4 years ago

@mmajcica Thanks for maintaining this add-in.

It would be great to have a place with trouble shooting recommendations for this issue. I have remotes to the agent VM as the agent credentials and in a browser the ReportService2010 endpoint URL return the requisite wsdl, so it seems not to be a permissions issue.

I get 2019-12-11T00:30:43.8580153Z ##[error]There was an error downloading 'https://<server>/AREIS_DEV_SSRS/ReportService2010.asmx'.

Is there a way to turn on more verbose diagnostics.

mmajcica commented 4 years ago

Your account on that machine, is it the same as the account that is running the agent? If so, from your build server, can you try to replicate what the task is doing? Check the code and try to run a PS with a part of it under the same identity that agent is running under.

On Wed, 11 Dec 2019, 19:38 acds, notifications@github.com wrote:

@mmajcica https://github.com/mmajcica Thanks for maintaining this add-in.

It would be great to have a place with trouble shooting recommendations for this issue. I have remoted to the agent VM as the agent credentials and in a browser the ReportService2010 endpoint URL return the requisite wsdl, so it seems not to be a permisions issue.

I get 2019-12-11T00:30:43.8580153Z ##[error]There was an error downloading 'https:///AREIS_DEV_SSRS/ReportService2010.asmx'.

Is there a way to turn on more verbose diagnostics.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mmajcica/DeploySsrs/issues/29?email_source=notifications&email_token=AAXC45ZRMYNHR2H36OOOZXLQYEXTBA5CNFSM4HLIHX42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGUESQY#issuecomment-564676931, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXC4577OSGEBAGP5LNI2OLQYEXTBANCNFSM4HLIHX4Q .