[tutorial] Step by Step guide on how to get nopCommerce 3.1 to run on Microsoft Azure Cloud Service and Azure DB

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hi Radim..  I'm running into the same problem, could you fix that?

thanks
9 years ago
This tutorial does not work for me because while deploying the dabatase to Azure, it says that some features are not valid in the azure DB. These features are Full Text Search. How do you avoid that?
9 years ago
If you use Azure Sql Database, then you are out of luck. SQL database in azure does not support fti.
9 years ago
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.
9 years ago
Hi I have same problem, I have created new controlers, views and etc. I published my site to Azure and created DB from scripts based on my local  Nop.Db.sdf. I published my site also local and replace Plugins folder at Azure with Plugins folder from locally published one. I also added InstallPlugins.txt from locally published App_data folder to Azure. But my changes at settings.txt didn't work before I changed settings.txt connection string with the exampe of [email protected]. Maybe "Encrypt=True" is the key, or that I placed all at one row, I am not sure right now.

I restarted my site at Azure and now it works, but..... now I have problem with the database data.

I have been using SqL Compact Query Analyzer to open Nop.Db.sdf, and to create script with schema and data, but I lose all my Cyrillic strings and all Binary Pictures :( How do you convert your sdf databases?

Edit:
I fixed problem with Cyrillic strings, Database at Azure should have Cyrillic collocation. But binary pictures problem still persists.
9 years ago
[email protected] wrote:


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.


A nutjob??...hardly...this stuff can be pretty tricky, and without your comments, folks like me would have to trip over the same hurdles before finding the solution. Kudos on the edits.
Your last post...about exercising patience, was truly invaluable to me.

Thanks,
Steve
8 years ago
I just want to add that if any of you guys still have questions about Azure Cloud Services this link is a complete article about it.

http://justazure.com/microsoft-azure-cloud-services-part-1-introduction/
8 years ago
UPDATE: Now nopCommerce supports web farms and multiple instances on WIndows Azure. Please see changesets 54709889c514 and 8014f448a58a. Also have a look at a separate subtask #12853
7 years ago
Hello everyone. Combining various sources, including info from answers within this thread, the solution now (years later, in some cases!) seems very simple.

1) Create the database server and database in Azure. Don't forget your db username/pw. I always just stick them in a word doc and encrypt it.

2) Download and unzip the nopCommerce source

3) Add a reference to Nop.Admin within Nop.Web- many users are reporting that after successfully deploying to Azure, they can't get to the admin site.

4) Publish Nop.Web- select Azure deployment. Create a new web app or select an existing web app if you created one already. Enter your sql server connect string (found in azure by selecting your DB), database name, and database pw

4.1) Many people are reporting that they get 5 errors regarding missing DLLs- this is caused by a security mechanism- DLLs are marked in right-click->properties->general as blocked- you must check the "unblock" option in each to continue. They can be pretty buried so to save you time, open powershell and enter: dir D:\Projects\Nop -recurse | Unblock-File   of course, you'll replace that path with the path to your nopcommerce folder.

4.2) If you ran into the issue in 4.1 and have now done the fix, re-publish. It should succeed this time!

5) Successful publish should launch your site. If not, navigate to your site URL- found in Azure. This should launch the nopcommerce installation wizard. Fill out the fields on the screen, including your DB username/password.

6) Celebrate, hopefully.

Good luck.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.