SSIS - OData Connection Manager Editor Error - sql-server

I was using OData source to load data from SharePoint 2013 List to SQL Server and the same was working for months. Now I am receiving below error in OData Source connection manager. SharePoint server is UP and I am able to access it from browser using the same credentials. Please help
Image shows the Error
Error Information:
The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios. (Microsoft.SqlServer.IntegrationServices.ODataConnectionManager)

Related

Establishing connection to Azure SQL server. "Error: Token retrieval failed with an error. Open developer tools to view the error"?

Using Azure Data Studio:
Version: 1.32.0 (system setup)
Commit: 4a45ba7cf20dd4129f1a08e5e776dfb33e3d1d1e
Date: 2021-08-16T18:08:28.086Z
VS Code: 1.56.0
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.17763
I am attempting to access a database that I have read/write permissions to. I have accessed it regularly. Now, I am getting the error: Token retrieval failed with an error. Open developer tools to view the error
Following is the connection details window:
image of connection details window
Connection type: Microsoft SQL Server
Authentication type: Azure Active Directory - Universal with MFA support
The server, account, and database fields are all populated with their respective necessary information.
A browser window pops up asking for username/password, which I enter valid credentials for, followed by the authentication being confirmed in the browser that follows, accompanied by instructions to close the browser window. Azure Data Studio then has the error displayed mentioned above: Token retrieval failed with an error. Open developer tools to view the error
Why the difference in expected credentials?
Problem seems to be with a cached token.
try to delete the token from here C:\Users{UserNameHere}\AppData\Roaming\azuredatastudio\Azure Accounts and try to re authenticate.

ASP.NET Core Web Api publishing to IIS producing an Sql Server connection error

I've created a simple web api in asp.net core 2.0 which uses localdb as the backing datastore. It works completely as expected in debug - I'm able to send requests from postman (or browser) and step through my code. Here is my connection string:
"Server=(localdb)\\MSSQLLocalDB;Database=UniversityDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
I now want this to be running constantly so that I can consume it from a Xamarin.Forms project so I have tried publishing the web app using the Visual studio wizard.
1.
2.
UniversityApi then appears in IIS under Default Web Site but not as an application. I choose to 'Convert to Application' which shows me this dialog:
3.
The NetCoreApps Application Pool uses No Managed Code.
Error:
{
"error": [
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.\r\n)"
]}
The error seems to describe a problem with connecting to my Sql Server instance which is strange because it works perfectly while debugging in VS. Any ideas?
After searching for a while I stumbled onto this question:
SQL won't connect after deploying
One of the answers did the trick for me, credit to Robotron.
IIS Manager
Application Pools
Find the pool your app belongs to (for me it was .NET v4.5)
Right click -> Advanced Settings
Scroll down to Identity
Change from whatever (for me it was ApplicationPoolIdentity, same as you have) into LocalSystem.
Add the "LOCAL SERVICE"(Windows account) to SQL Server.
Change from "ApplicationPoolIdentity" to "LocalService" in (IIS Application Pools Advanced Settings)
NOTE. ADD "LOCAL SERVICE"(Windows account) need Permission into SQL Server.
Thanks a lot for the answers. I have similar problem. My .net core web api is hosted in AWS. It was working before when I was just accessing the api via ip address (sample https://xx.xx.xxxx/swagger) but when I integrated it to domain (https://xx.sampledomain.com/swagger) I ran into the same problem. These two steps solved the error.
1st I used the LocalService account for IIS Application Pool, then added the NT Authority/Local Service account in the MS SQL Server 2016.
enter image description here
On the Publish screen > Database > DefaultConnection, I ticked on the 'Use this connection string at runtime' checkbox.
enter image description here

SSRS SQL Server Authentications

I'm having an issue with an SSRS report using SQL Server Authentication.
I'm creating the report in VS2017 (SSDT), latest update 05/11/2018.
Creating a pretty basic report with 2 data sources. The data sources appear to be valid and passes test.
Test Connection:
When I attempt to preview the report SSRS throws the obtuse error
An error occurred during local report processing
By changing the credentials from SQL Server Authentication to Windows Authentication I can preview the report just fine:
There are no reported login failures in the logs of the target SQL server so it would appear that the report is failing prior to the login.
I'm a little befuddled and appreciate any insights the community could provide.
Convert your data set to shared data set. I also faced the same problem when i upgraded my ssdt.

SSIS - Cannot connect to SP List with OData Source

I have a SSIS Package with an OData Source Connection to a SharePoint List. To connect to the list, I have a Service Account, which I add as Basic Authentification in the OData Source Task. With this Credentials I can connect to SP and can choose the collection (also preview of the list).
When I now execute the Package (in VS or from Management Studio) the package always fails with the error Message "Cannot acquire a managed connection from the run-time connection manager".
In Management Studio I run the Package with the Service Account User.
Does everybody know whats my problem here ?
I am using SQL Server 2016.

How to Write data to Sql Table from SharePoint WebPart when DB and SP are on different machine?

I am working on SharePoint 2013. Database is on SqlServer 2008R2. Both SP and DB are on different machines. I am creating a webPart which is associated with usercontrol. I'm writing the logic in cs file of usercontrol, to write data collected from the form into Data table of sql server.
Connection string: Server=myServerAddress;Database=myDataBase;User
Id=myUsername; Password=myPassword;
But it is failing and throwing an error like "Login failed for user".
Please guide.
You may be running into the Double Hop Problem (also see why NTLM fails). To know for sure use ULSViewer to drill into the SharePoint Error details. From the SQL side check the default trace. "default trace gives you the reason for login failure in plain English"
If it is the double hop causing the error, you may want to look into configuring Kerberos or switching to using an External List instead of a web part and using the Secure Store Service with BCS.

Resources