Is it possible to have a link to raw content of file in Azure DevOps

0 votes
It's possible to generate a link to raw content of the file in GitHub, is it possible to do with VSTS/DevOps?
Mar 16, 2022 in DevOps & Agile by Edureka
• 13,690 points
3,467 views

1 answer to this question.

0 votes
https://dev.azure.com/{{organization}}/{{project}}/_apis/sourceProviders/{{providerName}}/filecontents
  ?repository={{repository}}
  &path={{path}}
  &commitOrBranch={{commitOrBranch}}
  &api-version=5.0-preview.1
But where do you look for these variables' values? Your current url should look like this if you go into Azure DevOps, choose Repos > Files from the left navigation, and select a specific file:

https://dev.azure.com/{{organization}}/{{project}}/_git/{{repository}}?path=%2Fpackage.json

For organisation, project, and repository, you should use those values. An HTTP encoded version of the unix file path appears in path. Because / is encoded as percent 2F in HTTP, the path is just /package.

You either know what you want for this value or you should use master, so commit or branch is very self-explanatory. Because the documentation presently leads to this version of the API, I've "hard-coded" it in the above URI.

You'll need providerName as the final variable. TfsGit is, in a nutshell, the best option. This value was obtained by searching the list of source providers for one that has a supportedCapabilities value of true. queryFileContents.

answered Mar 24, 2022 by gaurav
• 23,260 points

Related Questions In DevOps & Agile

+1 vote
2 answers

is it possible to assign a Feature/User Story/Task to a team [Group] in VSTS

In most cases, we would break Work ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
5,432 views
+13 votes
2 answers
0 votes
1 answer

Is it possible to preserve local ivy repository in Bluemix BUILD & DEPLOY?

You're right--the pipeline spins up a new ...READ MORE

answered Jul 19, 2018 in DevOps & Agile by Atul
• 10,240 points
555 views
0 votes
1 answer

Is it required for a QA tester to learn DevOps?

Yes, it can be very beneficial for ...READ MORE

answered Mar 23, 2023 in DevOps & Agile by Edureka
• 13,620 points
625 views
+1 vote
2 answers
0 votes
1 answer

Is it possible to to create IIS Site and application Pool using Web Deploy

You can try and use the ServerManager ...READ MORE

answered Apr 20, 2018 in DevOps & Agile by ajs3033
• 7,300 points
2,042 views
0 votes
4 answers

Is it possible to integrate sonarqube with LDAP

Add the following lines in your config ...READ MORE

answered Apr 29, 2019 in DevOps & Agile by Wazir
5,262 views
0 votes
1 answer

is it possible to use swagger with vs2017

Yes, you can use swagger in a ...READ MORE

answered Apr 29, 2018 in DevOps & Agile by DareDev
• 6,890 points
693 views
0 votes
1 answer

Azure DevOps Wiki: How can I link the subpages in the parent page?

Unfortunately, Azure Devops does not have the ...READ MORE

answered Mar 8, 2022 in DevOps & Agile by gaurav
• 23,260 points
674 views
0 votes
1 answer

Azure DevOps Wiki: How can I link the subpages in the parent page?

Unfortunately, Azure Devops does not have the ...READ MORE

answered Mar 8, 2022 in DevOps & Agile by gaurav
• 23,260 points
3,891 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP