mmajcica / DeploySsrs

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

Access Denied Error #21

Closed cbonezzi closed 5 years ago

cbonezzi commented 5 years ago

Here is my configuration for the task. All I get when I execute the release is ##[Error]Access is denied. Any help/ideas would be greatly appreciated. Thanks in advance. image

Here is the error I get on the logs 2019-01-11T02:45:39.8351702Z ============================================================================== 2019-01-11T02:45:39.8351702Z Task : Deploy MS SQL SSRS Reports 2019-01-11T02:45:39.8351702Z Description : Deploy items on MS SQL SSRS server based on a configuration file. 2019-01-11T02:45:39.8351702Z Version : 3.1.3 2019-01-11T02:45:39.8351702Z Author : Mario Majcica 2019-01-11T02:45:39.8351702Z Help : 2019-01-11T02:45:39.8351702Z ============================================================================== 2019-01-11T02:45:45.8508839Z ##[error]Access is denied 2019-01-11T02:45:45.8665094Z ##[section]Finishing: Deploy reports 2019-01-11T02:45:45.8821200Z ##[section]Finishing: Release

Here is my configuration file

`<?xml` version="1.0" encoding="utf-8"?>
<Folder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Root">
  <Folders>
    <Folder Name="Folder">
      <Folders>
        <Folder Name="Data Sources" Hidden="true">
          <DataSources>
            <DataSource ConnectionString="Data Source=myserver;Initial Catalog=mydb" Name="UPenterprise" Extension="SQL" CredentialRetrieval="Integrated" />
            <DataSource ConnectionString="Data Source=myserver;Initial Catalog=mydb" Name="UPenterprise" Extension="SQL" CredentialRetrieval="Store" UserName="SSRSUser" Password="123123" WindowsCredentials="False" />
          </DataSources>
        </Folder>
        <Folder Name="UPExpress" Hidden="true">
          <Reports>
            <Report Name="ArchiveRollback" Hidden="true" FileName="ArchiveRollback.rdl" />
          </Reports>
          <Security>
            <Security Name="SSRSUser">
              <Roles>
                <Role>Browser</Role>
                <Role>Publisher</Role>
                <Role>Content Manager</Role>
              </Roles>
            </Security>
          </Security>
        </Folder>
      </Folders>
      <Security>
        <Security Name="Users">
          <Roles>
            <Role>Browser</Role>
          </Roles>
        </Security>
        <Security Name="SSRSUser">
          <Roles>
            <Role>Browser</Role>
            <Role>Content Manager</Role>
          </Roles>
        </Security>
      </Security>
    </Folder>
  </Folders>
</Folder>

SSRS destination folder image

A few more pieces of information. The configuration file lives in the destination server where reports will be deployed to. I am not sure if this could be causing the problem.

Error from SSRS Log library!ReportServer_0-8!1be8!01/10/2019-21:16:50:: i INFO: Call to GetItemTypeAction(wsdl/ReportService2010.asmx). User: UPEXCHANGE-DEV\SSRSUser. library!ReportServer_0-8!1be8!01/10/2019-21:16:50:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: , Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item 'wsdl/ReportService2010.asmx' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash.; library!WindowsService_44!1fa0!01/10/2019-21:23:52:: i INFO: Call to CleanBatch() library!WindowsService_44!1fa0!01/10/2019-21:23:52:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams, 0 segments, 0 segment mappings, 0 edit sessions. library!WindowsService_44!1fa0!01/10/2019-21:23:52:: i INFO: Call to CleanBatch() ends

mmajcica commented 5 years ago

By seeing your config file on an administrative share, I think that your agent account is not authorized to access that file. Try copying it in one of the build/release well-known folders like Build.ArtifactStagingDirectory and then point to it's path.

cbonezzi commented 5 years ago

Thanks mmajcica! I moved that configuration file to the Build.ArtifactStagingDirectory, pointed the definition to it, and it worked like a charm.