Hello Nilesh Jha,
Greetings! Welcome to Microsoft Q&A Platform.
The error message you’re seeing typically indicates a conflict between the AzureRM and Az modules.
1.This kind of error arises when there is a confliction between AzureRM and Az modules. Make sure that you have uninstalled AzureRM modules and try connecting with Az account again.
Uninstall-AzureRm
Get-Module -Listavailable Az.*
Once it is done, update the Az modules or re-install the Az modules with the below command.
Install-Module -Name Az -Force -AllowClobber
2.We recommend you try using Az.Accounts version 2.12.2 and Vs code PowerShell extension versions. Lower the version to Az.Accounts 2.12.1 and re-run the script.
3.Check if there are any proxy settings that might be blocking the connection to Azure services. If yes, change the configuration settings and execute it. If still the issue persists, restart your visual studio code and try executing the command again.
refer similar SO thread - https://learn.microsoft.com/en-us/answers/questions/1299863/how-to-fix-method-get-serializationsettings-does-n
Hope this helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.