Search code examples
azure-devopsftppublishingmsdeploy

How to publish asp.net website using AzureDevOps in ftp


I want my project (asp.net api) to be enabled CI/CD using AzureDevOps as my CI/CD Tool.
I want my published files to uploaded to my hosting provider via FTP.

Currently what happens is when build the product via Azure DevOps it create the application as Msdeploy file. which is not supported in my hosting provider via ftp

Build

build steps

Build Artifact enter image description here

As you see the build artifact which is in the format of the web deploy

Release enter image description here trying to upload the artifact which is the zip files and ms deploy files.

After uploading the file the server doesn't how to deploy the msdeploy project files. How can deploy a website using AzureDevOps

expected files to be uploaded in ftp enter image description here

Either i want to upload the files as regular files which is supported on ftp or i want execute msdeploy in automated manner


Solution

  • The workaround for this is to configure the Visual Studio Build task to generate your build artifacts as files instead of package.

    The default MSBuild Arguments of Visual Studio Build task will output the build artifacts as zipped package as shown in above screenshot you posted.

    You can try changing the MSBuild Arguments as below. This msbuild argument will output the build artifacts to folder $(build.artifactstagingdirectory)\ as regular files.

    The you can publish the files to your hosting provider via FTP.

    /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish
    

    enter image description here