0

I have a database I've created on my local machine that I can't seem to correctly deploy to SQL Azure. I'm deploying two databases, including the one that provides user membership.

Every time I attempt this, when I try to login and access to the database is attempted, I receive a The system cannot find the file specified error:

I've tried deploying the database every way I could from Microsoft SQL Management Studio - by right clicking my databases and "Deploy Database to SQL Azure", by generating drop and create data only SQL scripts and running these against an existing target database, by creating a bacpac and importing this and all of these have the same result.

I've double checked connection strings in my .NET MVC applications web.config and these are all correct.

Interestingly, if I run my website locally with connection strings that pointed to my updated Azure SQL db, everything works fine - but on my Azure Website I always get the same results.

2 Answers 2

1

Your issue actually looks like a connection string issue but if anyone else ends up here thanks to Google you can resolve orphaned users on Azure SQL Db using:

ALTER USER <user_name> WITH Login = <login_name>;

Sign up to request clarification or add additional context in comments.

1 Comment

I did end up here thanks to Google and that did the trick with the orphaned user. Thanks.
0

I am not a AZURE expert, but when moving DB's from one server to another sometimes user's get orphaned making the DB not accessible.

Can you run this command on the AZURE DB via SQL MANAGEMENT STUDIO?

exec sp_change_users_login 'Report'

It will tell you what username and UserSSID may be orphaned. If indeed there is a returned record run

EXEC sp_change_users_login 'Auto_Fix', '[[UserName_goes_here]]'

3 Comments

the sp_change_users_login doesn't seem to be supported in Windows Azure, Could not find stored procedure 'sp_change_users_login'. - is there another command to achieve the same result?
Did it find exec sp_change_users_login 'Report' ? what did it display? If it found somthing that means a user is orphaned.. try just creating another user with access to the db and use those new credentials..
No, the command exec sp_change_users_login 'Report' would not run on the server, saying the above message, Could not find stored procedure 'sp_change_users_login'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.