Unable to connect to azure sql server - azure

I created a new Azure Mobile App and set up my Sql Server database with it. I use an email address as the username, and then assigned a password.
Once the Mobile App and the Sql Server db setup completed, I was able to get my iOS app to target it and use the Azure authentication services without any issue. I then inserted some data in to a table in the iOS app, without any errors.
Now, I want to open the database and verify the data. Anytime I try to connect to the server using SSMS or Visual Studio 2015, I am told that the login failed.
I use an email address like Johnathon#MyCompany.com. When the sign-in fails, it says:
Login failed for user 'Johnathon'.
Is it the email address for a login causing issues? My ISP blocks port 1433, so I thought that maybe that was the issue initially. So instead of using VS or SSMS, I moved to the web-designer on the Azure portal. When I sign in there, I receive the same error. This has occured across three different App Services setups. I tried using the older Mobile Services, and had this issue. I then moved to the newly released Mobile App Service but have the same issue. Each time I deleted the database and recreated it and the server.
I have also added my client IP to the azure sql server firewall.
I'm at a loss at this point.
Update
I have managed to sign in to the server within the Azure portal designer by omitting the database name. However, when I select the Design option, and then click the Design button on the database, I receive a Failed to create context error. I assume this is related to why I can't connect to the server when I specify a database name in the Azure portal.

As a note, having the # symbol in the SQL Azure login tends to cause a number of headaches and it is not recommended to have it in there. What you will notice is that SSMS and other applications try to use it as part of the server name which then causes context and other failures.
The easiest fix for this is to roll up another SQL Azure server with a login name that doesn't use the # symbol, you will have a better experience overall.

Related

Azure Data Studio - way to change default connection type for Azure SQL Databases?

I just recently started to use Azure Data Studio to replace SSMS and VS Code. So far it is working great. I do have one "issue" I was wondering if anyone else encounters. I run the application with my Azure AD Admin. Under Connections I see all of my subscriptions and the underlying databases:
When I try to expand a server, I get an error that it is trying to connect with a SQL account:
It then brings up the connection details where it is set to use SQL Authentication:
If I change the Authentication type to Azure Active Directory - Universal with MFA support, and click connect it does without issue.
My question is, is there a way to change what the server connection uses as a default so I don't have to try to expand, fail, change auth type, and then connect? It is nice not having to manually create all of the connections to all of our subscriptions and sql servers and just have them load there and open them.
I searched all the settings of Azure data studio, but did not find the option to change the default authentication type of login Azure SQL.
User and workspace setttings of Azure data studio, you can refrence this document.
You can click the power plug icon in the right and then choose Authentication type to login to the server.

Connect Kentico through Azure SQL

I've followed this tutorial https://docs.kentico.com/k12sptutorial/mvc-development and successfully run it on localhost, however when I try to publish to Azure app service the connection string doesn't seem to work at all and I've tried all the fixes including changing region of all services to be in one region, whitelist IP addresses.
here is the link of the site:
https://adia.azurewebsites.net
connection string:
Data Source=tcp:adiadb.database.windows.net,1433;Initial Catalog=adia;User Id=sqladmin#adiadb;Password=password
Please advice when went wrong. Thanks.
It looks like the DB is not available to other resources within Azure. You’re able to connect with SQL Management Studio, but not the Web application. When you create the database, there is a checkbox to make it available to other resources within Azure. By default this is disabled. I’m not at my computer just now, but I’ll update this when I am with a screenshot of where to check.

Azure Data Factory On-Premises Copy Error

I am trying to schedule an on-premises copy job that contains a SQL Server.
However I am getting a different kind of error when trying to enter the sql server credentials.
Type=Microsoft.Data.Mashup.InternalMashupException.Message..sorry,en
error occurred during
evaluation.,Source=Microsoft.Data.Mashup"Type=Microsoft.Mas..data
protection operation was unsuccessful. This may have been caused by
not having the user profile loaded for the current thread's user
context which may be the case when the thread is
impersonanting.Sources, "Type=Microsoft.Mashup.Evaluation.Inter...
I have provisioned the gateway onto the server where the sql server is hosted but getting this error.
Also I am using the Copy Preview feature to get this working.
I may be wrong here, but it looks like an authentication issue. Have you tried connecting to the server from the gateway? Open the Microsoft Integration Runtime Configuration Manager, go to Diagnostics and fill every field, then click test. If everything is correct, a green check should appear. You are trying to impersonate a user, so choose Windows instead of Basic.
Try with it until you get the green check, then make sure that the linked service you are using has the same info you used and it should work.
You can also try creating a database user and give it permissions to make the query you want, then changing the linked service to use the database user instead of the windows user.

How can I deploy my database from SQL Server 2008 Express to Azure SQL Database

I am using Visual Studio Community 2013, SQL Server 2008 R2 Express Edition for an MVC web application using entity framework code first migrations for my database.
I am trying to get my local application hosted on the Microsoft Azure platform.
I have registered for a trial account which expires in 30 days, and deployed my MVC5 app out which has been successful.
However, this app requires a database which I am struggling to deploy.
What is the easiest way to get my database deployed out to Azure as I do not seem to have the :
"Tasks" -> "Deploy Database to Microsoft Azure SQL Database" option available to me in SSMS.
I have extracted a Data-tier Application of my local database and have it stored on my C drive, however if I connect to my Azure Account in a second window, and right click the server then select Deploy Data-tier Application, it fails on "Creating schema object in database" with the following error:
TITLE: Microsoft SQL Server Management Studio
An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------ ADDITIONAL INFORMATION:
Users cannot be mapped to certificates, asymmetric keys, or Windows
logins in this version of SQL Server. (Microsoft SQL Server, Error:
40528)
I'm assuming its tried to create my local account plus the IIS APPPOOL account I had to set up to host the website on my local network, however I do not see a way of removing them from the .dacpac export.
When I refresh the Databases node, there is still no database, I'm fairly lost now as to how I might get my db deployed to this server?
If you can extract a compatible Data-tier application and then Deploy it to your target server using your current version of Management studio, then this approach should work, see this link for more reading on ensuring your database is compatible.
Failing this, as was in my case. I downloaded Management Studio 2015, which gave me the option to deploy database to Azure by simply right clicking the required database.
Again, this threw up the error regarding my database level IISAPPOOL user, but not my server account user. As a way around this, I took a backup/restore of the database and removed this user then deployed the copy database obviously minus the problem account.
Now all that was left to do was add a transform to my Release web.config with the Azure connection string as provided on the Azure dashboard, and re-deploy the website.
Problem solved.

Azure - Changed admin password for DB and now can't access database

I have a Azure account and have deployed an MVC app.
I changed the admin password for the db and updated my web.config accordingly and after I've published the app, the app can't access the db. I get the following error:
Login failed for user 'xxx'.
This session has been assigned a tracing ID of '11a7a162-ff21-42f0-a8ea-8e5ce25b8ab6'.
Provide this tracing ID to customer support when you need assistance.
Any help appreciated. I've been over everything with a fine toothcomb and I can login to the db using SQL Management studio using the new credentials. The DB is dead however.
The only other thing I did was change the size of the DB from 1GB to 5GB.
I managed to fix this and for anyone out there, here's the gotcha. Even when I changed the connection strings in the publish profile, they were ignored. I had to go to the Azure portal and change the connection string settings against the deployed web app directly.
I wonder whether this is a bug with Azure. I would have expected my publish profile settings to change the connection strings on the deployed application.

Categories

Resources