Utkarsh bachchan
Utkarsh bachchan

Reputation: 1

Could not determine storage version; a valid storage connection or a version hint is required. Error seen

I'm from the Devops team. We created a dotnet subsite in IIS:

  1. Created a Virtual Application in IIS under the main site
  2. Added Physical Path as inetpub\site\subsite

Requirement:

  1. We have a main site. Ex - www.site.com
  2. We need a subsite like www.site.com/subsite which should redirect to the www.site.com
  3. The goal here is that our dev team can do testing and changes under www.site.com/subsite and not directly in www.site.com

RouteConfig.CS looks like this:

            routes.MapRoute("TaxSupport", "TaxSupport/{controller}/{action}/{id}", new { controller = "Tax", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Tax", action = "Index", id = UrlParameter.Optional });

Output:

Output of www .site.com/subsite

Probe:

  1. We have already referred to multiple Stack articles in this regard.
  2. We have multiple applications running fine with same Entity Framework and other packages.
  3. We can confirm that subsite web.config is using the same DB connection strings as other applications.

Upvotes: 0

Views: 174

Answers (1)

Rajesh  Mopati
Rajesh Mopati

Reputation: 1514

To deploy an application in an Azure Virtual Machine (VM) running IIS, you can follow below steps:

  1. Create an Azure VM with required configuration such as the operating system and size.

Azure Portal > Create > Select Server OS.

enter image description here

enter image description here

  1. Use Remote Desktop Protocol (RDP) to connect to the VM

enter image description here

  1. Use FTP to upload your application code to the VM.

  2. Open the Internet Information Services (IIS) Manager and create a new website or web application in IIS.

  3. Configure the website or web application to point to the location of your application code on the VM.

  4. Configure any necessary IIS settings, such as the application pool and virtual directories.

To deploy a subsite under a site in IIS (Internet Information Services)

Create a Sample Web App and an API for Subsite.

And publish the application as shown below.

enter image description here

enter image description here

Copy these files and paste in the VM of Azure.

enter image description here

  1. Open the IIS Manager on the server where you want to create the subsite.

  2. In the left pane, expand the server node, and then expand the Sites node.

  3. Right-click the site under which you want to create the subsite, and select "Add Virtual Directory".

  4. In the "Add Virtual Directory" wizard, enter a name for the virtual directory and browse to the physical path of the content for the subsite. Click OK to create the virtual directory.

  5. Right-click on the virtual directory and select "Convert to Application"

  6. In the "Add Application" wizard, select the Application pool you want to use for the subsite and click OK.

If you want to configure the subsite with custom bindings, you can do so by right-clicking on the subsite and selecting "Edit Bindings".

Once the subsite is created, you can use the IIS Manager to manage and configure the subsite, such as setting up authentication, creating custom error pages.

And the web.config is using the same DB connection

  1. Connect to the Azure VM using Remote Desktop Protocol (RDP) and open the IIS Manager.
  2. In the IIS Manager, right-click on the parent website and select "Add Web Site".
  3. In the "Add Web Site" wizard, enter a name for the sub-site and select a physical path for the sub-site's files.
  4. Select an appropriate Application pool for the sub-site.
  5. Click on "Test Settings" to make sure the configuration of the site is correct or not.
  6. Open the web.config file of the sub-site and locate the connection string section. And Remove the connection strings from the web.config file of the sub-site.
  7. Add the below line of code to the sub-site's web.config file, in the section: replace "parentSite" with the name of the parent website's config file)

<connectionStrings configSource="parentSite.config" />

  1. Restart IIS by running the command "iisreset" in the command prompt. Test the sub-site by visiting the sub-site's hostname in a web browser.

Upvotes: 0

Related Questions