How to fix: Method 'get_SerializationSettings' does not have an implementation

2023-06-06T15:58:54.2333333+00:00

I just wanted to automate this powershell script to activate Sftp for BlobStorage only for half an hour in the evening using the automation account:

$resourceGroupName = "xxxx"
$storageAccountName = "yyyyy"

Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -EnableSftp $true

It's quit simple and it's running fine in the cloud shell.

First i did import the two modules Az.Accounts (2.12.3) and Az.Storage (5.7.0) into the automation account.

RuntimeVersion is 5.1.

But now i get the following error:

Set-AzStorageAccount : 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. At line:4 char:1 + Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $sto ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Set-AzStorageAccount], TypeLoadException + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Azure.Commands.Management.Storage.SetAzureStorageAccountCommand

And for sure: I do not use AzureRM-Cmdlets.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,257 questions
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 18,771 Reputation points
    2023-06-07T05:31:33.99+00:00

    @Rainer Börgerding | puls Manufaktur Welcome to Microsoft Q & A Community Forum. We noticed there are some issues while upgrading to Az.Accounts version 2.12.2 or upgrading to a newer version with dependencies on Az.Accounts version 2.12.2, we recommend you use Az.Accounts version 2.12.1 or lower to avoid issues with Az modules that are dependent on Az.Accounts. For more information, see steps to import module with specific versions.

    5 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Pawankumar Dubey 55 Reputation points
    2024-01-04T07:20:16.4933333+00:00

    For me, using PowerShell ISE sorted it out.

    11 people found this answer helpful.

  2. Reinhard Schwarz 11 Reputation points
    2023-09-15T11:04:54.2833333+00:00

    I got the same exception when trying to fetch secrets from a key vault using Get-AzureKeyVaultSecret.
    As I didn't want to use a specific, older, version of Az.Accounts, I investigated further and found that especially the second command in below code block solved the issue for me:

    Remove-Module AzureRM.Profile -Force -ErrorAction SilentlyContinue  # AzureRM causes a conflict with Az modules
    Enable-AzureRmAlias -Scope CurrentUser -ErrorAction SilentlyContinue  # solves type implementation exception
    
    if (!(Get-Module -ListAvailable -Name Az.Accounts)) {
      Install-Module -Name Az.Accounts -Repository PSGallery -AllowClobber -Force -Scope CurrentUser  
    } 
    if (!(Get-Module -ListAvailable -Name Az.KeyVault)) {
      Install-Module -Name Az.KeyVault -Repository PSGallery -AllowClobber -Force -Scope CurrentUser 
    } 
    
    Import-Module Az.Accounts
    Import-Module Az.KeyVault
    
    1 person found this answer helpful.
    0 comments No comments

  3. Will252 0 Reputation points
    2023-06-07T12:36:05.92+00:00

    Does this also affect Windows Admin Center and the Extensions, we are trying to deploy AKS but get the same error

    An error occurred while applying Azure registration configurations(connect Azure account and set subscription, resource group and region) on the host. Error: 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=####' does not have an implementation.

    Is there a way to downgrade the extensions in WAC also?

    The version of Extension we have for AKS is 2.156.0


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.