How to configure Web Deploy 3.5 EncryptWebConfig rule handler? - visual-studio-2013

We are wanting to setup publishing via the Web Deploy method in Visual Studio 2013. I've installed Web Deploy 3.5 on the destination web server and it's deploying properly.
We'd like to also use Web Deploy 3.5's EncryptWebConfig rule handler to encrypt our web.config files post-publish as described here: http://blogs.iis.net/msdeploy/archive/2013/07/09/webdeploy-3-5-rtw.aspx, which gives a command line example. However this is not an option in the "Publish Web" Wizard > Web Deploy Method , nor do I know how to add in that rule through directly modifying the .pubxml PublishProfile... Or is the EncryptWebConfig a rule I setup somehow in IIS on the server?
I was unable to find any further documentation on this rule anywhere...

I had also tweeted a guy who works for the Visual Studio Web team and he came through with this answer:
Add the property <MSDeployEnableWebConfigEncryptRule>true</MSDeployEnableWebConfigEncryptRule> to your .pubxml file
I figured it'd be like this, but previously could not find any references to the proper tag name, MSDeployEnableWebConfigEncryptRule, anywhere.

Related

How to deploy Azure WebJob using different configurations for different environments in Visual Studio

We have several Web Apps and WebJobs with different configurations for different environment, e.g. Test and Release.
Each WebJob is deployed to a Web App using "Publish as Azure WebJob" in Visual Studio.
We are using the Config Transform extension to transform the App.config that consist of different config sections, connection strings and app settings that needs to be transformed. This works fine for local Debug and for Release.
The problem is that when we use "Publish as Azure WebJob" there is no way to specify which configuration to use and Release is always built and published even if Test is selected inside Visual Studio.
We have also tried to deploy the WebJob together with the Web App but it almost always hangs, same as described in Stuck when publishing Web App to Azure with WebJob
We don't need to use config transform if that's not possible, e.g. we could configure directly in Azure. But I haven't found a way to configure config sections directly in Azure.
Yes this is a known VS tooling pain point that comes up often. The short answer is that web.config style transforms aren't supported for general application types like Console apps.
This has been discussed recently in the context of WebJobs in our public repo here. That issue also links to the VS User Voice issue for this. That item also links to the SlowCheetah VS extension which some users have said works for them. You might give that a try.
If that doesn't work for you, then you'll have to manually manage your settings via the app settings blade in the Azure portal.
I added a prebuild step to change the webjob-publishing-setting.json file and the app.config file depending on which Configuration is selected.
The webjob-publishing-settings.json only had the name. Then from Visual Studio 2019 I used "Publish as Azure WebJob" and that created a second webjob with the new name and new configuration.
Works great!

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?
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.
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.
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.
In Visual Studio right-click on your module project and select Publish.
On the Profile screen select Microsoft Azure Web Apps as a publish target and select your Azure Web App.
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.
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.
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.

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

How to create the asp.net web setup project

I have a Asp.net application which I want to make it easy to depoly in client machine by click the .ext or .msi file.
Then I found the "web setup project" in vs.
However I have no idea how to make it.
In my case,my application need .Net 4.
And after the app is deployed I have to modify something in the web.config which I want to gather through the install wizard.
Also I need to do some clean work after deploy(modify some files).
So I wonder if my requirement is possible using "web setup project",and how to make it?
In Visual Studio you can modify files during install only through custom actions. So you will need to write custom code which does what you need. Regarding .NET Framework 4, it can be added as a prerequisite.
If you want an easier solution, you can try a commercial setup authoring tool: http://en.wikipedia.org/wiki/List_of_installation_software
For example, Advanced Installer has a dedicated project type for ASP.NET applications.
Yes,We can make Custom Actions(Framing Connection during installation ,Consuming WCF service for Web App)to .msi file during installation.
If you want to have more clear picture about this refer my articles.
This is to create or change Connection string along with setup creation for Windows Application
http://www.codeproject.com/Tips/446121/Adding-connection-String-During-Installation
In this creating setup file for Web App which consumes WCF service
http://www.codeproject.com/Tips/477202/SetUp-file-Creation-for-Web-Application-which-Cons

How to configure a published package as a website in IIS

I want to auto publish the sites using teamcity. I am using teamcity's Visual studio to publish a website. It creates a pre-compiled web directory as following
D:\publish\PrecompiledWeb\Books in the checkout directory.
Now I need to use it with IIS. If I point the IIS to that directory It gives the following error
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Any Idea what I am doing wrong.
I'm not entirely clear on the steps you're taking from your question, but it looks like your ultimate goal is to use TeamCity to create a deployable package and publish that to IIS. Your best bet is to do this using WebDeploy and fire it off from a Visual Studio build runner in TeamCity with appropriate parameters. There's a step-by-step guide to doing this in the You're deploying it wrong series.

Resources