Failed to login when creating DataSet from DataStore using Azure Machine Learning Designer - azure-machine-learning-studio

I'm new to Azure and its ML Designer. I have an Azure SQL Database set up with my Client IP allowed through the Firewall. I can connect using SSMS without issue using the server path and credentials Azure supplied.
I have set up a Machine Learning Resource and launched the Learning Studio.
Inside the Learning Studio I created a DataStore pointing to my Azure SQL Database and everything seems just fine:
Azure SQL Database DataStore
However, when I try to create a DataSet from that DataStore I am getting Login errors:
Login error when creating DataSet
In "More details" I see the following:
ScriptExecutionException was caused by DatabaseConnectionException.\n DatabaseConnectionException was caused by AuthenticationException.\n 'MSSQl' encountered connection erro with error code '18456' while opening connection to server ([REDACTED]), database ([REDACTED]). Either the database name is not valid or username and password is wrong. Exception class: '14'. HResult: x80131904.\n Failed due to inner exception of type: SqlException\n
I am sure the database name and login credentials are correct i.e. they work just fine when connecting from my SSMS. What else can this be? I've checked the Azure SQL Database profile - is there something here regarding security or access that I should be setting?
Firewall Settings
** UPDATE **
Solved this by going to SQL Server > Active Directory admin. There was nothing set here so I clicked Set Admin and then from the right panel scrolled down to the ML service I had set up. Once I saved it and then created a Dataset in ML I could see the data Preview just fine.

To get a preview of the dataset, it goes through Azure ML's service. If the only kind of restriction are IP restrictions (nothing around vnets/private links), then you can add Azure ML's IP ranges to your network settings.
Alternatively, you can choose to "skip validation" where Microsoft will not parse the data while trying to create the dataset, but this means preview won't be shown.
Furthermore, ensure that you have created a server-level IP firewall rule in the firewall settings and allowed access to the server, entered valid authentication details when creating the datastore, and specified a valid table when querying your database.
Note: I was able to connect successfully using above guidelines. Thanks.

Related

SSISDB ASP.NET "Login failed for user 'DOMAIN\PCNAME$'"

