0

what I did;

  1. I have my c# windows form application on Azure Repo and I created a build.

  2. I assigned my physical test server to Azure DevOps under the Deployment groups page. And it is online.

  3. I defined a release, I added an artifact that refers to the build pipeline from the Azure repo.

  4. Now I want to transfer my windows form app release files to my physical test server (windows) under the Desktop folder and run. (also stop and delete previous app if it is already running)

  5. For that, I tried to add a stage. But for the stage templates, I don't know which one to choose. There are deployment options for IIS and Azure services.

Bufre, I published my ASP.NET app using IIS website deployment. Worked fine. But how to do it for a desktop application? How to transfer and run?

enter image description here

I see a as a similar issue here, But I am new to YAML files and I could not produce. Where to mention target physical path, which template to choose? Could you please advise on the steps?

Ali CAKIL
  • 383
  • 5
  • 21
  • What action do you want to take in the server after you moved to files. Do you need to restart Windows services or restart the IIS ? – Kağan Mersin Apr 08 '22 at 16:29
  • There is a windows form app which is always running at the target path in the server. Once I released the new one, I want to replace it with new release and rerun the exe – Ali CAKIL Apr 08 '22 at 17:52
  • You could try to create Windows service and add your application to that service. When pipeline want to change files, stop the service and start it after files were changed. – Kamil Kwiaton Apr 08 '22 at 20:07
  • @KamilKwiaton how to do that? – Ali CAKIL Apr 09 '22 at 05:42
  • I find a challanging way, But not lots of work to do there. There is azure rest api I found and it supports downloading artifacts. Such as : GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&api-version=5.0 but this downloads as drop.zip and it includes all the project with source code. seems to me it downloads the repo. Not for production or QA server. I need release files to run the application. Even it could give me the release file, needs a a service, open that drop.zip replace release files with the new ones, start etc – Ali CAKIL Apr 09 '22 at 06:55
  • @AliCAKIL If you make run somethings on OS, definitely you need to convert the process to the OS services(Linux or Windows it does not matter). Azure devops has tasks for this kind of operations so you should avoid to use Rest API for these operations. First task you need to use AzureFileCopy@4 to copy files remote macgine afterward PowerShellOnTargetMachines@3 for restart service in remote machine. That is it. – Kağan Mersin Apr 09 '22 at 11:28

1 Answers1

1

You must install the DevOps agent on this server, then add it to the agent pool and then use any task that allows to install your app (depends on what kind of app you have). All tasks will be executed on the server directly, so you can use PowerShell, cmd or what ever.

https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops

https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/pools-queues?view=azure-devops&tabs=yaml%2Cbrowser

FreemanRU
  • 199
  • 8