Azure / Azure/azure-cli

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

Open
#26,880 3 comments 0 reactions 0 assignees View on GitHub
act-platform-engineering-squad Auto-Assign bug customer-reported DevOps needs-team-attention Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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](https://learn.microsoft.com/en-us/cli/azure/devops/wiki/page?view=azure-cli-latest#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 --path '/FAQ' --org https://dev.azure.com/orgname --project projectname --include-content`
output:
```
{
"eTag": "\"f9c47abb37264c22e6ec2f5fec637d5b4fb9b669\"",
"page": {
"content": ,
"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 --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](https://github.com/Azure/azure-cli/assets/9106591/0849c9fb-5d1f-431b-8586-8cabdab5f567)

I am using latest az cli version i.e. v2.50.0
![image](https://github.com/Azure/azure-cli/assets/9106591/da7fde6e-81e1-4753-a186-45d0046108ff)

### Related command

getting eTag for a page:
`az devops wiki page show --wiki --path '/FAQ' --org https://dev.azure.com/orgname --project projectname --include-content`
output:
```
{
"eTag": "\"f9c47abb37264c22e6ec2f5fec637d5b4fb9b669\"",
"page": {
"content": ,
"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 --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 --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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.