We are currently setting up a CI/CD pipe from Azure Devops to Litium on Demand cloud solution and are having some diffuculties.
Hoping anyone has done a similair solution, this is our challenge:
There are two ways to go about this; using the sftp or msdeploy.
The sftp works to the extend that devops is not whitelisted and thus cannot transfer the files. The solution is to have a server running a deploymentgroup agent within our network and/or VPN. This would work but adds more complexity and we are not that keen on having more environments to manage.
So, the msdeploy is whats left and thatās what we have been working on. The problem seems to be that we cannot quite get it to work using the task 'MSDeploy Package Sync: ā and was wondering if any of you have been encounter the same problem or maybe have a totally different solution to the problem?
Have a nice day and hoping you would throw us a helping hand!
Not sure why but getting MSdeploy to work from azuredevops is not an easy task. Deploying with from visualstudio is not problem but something different is happening i azuredevops deploys.
We had to resolve to a special build and a powershellscript to add a parameterfile to the deploypackage to get webdeploy working against litium sharedhostingenvironment. Using exakt samt process as for deployment to a service agent results in 1. wrong files deployed 2. deployment refused because of work setting in generated deployment parameter files.
But perhaps patric script solves this in a different manner
The error about āunauthorizedā is from our experience due to that you try to deploy to another web application or forder than you think you are because or settings in the parameter files.
@patric.forsgard I will take a look into some powershellscripting, thank you for posting your solution!
@Spotonkastebo Yes, it is really annoying, it should be easy right! In what way was your build special?
Thank you for your responses! Looks like the problem is in the way msdeploy is executed and the parameterfile. Will look in to your solutions and have a go at it!
@steve.redstorm the server simply responds with an Unauthorized, I think itās due to the parameterfile giving the wrong folder information, as previously mentioned.
@Spotonkastebo thanks for posting, Iāll take a look at how that could work out!
When building with msbuild we using this parameters to get all the files into the artifacts folder and then using the above script that I posted to use the artifacts folder as source.
yes transformation of configs is also important. We have transformation-config for the development- test and productionenvironment but they are not set at āsubfileā for the web.config because then the build pipelinw will consume them.
The build pipeline does a web.release.config transformation and then we do the environments specific transformation in the release pipeline. When using the deployment agent we donāt have to think about them at all but when using msdeploy we use a pipeline task called āFile transformā to do the transforms on the config in the deployment zip. For some reason neither the build or release pipeline performs transformation of the connectionstring so we also have added variable replacement to the release pipeline to handle that setting in the deployed web.config.