1

I am creating some Azure CLI script to update an Azure DevOps project wiki, using the following command:

az devops wiki page update

However, the above command requires a --version (ETag) parameter which appears cannot be obtained via an Azure CLI command. It is however available through REST API Get request, as can be seen in the screenshot below from a Postman session.

enter image description here

Any idea how I can retrieve this ETag value from the REST API Get request and pass into my az devops wiki page update command in Azure CLI?

1
  • How about using curl? Commented Oct 6, 2021 at 12:36

1 Answer 1

1

Well, in the end, I managed to find a less complicated way and without the need to reference any REST API response header. These are the two lines of code I created which addressed the immediate issue:

$etagVar = (az devops wiki page show --org https://dev.azure.com/[MyOrg] --project [MyProjectName] --path '/MyWiki/HelloWorld' --wiki [MyWiki_wiki] --query eTag -o tsv)

az devops wiki page update --path 'MyWikiPath/HelloWorld' --wiki [MyWiki_wiki --content "Yessssss, it worked !!!" --version $etagVar

I now need to find a way to set this up in an Azure YAML Pipeline and unfortunately setting it up as a Bash Inline script has so far proved hugely unsuccessful. Still, I'm just pleased that this original issue is no longer a Blocker.

Any suggestions on how to recreate the above two Az Devops commands in a YAML pipeline would be greatly appreciated.

Sign up to request clarification or add additional context in comments.

1 Comment

Please check if this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.