Unable to copy files and folders on azure while CI/CD - azure

I am trying to deploy my node application on azure. The deployment is successful but as I check the KUDU console the files haven't updated. All the files and folders are the same as previous.
I am using Azure VSTS for CI/CD, as I tried to use "copy files" task for coping the files and "publish artifacts" task for deploying but it doesn't work. The task output in the console shows that it has copied the files but the KUDU console shows no changes.
See the screenshots for more context -
Copy files plugin SS, Copy files description, Publish artifacts
Actual result: The files and folders are not updated on every deployment.
Expected result: The files and folders must update on every deployment.

Your Copy Files and Publish artifacts tasks are part of your Build pipeline. The Publish artifacts task makes items you choose available as a named artifact to a Release pipeline, while the copy files task is usually used to explicitly separate files from the working directory into a staging directory. Technically speaking, this task isn't necessary, as the Publish artifacts task will allow you to put a source folder that doesn't need to be under the $(build.artifactstagingdirectory), but it is helpful to keep clutter out of build artifacts.
While Most of the tasks that are usable in the Build pipeline are also available in the Release pipeline, it is not true for all. It's not clear from your question, but you should probably be using the Release pipeline to actually deliver your product.
Using jobs run on deployment groups (collections of machines that have been registered as agents), or Azure App Service tasks you can specify how to get your software where it needs to go.

Related

Azure DevOps Pipeline: Download publish artifact (webapp.zip) to specific server or local directory of PC

I have created a pipeline in Azure DevOps and wanted to download the publish artifact to a server, each time I am running the pipeline I can see the Published zip file in Drop folder on Azure but I am not getting any way to download the zip on local directory (specifically I want to download webapp.zip file in a folder on a specific server).
Please suggest which task I need to add and where I can add the server details for downloading the zip file.
Please suggest which task I need to add and where I can add the server details for downloading the zip file.
Based on your requirement, you could use the Download Build Artifacts task or Download Pipeline Artifacts task.
Depending on what task you use to publish artifacts:
Publish build artifacts task -> Download Build Artifacts task
Publish pipeline artifacts task -> Download Pipeline Artifacts task
You could define the path(Destination directory) on your local machine in the task, then the zip file will be downloaded to local machine.
Note: Since you need to download the file to local machine or server, you need to run the pipeline on Self-Hosted agent.

Where to find artifact in Azure DevOps Custom agent pool

I am using a custom agent pool in Azure DevOps. I have made a build and published the artifact but I want to update a file in artifact without creating a new build. how we can do that in Publish Artifacts task it showing that upload /home/ubuntu/myagent/_work/4/a to file container: #/9464/Artifact-Name.
I am logged in to agent pool server and checked all the directories but I couldn't find the file container location. Can any buddy help me to find the Artifact location in agent pool.
Thanks in advance.
Based on your drop location, you probably can't. The only way I imagine this would be possible is if you were publishing to a share location instead.
When you publish artifacts (that would be visible from the build summary), those are stored on the Azure DevOps database content tables and are immutable. As Jane Ma mentioned in a comment out about the local files:
The directory referenced by $(Build.ArtifactStagingDirectory) is
cleaned up after each build. [...] you can't edit published artifacts.
You can get them in agent pool's local file, but all local operations
are not synced to the Azure DevOps. If you want to do follow-up work
on this artifact, you need to run a new build to update it.

Azure devops build pipeline- publish artifact process

I have created the azure build pipeline for my website application. In this, there is a task of Publish Artifact Which I think supposed to publish a website. But right now it is publishing without the dlls. Means it contains the *.aspx and *.aspx.cs files. It supposed to create the dll files for *.aspx.cs files. Could you please let me know which publish option/task I am supposed to choose for my website. Which will be equivalent to the "Publish Web App" command in the azure build pipeline.
right now it is publishing without the dlls. Means it contains the
*.aspx and *.aspx.cs files.
For this issue, I tested publishing the website to local in vs. From the local file directory, we can see that the dll files are in the Bin folder. You can set the system.debug=true variable when running the pipeline, so you can track which folder the dll files are published to in the build solution step in the log.
About publishing artifact process:
Artifacts are the files that you want your build to produce. Publish artifact task is used to publish artifacts for the Azure Pipeline.
In the agent there are 3 folders: a, b and s. The variable $(Build.ArtifactStagingDirectory) point to folder a (artifacts). When you build the code all the code and the artifacts exist on folder s (sources), the best practice is to copy only the artifacts to folder a and then use the task "Publish build artifacts", in this task you take the artifacts from folder a and put them on Azure DevOps storage or in your file share.
If you save the artifacts in Azure DevOps you can access your artifacts from the build summary page or create a release pipeline. if you save them in a file share you can just access them there or in the release pipeline.
In addition, you can share your build definition and msbuild arguments for further investigation.

selection of task in release pipeline in azure devops

I have a build pipeline which I created and I have the artifacts in a drop folder.
Now I want to deploy these artifacts. The drop folder contains my data factory resources like pipelines, datasets.
I have 2 questions:
What task for the agent should I select in the release pipeline to deploy this folder?
How do I specify that in this environment it should go ? i.e. If I suppose have a QA environment, then how do I specify that thing?
I am actually confused over this selection of task for the agent.
What task for the agent should I select in the release pipeline to
deploy this folder?
It's based on where and how you want to deploy the artifacts.
If you just want to deploy them in a local machine where you can access, then you just need to add a Copy Files task to copy the artifacts to the target folder.
If you want to deploy to other remote sites or third party services, then you need to select other tasks based on your requirements, and some of them we need to create services connections to access them.
For example Deploy to Azure(e.g. Deploy a web app to Azure App Services)
How do I specify that in this environment it should go ? i.e. If I
suppose have a QA environment, then how do I specify that thing?
In release pipeline we can defined multiple environments/stages, in each environment we can add different tasks to do the actions based on our requirements. We need to add the artifacts sources to deploy them in the release pipeline. Please see Release pipelines for details. You can reference below links to do that:
Reference Exercise 2: Examine the CI/CD pipelines configured by
Azure DevOps Project
Azure DevOps - creating a release pipeline- Video Guide

TFS to Server IIS Deployment -Include empty folders in App Data

ON deploying from TFS 2015 to onpremise Server,it deletes empty folders in App Data Folder.I want to include the empty folders in AppData and set Read,write/full control permissions to that folder.I use WINRM IIS Web Deployment task.
This is how the feature has been designed. Take a look from our MSFT'S reply at this similar question: Publish Artifacts task does not copy up empty folders
I can confirm this is by design. I am assuming you are uploading
artifacts to Azure DevOps Service rather than to your own file share.
You should think of Azure DevOps Service's artifact storage more like
blob storage than a giant file share.
I see you say you need these empty directories at deployment time. Can
you create them as a step during the release rather than as a step
during the build? I would say that fits best with the build vs.
release abstraction.
Compressing all of your artifacts into a .zip before you copy them to
the artifact staging directory should also work. You will just have to
unzip them as part of the release.
As suggested, you can create the empty folders via a script to workaround the issue. It will also apply to the situation if you choose to publish to file share path. Besides, you could also zip the artifact and upload and unzip it during release.

Resources