Change database location

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I need to change database location from Azure SQL database to database running within Azure VNet. Nop is running as Azure App service. App service connect to database within Azure VNet by VNet integration.

I edited App_Data\dataSettings.json but after that I receive below error when I open the web.

----------
An error occurred while starting the application.
.NET Framework 4.7.2563.0 X86 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452    |    Microsoft Windows 10.0.14393
----------

I can connect to the database running within Azure VNet from the remote PC by Azure point-to-site VPN.

Does anyone know what I have to do? Thank you in advance.
6 years ago
Hello,

This is not a Database error. You must resolve .Net Core errors first and also solve permissions on your website for IIS User.

This will help.

Thank you,
Atul
6 years ago
If I restore SERVER, DATABASE, USER and PASSWORD in dataSettings.json then I can open the website without .NET Core error.

{
  "DataProvider": "sqlserver",
  "DataConnectionString": "Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=False;Persist Security Info=False;User ID=USER;Password=PASSWORD",
  "RawDataSettings": {}
}

No tables have been created in the new database server so I'm expecting to see Nop installation screen appear but I can not reach to installation screen because of the error.
6 years ago
dataSettings.json is automatically created at the time of installation. If nopCommerce does not find this file at its location, it would ask you to install nopCommerce again.

One more thing, have you checked your permissions for IIS User?

Thank you,
Atul
6 years ago
Thanks for your replies Atul.

The cause is my wrong setting in Azure virtual network gateway.

As you can see in the below, when you use Azure VNet integration, IKEv2 must be disabled but I mistakenly enable it and it was a reason why nop couldn't connect to the database within Azure virtual network.

https://blogs.msdn.microsoft.com/wushuai/2017/12/10/integrate-web-app-with-azure-virtual-network-by-point-to-site-vpn/

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