-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az cli disk update PATCH command #30829
Comments
Thank you for opening this issue, we will look into it. |
@TDread Due to the fact that the PUT operation currently appears to support more properties than the PATCH operation, such as |
@TDread In addition, as this sprint is already fully scheduled, can we postpone it to the next sprint (the release date is 04-01)? |
If we cannot change the PUT to only provide the data points that are being asked for by the Similar to the REST API Patch I think would be the best approach but if that can be handled in existing GET+PUT process and only filter the {BODY} to use the data points that should be modified and not the full {BODY} of the JSON payload. Timeline isn't urgent at this point, but it would be nice to have sooner vs later. If the best approach is the new command vs potentially breaking the old. I would agree with that as well. |
I personally think that using Patch requests in a new CLI command may be a more general solution, otherwise filtering attributes can only solve special issue case by case |
If the best approach is the new command vs potentially breaking the old. I would agree with that as well. OK, thanks for your understanding! What do you think of the new command named |
I think for long term the |
Preconditions
Related command
az disk update --size
Resource Provider
Micxrosoft.Compute/Disks
Description of Feature or Work Requested
Currently if you use the
az disk update --size
against a disk that was created by azure backup. Then that operation will fail with a permissions issue if the user trying to use it does not have permission to the restore point referenced in the JSON of the disks's createdData. This is an issue with the PowerShell method of doing this as well, since they both use a PUT method and include the createdData with the PUT method.If you only have Virtual Machine Contributor role as your RBAC and you perform a disk size change from lets say 500GB to 512GB this will work regardless on how the disk was created because it is using a PATCH method.
But if you use Azure CLI or Azure PowerShell, they both use a PUT Method. With Azure PowerShell, there is a workaround
New-AzDiskUpdateConfig -DiskSizeGB 512 | Update-AzDisk -ResourceGroupName $rgName -DiskName $diskName
If you use the REST API to update the disk size then this will work, since that is only supplying the diskSizeGB parameter.
Minimum API Version Required
2023-04-02
Swagger PR link / SDK link
https://learn.microsoft.com/en-us/rest/api/compute/disks/update?view=rest-compute-2023-04-02&tabs=HTTP
Request Example
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2023-04-02
{
"properties": {
"diskSizeGB": 1024
}
}
Target Date
2025-03-16
PM Contact
zhoxing
Engineer Contact
thomasdread
Additional context
This originated from an issue reported that was then brought to our internal teams and I was asked to create this effort to best handle. I have the full 241 line --debug output of the azure CLI if that is needed as well.
The text was updated successfully, but these errors were encountered: