Skip to content

az devops wiki page update does not update wiki even after providing --version or -v flag #26880

Description

@sxddhxrthx

Describe the bug

I have been trying to use az devops wiki page update command to update wiki pages. I have been following the documentation from az-devops-wiki-page-update-examples.

Here is the commands that I have tried:

getting eTag for a page:
az devops wiki page show --wiki <wiki_page_name> --path '/FAQ' --org https://dev.azure.com/orgname --project projectname --include-content
output:

{
  "eTag": "\"f9c47abb37264c22e6ec2f5fec637d5b4fb9b669\"",
  "page": {
    "content": <content data here>,
    "gitItemPath": "/path/to/FAQ.md",
    "id": 1234,
    "isNonConformant": null,
    "isParentPage": true,
    "order": 2,
    "path": "/FAQ",
    "remoteUrl": "https://dev.azure.com/url/to/reach/faq/page?pagePath=%2FFAQ",
    "subPages": [],
    "url": "https://dev.azure.com/url/to/reach/faq/page/_apis/wiki/wikis/guid_here/pages/%2FFAQ"
  }
}

As per the documentation --version flag needs the eTag value. I used the eTag information display above to update the wiki page using command:
az devops wiki page update --path '/FAQ' --wiki <wiki_page_name> --content "hello world" --encoding utf-8 --version f9c47abb37264c22e6ec2f5fec637d5b4fb9b669 --org https://dev.azure.com/orgname --project projectname
But this commands return an error saying: "the following arguments are required: --version/-v"

Here is the screenshot of the same:
image

I am using latest az cli version i.e. v2.50.0
image

Related command

getting eTag for a page:
az devops wiki page show --wiki <wiki_page_name> --path '/FAQ' --org https://dev.azure.com/orgname --project projectname --include-content
output:

{
  "eTag": "\"f9c47abb37264c22e6ec2f5fec637d5b4fb9b669\"",
  "page": {
    "content": <content data here>,
    "gitItemPath": "/path/to/FAQ.md",
    "id": 1234,
    "isNonConformant": null,
    "isParentPage": true,
    "order": 2,
    "path": "/FAQ",
    "remoteUrl": "https://dev.azure.com/url/to/reach/faq/page?pagePath=%2FFAQ",
    "subPages": [],
    "url": "https://dev.azure.com/url/to/reach/faq/page/_apis/wiki/wikis/guid_here/pages/%2FFAQ"
  }
}

updating the wiki page:
az devops wiki page update --path '/FAQ' --wiki <wiki_page_name> --content "hello world" --encoding utf-8 --version f9c47abb37264c22e6ec2f5fec637d5b4fb9b669 --org https://dev.azure.com/orgname --project projectname

Errors

the following arguments are required: --version/-v

Examples from AI knowledge base:
az devops wiki page update --path 'my page' --wiki myprojectwiki --content "Hello World" --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b
Update content of page with path 'my page' in a wiki named 'myprojectwiki' with inline content

az devops wiki page update --path 'my page' --wiki myprojectwiki --file-path a.txt --encoding utf-8 --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b
Update content of page with path 'my page' in a wiki with content from a file

https://aka.ms/cli_ref
Read more about the command in reference docs

Issue script & Debug output

az devops wiki page update --path '/FAQ' --wiki <wiki_name> --content $content --encoding utf-8 --version f9c47abb37264c22e6ec2f5fec637d5b4fb9b669 --org https://dev.azure.com/organame --project projectname --debug

the following arguments are required: --version/-v

Examples from AI knowledge base:
az devops wiki page update --path 'my page' --wiki myprojectwiki --content "Hello World" --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b
Update content of page with path 'my page' in a wiki named 'myprojectwiki' with inline content

az devops wiki page update --path 'my page' --wiki myprojectwiki --file-path a.txt --encoding utf-8 --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b
Update content of page with path 'my page' in a wiki with content from a file

https://aka.ms/cli_ref
Read more about the command in reference docs

Expected behavior

Instead of displaying the error, it should have updated the wiki page with the content in the $content variable

Environment Summary

az --version

azure-cli                         2.50.0

core                              2.50.0
telemetry                          1.0.8

Extensions:
account                            0.2.5
azure-devops                      0.26.0

Dependencies:
msal                              1.22.0
azure-mgmt-resource             23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\sichowdhury\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botDevOpsService AttentionThis issue is responsible by Azure service team.act-platform-engineering-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionThis issue needs attention from Azure service team or SDK team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions