Azure Devops - Release pipeline. How do I share the fileshare to on prem VM - azure-devops

I'm just trying to get my fist Release pipeline underway.
Our current infastrucure setup is that we have a number of On Prem VM's which I have deployed the Azure Agents as per the deployment group setup.
The issue I have at the moment is that the deployment first tries to download the artifact from our build server using a file share.
However, currently the deployment machine cant see the file share. I gather I am supposed to be able to see the file share. I'm not entirely sure how to share this folder on the build machine?
Am I supposed to just create a share for everyone to see? Or is there a particluar user/role that I am having to share it for?

Our current infastrucure setup is that we have a number of On Prem VM's which I have deployed the Azure Agents as per the deployment group setup.
You need to check which user is used to run the tasks on the agent. You can add a powershell task with inline script: whoami.
You need to make sure the account have access to the file share.
In addition, when you publish artifact, you can select file share to store the artifact and then you can consume the artifact in the release pipeline. Please check the link for the details.
My "Download artifacts from file share" in release pipeline screenshot:

Related

how to deploy artifact of VM desktop?

I tried to copy task extension on azure pipeline: $vmFolder="c:/users/[username]/desktop and also tried
$vmFolder="c:/users/public/desktop but still my artefacts are deployed inside c:/azagent/work/ location. If anyone has an idea, please explain me the process step by step.
Could you provide a little more detail about what you're trying to achieve?
My feeling is that there may be a confussion about what is an Agent (C:\azagent\work is the work directory in a machine where you, very likely, have installed an Agent) and the Machine where you want to deploy your code to run.
Bests.
When you publish the build artifacts in Azure DevOps, for the location you could only choose "Server" or a UNC file share.
Artifact publish location argument:
Azure Pipelines/TFS (TFS 2018 RTM and older: Artifact type: Server)
is the best and simplest choice in most cases. This choice causes the
artifacts to be stored in Azure Pipelines or TFS. But if you're
using a private Windows agent, you've got the option to drop to a
UNC file share.
More details please refer our official doc -- Artifacts in Azure Pipelines
The remaining alternative is to add a download artifacts task in the end of pipeline to download your published artifacts to your Destination directory.

Deploy .NET Core Console App to Windows VM using Azure DevOps

We have a .NET Core Console App which we publish to an On Prem VM using publish feature in Visual Studio. Here is how we configure publishing to a file system.
Target location in the image is actually the folder structure of where we want our app to reside on the VM.
How can we configure the same in DevOps. I can't seem to find any good resource on this.
I have created a CI build pipeline.
You can follow below steps to deploy Console App to the On Prem VM.
1, Create a deployment agent on On-Prem VM. create a deployment group from azure devops portal. Follow the first part of this tutorial to create deployment group. Check the official document for more information about deployment group.
2, Create a release pipeline. See document here.
Setup the artifacts(you should have the publish build artifacts task in the CI build pipeline to publish the console app build artifacts to azure devops server.), and add stage for the release pipeline.
Add a deployment group job in the release stage.
see below screenshot to select the deployment group created in the first step, which contains the deployment agent on the ON-premise VM,
Add copy file task to copy the console app build artifacts to the folder on the ON-premise VM
Another workaround is to use self-hosted agent(steps are similar to above using deployment group). Check the detailed steps in this example.
Hope above helps!

Publishing artifacts to an external server

We are using azure devops pipeline to build our application including a Azure build agent. At the end of this process, I would like to publish the artifacts to an on-premise server shared directory (which will connect to company mandated deployment process (repliweb)).
Is that possible?
Looking at the documentation it looks like I can use publish artifact or copy file step (or maybe even ftp).
Our IT organization needs to know the IP/port so that the firewall rules can be authored.
Where can I get that information?
I suppose the other possibility would be have our server pull the artifact from Azure devops.
Publishing artifacts to an external server
For this issue, you can try to use FTP Upload task in the pipeline. Using this task in a build or release pipeline to upload files to a remote machine using the File Transfer Protocol (FTP), or securely with FTPS.
For details,please refer to this document.

deploy app to on-prem environments with azure dev ops

I'm building an Azure DevOps pipeline to deploy a custom-build powershell application to several on-prem environments that we support. I configured the required agent pools and installed them as a service on the on-prem environment.
Next, I have set up my pipeline in Azure DevOps, selecting a GitRepo:
Build (with the steps: Use Nuget, Nuget Restore, Build solution, Update version, Copy Files, and Publish build Artifact)
Release (with step: Publish Build Artifact)
Some things are unclear for me:
Do I need the Publish Build Artifacts twice? Can the Build pipeline
end with Copy Files step, and that the Release pipeline picks up this
artifact?
It is my understanding that the release publishes the app to the
on-prem environment (in my case). Where can I set a custom path (ie:
C:\deployed_apps) where the app needs to be deployed? When I tested
this pipeline, I got errors that the path I created using an variable
was not found.
What am I missing in my setup to get this pipeline working?
As #Shayki Abramczyk
pointed out this task is not for deployment, it just upload your Build Artifacts to azure devops server where your release pipeline can download directly.
In your case, if you want deploy your application to several on-prem environments, You need to create a deployment group first, A deployment group is a logical set of deployment target machines that have agents installed on each one. You application will be deployed to those machines in a deployment group in release pipeline. Check here for more details about deployment group.
After the deployment group is created, you can add a deployment group job by click the 3 dots, and then specify your deployment group as below pic shows, You can then simply add a copy file task or other deployment tasks to deploy your application to your on-prem machine.
In the release pipeline you shouldn't use the Publish Build Artifact. in the end of the build you put this step, what this step does? upload your artifacts to the Azure DevOps or to a file share. now in the release pipeline you choose the build artifact (in the left pane). the first thing that the agent does when the release pipeline started is to download the build artifacts to the agent. now you need to take them and deploy it to your environments. how? it depends which kind of application is (it can be just copy files, it can be deploy to IIS, etc.).
You can put the path in the variables tab and use this variable when you deploy the app (with copy files task, for example).

Should Azure DevOps agents clean up file share artifacts

Should Azure DevOps locally hosted agents be able to clean up file share artifacts?
We have builds that drop to an on-prem file share and these use the default retention policy set on Azure DevOps. Once the retention policy for the build has expired, the build will be clean up as expected but the build artifact will remain in the file share.
I thought this was expected behaviour but there is nothing in the docs that say this is expected behaviour and i have also seen some comments on the MS Developer Community that suggest that the file share artifacts should also be cleaned up.
Was just looking for anyone else's experiences with this