Forum Discussion
Update to Microsoft Desktop Virtualization API v. 2023-09-05 by August 2, 2024 to avoid any impact
Logan_Silliman what API version should be used for the new listRegistrationTokens() function?
I tried 2023-09-05 which is shown in this code example but I get error 404 while retrieveRegistrationToken does work. The API documentation seems to only show 2022-02-10-preview but that doesn't work either.
HunterW620 in my testing, I found I had to set the scope on the existing host pool resource with the subscription ID and resource group name. With the proper scope, in my compiled JSON there was an extensionResourceId (like Logan's example above). If I assumed the scope and didn't include it, the compiled JSON used a resourceId instead and failed. Also, the example Logan provided doesn't output the token but an array of data with the token. Using the bicep code below will get the token:
param hostPoolName string
resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2023-09-05' existing = {
scope: resourceGroup(subscription().subscriptionId, resourceGroup().name)
name: hostPoolName
}
output registrationToken string = hostPool.listRegistrationTokens().value[0].token