How to deploy clickonce application (Web publish) using MSBuild command line utility - jenkins

I would like to publish my WPF application (Click once deployment) into IIS using MSBuild command line utility. I could able to publish in to file system but web publish is not working
Any suggestions would be appreciated

Related

How to .exe file to msi via jenkins

I'm new to .net application (non-web application) project and using jenkins for continuous build and release. I completed creating builds for my project and got the .exe and dll files. But i need to repackage it(create a msi) before deploying to servers. So can anyone give a stepwise information for rePackaging and tool to be used with jenkins for packaging. I want to automate this process in jenkins CI AND CD.
Jenkins is not capable to pack any applications directly.
It will always use an external tool via a plugin or installed by you.
In MSI case, you need an windows agent with an app that will receive the command in command line and produce your deliverable.
Applications:
Installshield (very old - paid)
visual studio (paid)
TFS (on premises or cloud) (paid)
MSIX (? I don't know much about it)
WIX (free)
Jenkins plugin here

Dynamics CRM Visual Studio Jenkins

I am currently working on a project (CI) on Jenkins. I have to integrate the automatic deployment of my Visual Studio solution which contain Crm Plugin and CrmPackage.
In order to make the deployment automatic, i have a Jenkins Jobs which execute the task :
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"
Devenv CrmPackage\CrmPackage.sln /Clean
Devenv CrmPackage\CrmPackage.sln /Build Release
Devenv CrmPackage\CrmPackage.sln /Deploy Release
As my solution is not yet connect to CRM server, i have the error for deploy:
"The connection to the Dynamics CRM Server is unavailable.Error: The connection to the Dynamics CRM Server is unavailable."
I can connect and deploy manually with visual studio but i don't know how can i connect the server by command line with vstudio.I am a newbie in Crm deploy and my question is how to connect the Crm server by command line with vstudio.
how to connect the Crm server by command line with vstudio
Check out the xrm-ci-framework. Though it's targeted as being used for CI in VSTS rather than Jenkins, it contains a PowerShell script that can be used to connect to CRM via a connection string, and deploy a package.
You might also consider the spkl task runner for deploying your plugins separately. Spkl is a nuget package that allows you to decorate your plugins and have them automatically compiled and imported into CRM along with their plugin steps by running a .bat file manually, or from your CI build.

Deploy published mvc application as Azure Web App programatically

I have published my MVC application and now I want to deploy the same as Azure Web App.
I want my customers to open a .bat file in which they will be prompted for Azure Publish Settings and deploy the application.
I dont want to do the below.
Deploy the solution directly from Visual Studio
Use MsDeploy or MSBuild to build the solution with publish profiles like the below and publish in Azure
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe "I:\MyProject\MyProject.sln" /p:DeployOnBuild=true /p:PublishProfile=Production /p:Password=Mu50vKJfDdKfGsFvj5erC0awdxAi /p:AllowUntrustedCertificate=true /p:VisualStudioVersion=12.0
Can anyone suggest a solution ?
Thanks,
R. Venkatesan
There are several tools you can use to deploy a web app from the command line :
Azure CLI : https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/#cli
Web Deploy Command Line : https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/#webdeploy
I would prefer use a custom script that use Azure CLI so your customer will be asked for login to Azure instead of providing publish settings file.
Hope this helps,
Julien

Publish Azure Website to non-root folder from PowerShell

I'm testing my assumptions at the moment. I have my Asp.Net MVC application located at www.myapp.com/app and a third-party CMS system on www.myapp.com/.
The web-site is set up like described in this answer
At the moment I can publish both of the applications separately and manually from Visual Studio and it works fine.
However, I'm trying to publish my application from a build server where I'm using Azure Power-Shell scriplets:
PS> Publish-AzureWebsiteProject -Name myApp -Package MyWebDeployPackage.zip
However, documentation does not mention if you can publish with this scriplet to a non-root folder.
Any way I can publish an application to ~/app from a command line?
UPD: I can publish from msbuild via
msbuild .\SolutionName.sln /p:DeployOnBuild=true /p:PublishProfile=ProfileName /p:Password=passwordForAzurePublishing /p:AllowUntrustedCertificate=true
Where ProfileName is a web-deploy profile configured to deploy to sub-folder of Azure Web-Site and Password is deployment password from Azure profile.
However this is not an optimal solution: to deploy to test and to production environment, I need to build the application twice, which I'd like to avoid: if I compile views, it takes 7-10 minutes (we have 800 views). Doing this twice is a waste of time.
UPD 2: Created an issue on Azure SDK Tools repository: https://github.com/Azure/azure-sdk-tools/issues/2667
I don't think this is possible from PowerShell, but I might be mistaken. Looking at their publish code here https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1136-L1168
and also here https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1218-L1229
they don't have a parameter for the app name, and the code in the second link builds the site name/slot manually.
I would say open an issue here https://github.com/Azure/azure-sdk-tools/issues for this and somebody from the Azure PowerShell team should look at it.

How to create a setup file to install MVC .net web application?

I have MVC2.0 web application and I need to make an exe installer to deploy the application and the DB on the customer's server.
Is there a tool in VS2010 to do this or do I have to use a 3rd party tool?
You can create deployment package, bin deploy or simply use publish option to drop files to web server.
Here are some useful links:
Bin Deployment
VS 2010 Web Deployment
Package, One click deploy
Automating Deployment with Microsoft Web Deploy

Resources