简体   繁体   中英

Can IIS and SQL run on the same Azure Virtual Machine?

I am testing moving our websites to Azure.

I have created an Azure virtual machine and Installed IIS and SQL on it.

Following that I have uploaded the website (MVC Framework 4.5) to IIS. Having created a temporary index.htm file (for testing) I can access it externally using the relevant URL.

I have also created the SQL database and can connect to it externally.

However when I try to access the original recreated website (which should connect to the SQL database) I get the standard error below:

"500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed."

I have tried all permutations of the connection string (using the correct username and password) to but no avail.

Can IIS and SQL be running on the same VM and if so, what is missing so as to be able to allow the Website to connect to SQL?

I have done all the Googling I can think of so any help would be much appreciated.

You can definitely run IIS and SQL on the same machine. Hard to guess what is wrong without seeing the whole error or code however sqlcmd could help in troubleshooting. You can use this to verify that you are able to connect.

http://msdn.microsoft.com/en-us/library/ms162773.aspx

Said I would get back to this question. Solution was to copy relevant System.Web.* MVC files to the server. The first connection string above worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM