Azure Devops Publish Artifact generates .cs,.bat etc (not deployable files) in Directory [duplicate] - azure-devops

I'm trying to build and publish certain folders of a project and deploy them to remote server using Azure DevOps. My Copy files task and Archive copies everything from TFS instead of the content I want to build and deploy.
The last two screenshots display the Build folder getting published and the last one is the folder which is supposed to be Published.

Related

VSTS Azure DevOps : Trying to Build and save only certain folders but everything from Project TFS Folder is getting built and deployed

I'm trying to build and publish certain folders of a project and deploy them to remote server using Azure DevOps. My Copy files task and Archive copies everything from TFS instead of the content I want to build and deploy.
The last two screenshots display the Build folder getting published and the last one is the folder which is supposed to be Published.

Azure release add artifact

Within Azure Devops I have a build pipeline which builds and publishes artifacts and a release pipeline which downloads those artifacts, defines some infrastructure configuration, and batch uploads the artifacts to a web container.
After the configuration definition I want to add a task to fetch the clientId of an AD registered app, dumps it into a json file and copies the file in the same folder as the build artifacts. The json has to be uploaded to the web container to provide runtime configuration for a spa app.
What I have tried:
generate a json in a release task and copy it into said folder
commit an empty json in the code, have it published as build artifact and update its content in a release task
use the file transform task which only seem to allow updating a key / value, not generating a new one
The contents of the folder which gets uploaded seem to be locked.
Is that correct ? What can I do to achieve my goal ?
Releases don't publish artifacts. Releases consume published artifacts. A release can be run multiple times for the same build. A release can have multiple environments. What you want to do would fall apart immediately in any of those scenarios.
What you should do is write a custom BASH or Powershell script (depending on your preferences and OS) that does exactly what you describe:
Generate an appropriate JSON file
Upload the JSON file to the "web container"
You haven't provided any details about what a "web container" is or what your deployment environment is (i.e. AWS, Azure, containers running in Kubernetes), so that's the most thorough answer that can be provided.

VSTS Build not including all dll's in artifact

I am trying to build a dot-net web application in Azure DevOps using the agents/tasks below
UseNuget, Nuget Restore, Visual Studio Build, Publish Build Artifact
The Artifacts generated contain the dll's within the bin folder and some aspx pages.
However it does not generate two folders inside the Bin folder named Release and Rosely which contain more dll's.
Can someone please suggest what i am doing wrong.

CI_VSTS publish different web Artifact for each project in single solution

I have a CI pipeline(VSTS) in which I am able to build whole solution which has two website projects in it in a single artifact. What I want to do it build whole solution and then create publish artifact for each project.
e.g.
One artifact for Project_website1
One artifact for Project_website2
thanks. I tried similar topic in StackOverflow but didnt work for me
You can use two publish artifacts tasks and may be copy files multiple tasks to achieve any number of artifact in VSTS build. For example, say you have your current artifacts for a single project, comprising of _PublishedWebsites\MVS5WebApp (XCopy deployable website) and _PublishedWebsites\MVS5WebApp_Package (web deploy package).
If you want to separate these two, into two artifacts, you can use two Publish Artifact tasks as shown below, each one specifying exact path to publish (this path does not support wildcards, you just have to specify the folder you need to publish).
Result would be two artifacts
You can get more idea from the post here.
Also this post might be useful for you to understand more possibilities.
To publish the two websites projects’ artifacts separately, you just need to use two VS build tasks and two Publish Build Artifacts tasks to build and publish the two websites separately.
Such as the first VS build task and Publish Build Artifacts task are for website1, and the second VS build task and Publish Build Artifacts task are for website2. The detail configurations for each task as below:
VS build task for website1 (store the package for website1 in $(build.artifactstagingdirectory)\web1):
Publish Build Artifacts for website1 (publish website1’s artifacts from $(build.artifactstagingdirectory)\web1 to artifact web1):
VS build for website2 (store the package for website2 in $(build.artifactstagingdirectory)\web2):
Publish Build Artifacts for website2 (publish website2’s artifacts from $(build.artifactstagingdirectory)\web2 to web2):
Then you can get build artifacts for the two projects separately:
This is what I have done
As I am using my own agent
So the web projects are published in agent’s each project published directory.
That is directory a.
Solution:
All i did was after builidng the whole solution once vsts put all website in publish directory a.
I wrote powershell script to get each file for project and put it under subdirectory in published folder a.
E.g
Publish folder a will look like this after building solution
Website1.......xml
Website1.......zip
.
.
.
Website2........xml
Website2........zip
.
.
.
Etc
When solution is build the files will be in above folder togeter.
In order to build artifact for each project i wrote powershell script to put each project file in sub directory
E.g
a\website1
Website1.......xml
Website1.......zip
a\website2
Website2.......xml
Website2.......zip
Etc and so on
After that select each publish artifact for each directory and you can have artifact for each project.
Thanks

VSTS performs web deploy successful, but website does not work

I am trying to get Visual Studio Team Services (VSTS) to perform a web deploy of my app. According to the VSTS UI the web deploy is successful, but when I browse the deployed web site it shows the default IIS screen ("Welcome - IIS").
This is my publish step in the build pipeline:
This is my release definition:
This is the resulting deploy folder:
Build.log (with replaced values) - https://drive.google.com/file/d/1y6q2Cjr1gxBVMcHeh6n_r7qu-JpJFSyC/view
Do I need to add an additional step to the release pipeline to get the .zip files extracted?
You do not need to add an additional step to extract your zip, but you need to tell the IIS Web App Deploy task to deploy your zip file and not a folder. You have specified a folder for the Package or Folder input, so the task is doing exactly as you told it to do, deploy the specified folder.
If you only have one zip file in your build artifacts, the default value for this field, $(System.DefaultWorkingDirectory)\**\*.zip, will pickup your zip file and correctly deploy it. If you have multiple zip files in your build artifacts, you will need to specify the full path to the zip file in order for it to deploy.