Skip to content
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 desktopvirtualization with error "Cannot deserialize datetime object., ValueError: Invalid datetime string" #21692

Closed
eliasarellano opened this issue Mar 18, 2022 · 5 comments
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Desktop Virtualization
Milestone

Comments

@eliasarellano
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

From yesterday March 17th along the day, I had an issue that I have never encountered before, even the script that executes this has not been modified since 8 months ago.

In the script I generate a token for the WVD (also called AWD today) hostpool in order to provide the token to the virtual machine that will handle RD WEB multisession service.

The script executes the 2 following commands:
`$expiration_token_date = (Get-Date).AddDays(20).ToString("yyyy-MM-dTHH:mm:ss.fffffffZ")

az desktopvirtualization hostpool update --registration-info expiration-time="$($expiration_token_date)" registration-token-operation="Update" --name "$($ExistingWVDHostPoolName)" --resource-group "$($ResourceGroupName)" --debug

`

In summary, in order to generate the WVD hostpool token, I need the expiration date. Unfortunately, now this execution says

msrest.exceptions.SerializationError: Unable to build a model: Cannot deserialize datetime object., ValueError: Invalid datetime string: 2022-04-7T11:48:30.0072006Z, DeserializationError: Cannot deserialize datetime object., ValueError: Invalid datetime string: 2022-04-7T11:48:30.0072006Z

It was working well before, now it is even blocking the deployment of the WVD in production automatically. Actually we use Azure pipelines, and obviously it has been tested in azure cloud shell too.

The data time and the command have been inspired from the example of that official documentation : https://docs.microsoft.com/fr-fr/cli/azure/desktopvirtualization/hostpool?view=azure-cli-latest

I'll put the logs here attached

Command Name
az desktopvirtualization hostpool update

Errors:

msrest.exceptions.SerializationError: Unable to build a model: Cannot deserialize datetime object., ValueError: Invalid datetime string: 2022-04-7T11:48:30.0072006Z, DeserializationError: Cannot deserialize datetime object., ValueError: Invalid datetime string: 2022-04-7T11:48:30.0072006Z

To Reproduce:

Create a WVD hostpool in the resource group, with the workspace and the WVD app, then execute the 2 commands lines that are provided to generate the token in the hostpool.

  • Put any pre-requisite steps here...
  • az desktopvirtualization hostpool update {} --name {} --resource-group {}

Expected Behavior

Gnerated token without issues, the token should be used to paste it in the WVD agent bootloader in the virtual machine automatically.

Environment Summary

Azure cloud shell , also in Agent self hosted.
Python 3.8.12
Installer: DEB

azure-cli 2.34.1

Extensions:
desktopvirtualization 0.1.0
azure-devops 0.22.0
account 0.2.1
ai-examples 0.2.5
ssh 1.0.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

az_desktopvirtualization_bug.txt

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot CXP Attention This issue is handled by CXP team. DevOps VM SSH SSH Pipelines Desktop Virtualization labels Mar 18, 2022
@ghost ghost assigned wangzelin007 Mar 18, 2022
@ghost ghost added this to the Backlog milestone Mar 18, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 18, 2022

desktopvirtualization

@eliasarellano
Copy link
Author

any tips for that ?

@wangzelin007
Copy link
Member

wangzelin007 commented Mar 23, 2022

@eliasarellano,

$expiration_token_date = (Get-Date).AddDays(10).ToString("yyyy-MM-dTHH:mm:ss.fffffffZ")
2022-04-2T17:07:47.6184009Z
$expiration_token_date = (Get-Date).AddDays(10).ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")
2022-04-02T17:07:55.8430639Z
I think you miss a d in your expiration_token_date, So the date formate is also miss a zero sometimes.

@wangzelin007 wangzelin007 added the needs-author-feedback More information is needed from author to address the issue. label Mar 23, 2022
@eliasarellano
Copy link
Author

eliasarellano commented Mar 24, 2022

@eliasarellano,

$expiration_token_date = (Get-Date).AddDays(10).ToString("yyyy-MM-dTHH:mm:ss.fffffffZ")
2022-04-2T17:07:47.6184009Z
$expiration_token_date = (Get-Date).AddDays(10).ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")
2022-04-02T17:07:55.8430639Z
I think you miss a d in your expiration_token_date, So the date formate is also miss a zero sometimes.

Hello everyone !

Interesting. that could even mean that everytime that I deployed a project it was always giving dates from 10 to 31, but never from 1 to 9, just lucky.

I will make some tests today and tomorrow , and I will add this 'd' character in the format, then I will let you know :) , thank you so much !

My last question, do you suggest to use all the AZ CLI commands in production? or in this case I should go back to Azure powershell, in fact everytime when I execute this I have the following message :

"WARNING: Command group 'desktopvirtualization hostpool' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus"

What could be your suggestion?

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Mar 24, 2022
@wangzelin007
Copy link
Member

Hi eliasarellano,

We are going to release a new version of desktopvirtualization at 2022/04/06.
It will use the latest stable version (2021-07-12) of desktopvirtualization sdk.
And actually Azure CLI and Azure powershell use the same sdk.
Experimental and preview means change in response to customer feedback.
GA is permanent.
I think you can use all the Azure CLI commands in production.
But if you want avoid most breaking change, you can choose to use all GA commands in Azure CLI.

@wangzelin007 wangzelin007 removed needs-team-attention This issue needs attention from Azure service team or SDK team CXP Attention This issue is handled by CXP team. labels Mar 25, 2022
@yonzhan yonzhan closed this as completed Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Desktop Virtualization
Projects
None yet
Development

No branches or pull requests

4 participants