none
SSRS API v2.0 \DataSources Add New RRS feed

  • Question

  • Anyone able to shed light on adding a new DataSource using the API endpoint?  While the swagger docs show the expected properties, there is no indication of required or not and the exceptions don't easily tie back to identify what's being expected.

    https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/DataSources/AddDataSource

    I've been able to identify that this error: Expected parameter 'Prompted User Credentials' is missing

    is raised when the "CredentialsByUser" object (or one of it's child properties isn't set).  The standard defaults for when you don't want to prompt the user to login would be NULL and default boolean value would be False... but yet it's still required

    "CredentialsByUser"= @{
      "DisplayText"= $null;
      "UseAsWindowsCredentials"= $false;
    };

    I'm currently fighting against the error: Expected parameter 'User ID' is missing which I suspect is in reference to the "ParameterValues" property.  I already have the "CredentialsInServer" UserName and Password set which are indicated as being where the SQL Server creds should be set for the connection string (btw plain text pwd is bad mmmkay).  

    The ConnectionString doesn't currently have creds included in it only the Data Source and Initial Catalog as my expectation is that the "CredentialsInServer" will be used.  Do I need to add a placeholder in the ConnectionString?  Something else?

    {
      "Id": "01234567-89ab-cdef-0123-456789abcdef",
      "Name": "string",
      "Description": "string",
      "Path": "string",
      "Type": "Unknown",
      "Hidden": true,
      "Size": 0,
      "ModifiedBy": "string",
      "ModifiedDate": "2017-04-13T15:51:04Z",
      "CreatedBy": "string",
      "CreatedDate": "2017-04-13T15:51:04Z",
      "ParentFolderId": "01234567-89ab-cdef-0123-456789abcdef",
      "ContentType": "string",
      "Content": "string",
      "IsFavorite": true,
      "IsEnabled": true,
      "ConnectionString": "string",
      "DataSourceType": "string",
      "IsOriginalConnectionStringExpressionBased": true,
      "IsConnectionStringOverridden": true,
      "CredentialsByUser": {
        "DisplayText": "string",
        "UseAsWindowsCredentials": true
      },
      "CredentialsInServer": {
        "UserName": "string",
        "Password": "string",
        "UseAsWindowsCredentials": true,
        "ImpersonateAuthenticatedUser": true
      },
      "IsReference": true,
      "Subscriptions": {
        "Id": "01234567-89ab-cdef-0123-456789abcdef",
        "Owner": "string",
        "IsDataDriven": true,
        "Description": "string",
        "Report": "string",
        "IsActive": true,
        "EventType": "string",
        "ScheduleDescription": "string",
        "LastRunTime": "2017-04-13T15:51:04Z",
        "LastStatus": "string",
        "ExtensionSettings": {
          "Extension": "string",
          "ParameterValues": {
            "Name": "string",
            "Value": "string",
            "IsValueFieldReference": true
          }
        },
        "DeliveryExtension": "string",
        "LocalizedDeliveryExtensionName": "string",
        "ModifiedBy": "string",
        "ModifiedDate": "2017-04-13T15:51:04Z",
        "ParameterValues": [
          {
            "Name": "string",
            "Value": "string",
            "IsValueFieldReference": true
          }
        ]
      }
    }

    Thursday, February 13, 2020 11:40 PM

All replies

  • It seems there is not much powershell with SSRS Rest API doc that is available, I suggest you could post the request here: https://feedback.azure.com/forums/908035-sql-server  Your feedback enables Microsoft to offer the best software and deliver superior services.

    Btw, I've not found any doc that using Rest API in powershell, but I found using web service Create SSRS Data Source. (If you need specifically to use API, then this may be not helpful.)

    Regards,

    Lukas


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 14, 2020 12:40 PM
  • I don't believe the issue is a powershell one.  The REST APIs are just that APIs which are simple web calls to a service endpoint no matter what the utility you use to make the call.  It could be fiddler, curl, powershell, C#, etc.

    The REST APIs were released with SQL 2017 as the new direction forward but there doesn't appear to be much support around it even though the old SOAP APIs haven't really changed in years and have been marked for deprecation.   My concern is the 2010 asmx endpoints have been deprecated, but even up until SQL 2016 release there is a whole collection of powershell commandlets which were written as band-aids over the top of the underlying SOAP APIs which just causes more confusion when going to migrate to newer tech stacks.  The Create SSRS Data Source link provided is just such a case.  The New-WebServiceProxy is a band-aid wrapper over the SOAP APIs not the REST APIs.  Taking these another step further, PowerShell 5.1 (i.e. Desktop written in .NET 4.5.1) vs is no longer under active development and instead if being replaced by Powershell CORE which does not have the hooks needed to support the dynamic code generation of SOAP APIs as it's intended to be cross platform.


    For the 1 powershell sample I've actually found, need to look here: (drill down to the /APISamples/Powershell directory)

    https://github.com/microsoft/Reporting-Services

    For the REST API documentation, look here:

    https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0

    Friday, February 14, 2020 3:14 PM