radja wrote:Hi Guys,
Please could you advise?
I followed manual step by step.
I only didn't update connection string in Settings.txt because its done previously and nopCommerce communicates with sql azure already.
DataProvider: sqlserver
DataConnectionString: Data Source=mc95brisi0.database.windows.net;Initial Catalog=noCom;User ID=xxx;Password=xxxx;Persist Security Info=False;MultipleActiveResultSets=True
But if I click http://nopex2.cloudapp.net/ address it gives me nopCommerce installation, but as far as I know its installed :-).
Last version of nopCommerce.
Thx a lot!
Radim
I also followed the guide step by step using version 3.40. Got little to no errors throughout all steps until the last one. Browsing to the xx.cloudapp.net URL for my site also gives me the installation screen again. I'm assuming it must be due some issue connecting to the Azure SQL Database?
I'm trying to set this up so that I can do the development work in Visual Studio on an Azure VM and then deploy it to an Azure Websites instance with the SQL on Azure SQL Database as the backend but each time I try to implement I get the install screen again.
My first attempt I had nopCommerce source code loaded in VS and in debug I connected to Azure SQL Database using the raw connection string during installation. Then I passed code up to source control and tried getting it on another computer but when debugging on the other system I again was presented with the installation screen.
Any extra help navigating this would be great.
Thanks.
Edit:
After some editing of the connection string I finally got another error instead of the install screen, "No database instance". After hours of experimenting it appears that mostly the install screen shows up and only sometimes do I get the no database instance error. I realize now that when debugging from Visual Studio the program is using a different connection string and connecting to the local SQL database originally setup. To simplify I've changed the connection string in the source files and stepped through the code to see where things are going wrong and it appears to be in the "CreateTablesIfNotExist.cs" class. "context.Database.Exists()" returns false with a connection string pointing to the Azure SQL Database instance but true with the local database connection string.
After some Googling it appears others are having issues here as well:
https://www.nopcommerce.com/boards/t/24035/sysadmin-vs-db_owner-especially-during-install-database-exists-checking-in-installcontrollercs-vs-createtablesifnotexistcs.aspx
So my current working theory is that the connection string to the Azure is using a user that doesn't have the sysadmin role for the server (haven't been able to verify this as SSMS won't let me check properties on logins) but the local connection string uses the sa account and therefore works.
Does this sound credible to anyone else? If so any idea how this might be solved.
Thanks.
Edit 2:
Sorry turns out the issue was the connection string all along. Here is the format that ended up finally working for me:
DataProvider: sqlserver
DataConnectionString: Data Source=tcp:<Azure SQL Server>.database.windows.net,1433;Initial Catalog=<Azure SQL Database>;Integrated Security=False;User ID=<user>@<Azure SQL Server>;Password=<user password>;Connect Timeout=30;Encrypt=True
I think the main thing I was missing the whole time was "Encrypt=True".
Now time to start the real work, hah.
Edit 3:
Jumped the gun, re-published using nopAzure again and then re-added the connection file as indicated above but now it's back to loading the install screen. No idea why old deployment worked with the new connection string but now the new one won't, must be other variables than the connection string in Settings.txt then right?
Edit 4:
Ok last edit, I'm sure I look like a nutjob already. After waiting 30+ minutes the site loads without issue and no installation screen. Not sure why there would be a delay after adding Settings.txt but it seems to solve itself with some patience. Tested it with 2 identical databases on Azure, created a test product with one connection string, swapped it to other database and the test product still showed, waited 30-60 minutes and it went away, same for swapping back again.