"az snapshot grant-access" fails with "Accessing disk or snapshot with a logical sector size of 4096 requires specifying the file format. Set the fileFormat property to VHDX." #28320
Labels
Auto-Assign
Auto assign by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Compute
az vm/vmss/image/disk/snapshot
Milestone
Describe the bug
CLI cmdlet "az snapshot grant-access", using APIs equal or later than 2023-01-02, fails with "Accessing disk or snapshot with a logical sector size of 4096 requires specifying the file format. Set the fileFormat property to VHDX".
(BadRequest) Accessing disk or snapshot with a logical sector size of 4096 requires specifying the file format. Set the fileFormat property to VHDX.
Code: BadRequest
Message: Accessing disk or snapshot with a logical sector size of 4096 requires specifying the file format. Set the fileFormat property to VHDX.
When trying to pass the "fileFormat" as parameter for CMDLets, an error is returned saying the 'fileFormat' isn't valid.
Tested with RESTAPI --> Snapshots - Grant Access - REST API (Azure Compute) | Microsoft Learn
The supported api-versions are '2016-04-30-preview, 2017-03-30, 2018-04-01, 2018-06-01, 2018-09-30, 2019-03-01, 2019-07-01, 2019-11-01, 2020-05-01, 2020-06-30, 2020-09-30, 2020-12-01, 2021-04-01, 2021-08-01, 2021-12-01, 2022-03-02, 2022-07-02, 2023-01-02, 2023-04-02, 2023-10-02'
"az snapshot grant-access", using APIs equal or later than 2023-01-02, do not offer any parameter to define the "fileFormat".
RestAPI Snapshots - Grant Access - REST API (Azure Compute) | Microsoft Learn accepts the "fileFormat" as parameter. CLI cmdlet should do the same.
Related command
az snapshot grant-access --duration-in-seconds 3600 --resource-group martinme_repro --name premV2Snap
Errors
[ ~ ]$ az snapshot grant-access --duration-in-seconds 3600 --resource-group martinme_repro --name premV2Snap --fileFormat VHDX
unrecognized arguments: --fileFormat VHDX
Issue script & Debug output
Expected behavior
"az snapshot grant-access", using APIs equal or later than 2023-01-02, do not offer any parameter to define the "fileFormat".
RestAPI Snapshots - Grant Access - REST API (Azure Compute) | Microsoft Learn accepts the "fileFormat" as parameter. CLI cmdlet should do the same.
Environment Summary
Azure Portal CloudShell
Additional context
No response
The text was updated successfully, but these errors were encountered: