4

I have a Azure DevOps pipeline that automates user creation in salesforce. I am expecting the user details in an excel file, which is to be fed to the Azure DevOps pipeline as a pre-build parameter. However, I am not able to find a solution to it in Azure DevOps.

I had implemented this in Jenkins already using File parameter plugin in my previous projects. Does Azure DevOps has this capability?

3 Answers 3

1

After searching through various blogs and posts, I realized that there is no way to get this done directly in VSTS. However, I was able to get a work around for the same.

  1. I created a VSTS User story and uploaded my attachment there
  2. Using the Work Item ID, I used the work Item api to get the attachment ID.
  3. Using the attachment API I was able to write a python script to download this attachment as a part of a pre-step in the Pipeline. Then this was available to use through out my automation script.
Sign up to request clarification or add additional context in comments.

Comments

0

I don't think you can load a file before the build start and read the variables, but, you can add a task that read the variables from a file and put him in the beginning (the first step in your pipeline).

There are few extensions to read variable from a JSON file, for example: Json to Variable.

If you want to read from excel I think you should write a script that does it.

3 Comments

Thanks! I do have a script in place that converts excel to Json and then I use it for th further automation. However, these are self service CI/CD pipelines for non technical folks. My user will not know how to commit the excel into git or load it artifactory. Hence I wanted them to upload a file before the build like jenkins: (stackoverflow.com/questions/42224691/…)
@B.TAnand According to your scenario, if you want to upload a file before build, I am afraid that this is currently not possible in azure devops.You could add your request for this feature on our UserVoice site.
@B.T Anand If Shayki's answer is helpful to you, would you please mark it as the answer.Or if you have any concern, feel free to share it here.
0

Using local hosted agent, you can publish artifact from local share, then move to i.e. ms-hosted agent and use it normally.

 - task: DownloadFileshareArtifacts@1 inputs: filesharePath: '\\myhost\myshare\myfolder' artifactName: 'my-artifact' downloadPath: '$(System.ArtifactsDirectory)' parallelizationLimit: '8' 

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-fileshare-artifacts?view=azure-devops

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.