Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.61k stars 5.01k forks source link

[BUG] Microsoft.DesktopVirtualization/hostPools: Reordering of customRDPProperty field not saving #30283

Open adhodgson1 opened 3 weeks ago

adhodgson1 commented 3 weeks ago

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/desktopvirtualization.json

API Spec version

2024-04-03

Describe the bug

Reordering the customRDPProperty field after successfully creating a host pool doesn't take affect if the same properties are defined. I originally observed this behaviour when dealing with Terraform, this is opened in https://github.com/hashicorp/terraform-provider-azurerm/issues/27071

Expected behavior

Order of the items is changed

Actual behavior

Property is not updated

Reproduction Steps

Step1: Create a host pool with value of customRdpProperty starting with audiocapturemode:i:1;audiomode:i:0;. PUT /subscriptions/...resourceGroups/testRG/providers/Microsoft.DesktopVirtualization/hostPools/testpool?api-version=2022-02-10-preview HTTP/1.1 Request Body:

{
   "location":"eastus",
   "properties":{
      "customRdpProperty":"audiocapturemode:i:1;audiomode:i:0;camerastoredirect:s:*;redirectclipboard:i:1;redirectcomports:i:0;usbdevicestoredirect:s:;devicestoredirect:s:;drivestoredirect:s:*;redirectprinters:i:0;redirectsmartcards:i:0;encode redirected video capture:i:1;redirected video capture encoding quality:i:1;enablecredsspsupport:i:1;videoplaybackmode:i:1;redirectwebauthn:i:0;use multimon:i:1;",
      "description":"",
      "friendlyName":"test pool",
      "hostPoolType":"Personal",
      "loadBalancerType":"Persistent",
      "maxSessionLimit":999999,
      "personalDesktopAssignmentType":"Automatic",
      "preferredAppGroupType":"Desktop",
      "publicNetworkAccess":"Enabled",
      "startVMOnConnect":false,
      "vmTemplate":"",
      "validationEnvironment":false
   },
   "tags":{
   }
}

Step2: Reorder the value of customRdpProperty property, update the host pool with value of customRdpProperty starting with audiomode:i:0;audiocapturemode:i:1;. PATCH /subscriptions/.../resourceGroups/testRGproviders/Microsoft.DesktopVirtualization/hostPools/testpool?api-version=2022-02-10-preview HTTP/1.1 Request Body:

{
   "properties":{
      "customRdpProperty":"audiomode:i:0;audiocapturemode:i:1;camerastoredirect:s:*;redirectclipboard:i:1;redirectcomports:i:0;usbdevicestoredirect:s:;devicestoredirect:s:;drivestoredirect:s:*;redirectprinters:i:0;redirectsmartcards:i:0;encode redirected video capture:i:1;redirected video capture encoding quality:i:1;enablecredsspsupport:i:1;videoplaybackmode:i:1;redirectwebauthn:i:0;use multimon:i:1;"
   }
}

API response: { ... "properties":{ ... "customRdpProperty":"audiocapturemode:i:1;audiomode:i:0;camerastoredirect:s:;redirectclipboard:i:1;redirectcomports:i:0;usbdevicestoredirect:s:;devicestoredirect:s:;drivestoredirect:s:;redirectprinters:i:0;redirectsmartcards:i:0;encode redirected video capture:i:1;redirected video capture encoding quality:i:1;enablecredsspsupport:i:1;videoplaybackmode:i:1;redirectwebauthn:i:0;use multimon:i:1;", ... } }

Environment

No response

v-jiaodi commented 3 weeks ago

@ryanosh Please help take a look, thanks.

ryanosh commented 2 weeks ago

This behavior is by design based on how the RDP properties are stored. The order is determined by the order the property is inserted into the hostpool, not on the order of the input string. If you want to re-order the properties, you will have to remove them in one PATCH then re-add them in a separate PATCH in the desired order.