I am using Microsoft.SqlServer.Management.IntegrationServices in an ASP.NET web form to access an SSIS project in SSISDB. Testing locally on my own PC I am able to access the package from the test server and it runs fine.
My issue comes up when I try to run the site from the test server. The same test server hosts the site with IIS 7 and hosts the Sql Server database which stores the package with Integration Services. So like I said, the package is hosted on the server and when I run the site locally on my PC, all works fine.
When I run the site on test and try to access the package I get:
System.Data.SqlClient.SqlException (0x80131904): Login failed for user '[DOMAIN]\[PCNAME]$'.
I am using integrated security in my connection string:
SqlConnection connection = new SqlConnection(#"Data Source=[Test_Server];Initial Catalog=master;Integrated Security=True;");
IntegrationServices integrationServices = new IntegrationServices(connection);
My error comes up here when trying to connect.
I've tried adding '[DOMAIN]\[PCNAME]$' as a Sql login using Windows authentication with every permission I can think of. User mapping for database SSISDB has accessadmin, datareader, datawriter, owner, public, and ssis admin. I know not all of these should be needed, but I'm trying everything.
I went to SSISDB under databases, and gave the login permission to Connect, Execute, and Select.
Under Integration Services Catalogs I gave my folder, under SSISDB catalog, permission for the my Windows User ('[DOMAIN]\[PCNAME]$') login to Read, Execute Objects, and Read Objects.
I gave the SSISDataTransfer project permission for the Windows User to Read, Modify, and Execute.
I'm out of ideas and figure it's probably some IIS issue. It has Windows Authentication installed and set.
Anyone have any ideas? I've found posts about how to get the code to work, but nothing on connection specifics. Thanks!
i have had similar problem recently and i have worked with SSIS packages being used with web applications too. in my opinion you should use a custom user account to be used as your app pool account. and you will have to add this account to your database server. when running an app pool as local system or network service, the account being used for connection to a remote database server will be "DomainName\MachineName$" which will be different for every machine which tries to connect to your sql server. so instead of adding all these user names in sql, you will be better off using a custom user account.
Secondly looks like your web application does not run on the same machine as your sql server which i think will not work because you can invoke SSIS package from the same server only.
Another thing to try is to add a credential to sql server - in Security - Credentials in SQL Server management studio. This credential would be the authenitcated user that you are running it successfully under. Then in your SSIS package, in SQL Server agent, go into the job step and in the "Run As"drop down, select the new credential for your user that you created.

Having problems with aspnetsqlmembershipprovider

I have developed in asp.net for years and usually set up membership and roles in the same sql server database I use for cms. However, because I only need to password protect a couple of admin pages in my current project, I thought I would try the built in Account folder setup that Microsoft includes in its website template. So far it's been a nightmare.
I have the login working on my local machine, but when I uploaded to the server, I get the following 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: 26 - Error Locating Server/Instance Specified)" The connection string provided by Microsoft says instance = true.
GoDaddy, the hosting provider, responded to my request to see if they could correct the connection string, by saying that the MDF file in the App_Data folder would only work on a dedicated server. (I'm skeptical...)
Making things even more challenging, I can open the sql express (.mdf) database and see the account I set up using the registration form. But when I try to test the default aspnetsqlmembershipprovider with the web configuration page inside my ap, I get a message saying:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
I would really appreciate help in understanding what is happening so, if there isn't a duh solution, I can at least dismantle this thing in an intelligent way and then set up authentication in the webconfig, which would have taken ten minutes.
Many thanks.
Godaddy is wrong. Put your connection here and take a look at it for you. Remember to remove your login id and pwd in the connection string.

Can't connect to database on server

I cannot connect to my SQL Server database when running app on server.
Everything runs fine when debugging but when I run on the server as ASPNET the user is unable to login.
I created the dataabse in a test project then simply connected to this db. My connection string is
Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Temp\Barry\fsr\FSR.mdf;
Integrated Security=True;Connect Timeout=30;User Instance=True
So this asp app runs on IIS 5 and when deployed the initial select works fine as my gridview that I have a binding to shows data but when I run the program (update the db) I hit the following:
[SqlException (0x80131904): Cannot open user default database.
Login failed.
Login failed for user 'hostxxxxx\ASPNET'.]
I am not creating this database programmatically as mentioned previously, simply connecting to an existing database.
The database is located on my c: - but I have added user ASPNET. How can I add this db to the program as a resource rather than reference a copy on c:?
My first question is this: If you have control of the server, why are you using an attached database. From:
AttachDbFilename=C:\Temp\Barry\fsr\FSR.mdf
There is no reason to attach if you can control the server. Attach the database to the actual instance in SQL Server, not with the bastardized version you have above. The bastardized version is useful on an ISP that does not give you access to SQL tools. Beyond that, it is more work than it is worth.
The second problem you have is authentication. There are a couple of ways to handle this. The easiest is set up a SQL user to access the database. If every user will have login credentials, you can keep the Windows Authentication method, but you have to turn off anonymous access, so every user GETS authenticated. As long as anon is a choice in IIS, it will default to anon and you will have issues. The third way is to impersonate a user for database access. I guess the fourth is open your database wide open, but I don't suggest destruction of security to make something "work".
If you have your database on a server, you need to use a server-based connection string - something like:
Data Source=servername\SQLEXPRESS;database=FSR;
Integrated Security=True;Connect Timeout=30;
Your user needs to have a login on the server, and a user in the appropriate database, in order to connect successfully.
See the ConnectionStrings.com web site for a huge list of possible connection strings - and what their settings mean and how you can change those.
You need to get into your database and assign the proper privileges to the account that is trying to access the database, which in this case looks like the built-in ASPNET account. Instead of the ASPNET account, you should use the NETWORK SERVICE account. You can change this through IIS.

Unable to open database remotely

Pls help me, My newly created web application is using a SQLServer Express database. If I run the application in local machine its working fine, but if I try to open the database connection from another system in the network it is giving error Cannot open database . I have used connection string --
conn.ConnectionString = "integrated security=SSPI;data source=USER-CCE8C22332\SQLEXPRESS;" +"persist security info=False;initial catalog=Marketee";
i think you need to give access to the ASPNET user to access your database if you are using integrated security. The reason is that when the user connects to the website, the server-side processing is done via the user set up in IIS in teh application pool.
To test, what you can do is switch from integrated security to passing a username and login and see if you can connect then.

"ASP.NET" error: Access to the remote server is denied because no login-mapping exists

I'm able to execute a stored procedure which queries a Linked Server directly, but when I call the same sproc though ASP.NET then I get the following error:
Access to the remote server is denied
because no login-mapping exists.
When I execute it through SSMS, I am connected through my Windows domain account.
The site is ASP.NET with Forms Authentication on IIS 7 and SQL 2008 on my local machine.
The Linked Server is set up to "Be made using this security context" for all logins.
The login that you connect with to your initial database does not have access to the linked database. Why don't you use the account that the application impersonates to connect to the database in Management Studio, and diagnose the issue that way? If you know the login, just create it in the linked database as well with the required permissions.
If creating a new login on the linked server is not an option, create a mapping. If you read the fine print on the wizard, it says "for logins not defined in the list above, connections will be made" using the current security context. Which means that if you don't define a mapping, it will use the current credentials for the link.
There are two login/password pairs required. One is for the SQL server that has the linked server on it. The 2nd is for the 'thing' the linked server is connecting to.
E.g.
There is an ODBC connection on the same machine SQL server is on.
This ODBC connection connects to an ORACLE db. During the ODBC setup a user name and a password were required: UN "XYZ", PWD "123".
When creating the linked server to this ODBC connection its necessary to add the user name "XYZ" and password "123". This is done on the security page of the linked server properties. Click "ADD" and in the 'Local Login' box enter the SQL server user name that the app uses to connect to SQL server. In the 'Remote User' box enter 'XYZ' and in the 'Remote Password' enter '123'. Finally select 'Be made using the login's current security context'.

Resources