Sometimes the life of a developer is a nightmare, hehe. Have done this several times, and all are working, but this week, on a new developer machine, while we were trying to deploy from Visual Studio 2019 a new Logic App Consumption, we got this strange and annoying error:
Get-AzResourceGroup : Method ‘get_SerializationSettings’ in type ‘Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient’ from assembly ‘Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ does not have an implementation.
Cause
Actually, this is not a Logic App issue but a Windows PowerShell 5.1 runtime issue. I was getting the exact same error if I opened a PowerShell command line window and tried to execute the Connect-AzAccount command.
The main root cause for this issue is that the Windows PowerShell 5.1 runtime preloads the PowerShellEditorServices module, which depends on Newtonsoft.Json 11.0. This issue is similar to one that caused a conflict with Az.Accounts, as you can see in this opened Azure PowerShell issue.
Unfortunately, this is a common issue that people complain about. However, I have many Logic App Consumption environments running with a higher version of Az.Accounts installed (see the solution) without any issues, so I really don’t know why this environment was different.
Solution
If you are facing this error, the best option is to downgrade the Az.Accounts module to version 2.12.1. To do that:
- Check what is the Az.Account module you have installed. Mine was 2.17.0.
Get-Module -ListAvailable Az.*
- Force installing the Az.Account module version 2.12.1 by running the following command:
Install-Module -Name Az.Accounts -RequiredVersion 2.12.1 -Force
- Uninstall the Az.Account higher version (in my case, 2.17.0) by running the following command
Uninstall-Module -Name Az.Accounts -RequiredVersion 2.17.0
After that, I tried, and I was able to successfully deploy my Logic Apps.
Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego!