N1njaB0b
N1njaB0b

Reputation: 708

Deploying VirtoCommerce.Manager to Azure from Visual Studio

I am working with Virto Commerce server 2.4.561 and I'm having a great deal of difficulty successfully publishing to Azure from Visual Studio. Based on the documentation provided, it's not clear to me what the appropriate method is. Most guidance related to Azure assumes that I am using Git deployment. But in this case I am not. I am coding locally on my dev machine and I would like to be able to use web deployment to deploy directly to Azure from Visual Studio. However, the guidance found here seems to suggest that if you want to do your own deployment, you need to use deploy.cmd. I'm not exactly sure why that is. I can only guess that it has something to do with how the modules need to be packaged up.

I am able to run deploy.cmd and it appears to succeed, but I end up with an artifacts folder with 2,000+ files and folders in it and I am left to use old-school FTP to sync all those files up with the Azure website. Is this how it is meant to be done? I have tried to deploy directly from Visual Studio to Azure, and it appears to succeed, but the site does not behave correctly. Specifically, the custom modules I've built don't load correctly.

What is the right way to do this?

Upvotes: 2

Views: 321

Answers (1)

Dartal
Dartal

Reputation: 432

There is a way to publish your custom module directly from Visual Studio, but you still need a working Virto Commerce in Azure beforehand, and the easiest way to set it up is to use the Deploy to Azure button in GitHub.

  1. In the Azure portal create a new virtual application /MyModule with physical path site\wwwroot\admin\Modules\MyModule. It will be used for publishing a custom module.enter image description here
  2. Download the source code from GitHub with the same version as you have published to Azure, add your custom module to the solution and build it.
  3. In Visual Studio right-click on your module project and select Publish.
  4. On the Profile screen select Microsoft Azure Web Apps as a publish target and select your Azure Web App.
  5. On the Connection screen select Web Deploy as a publish method and add /Module to the site name. So your site name should look like this: myvc/MyModule.enter image description here
  6. On the Preview screen click the Start Preview button and make sure the file list contains only files related to your module and the action is Add for each of them.enter image description here

When you click the Publish button, Visual Studio will upload all module files to the physical directory configured for the virtual application myvc/MyModule. For subsequent publishing it will upload only modified files.

Update: You should restart the Web App via the Azure portal after publishing in order to load the new version of your code into the application. Thanks to N1njaB0b for reminding.

Upvotes: 2

Related Questions