App reg secret and cert expiry script errors

Keagan Kennedy 5 Reputation points
2024-09-11T09:11:31.7433333+00:00

Hello, I am using the script from here: https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/scripts/powershell-export-apps-with-expiring-secrets
and it worked fine the past couple days but I just logged on today on my local machine and now I am getting an entry point not found error when running it and also on a runbook I am getting a

Connect-AzAccount : 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:3 char:1 + Connect-AzAccount -Identity + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-AzAccount], TypeLoadException + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

Absolutely nothing has changed about the code, I logged off when it was working and logged back in for it to not work

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,336 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,882 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Darshida Das 15 Reputation points
    2024-09-11T11:18:17.2733333+00:00

    This error typically occurs due to:

    1. Version Mismatch: The Azure PowerShell module or its dependencies might be outdated or incompatible with your current setup.

    Corrupted Installation: The Azure PowerShell module might be corrupted or incomplete.

    • Update Azure

    Uninstall-Module -Name Az -AllVersions -Force

    Install-Module -Name Az -AllowClobber -Scope CurrentUser



    • Remove Conflicting Modules:

    Get-Module -ListAvailable -Name Az* | Uninstall-Module -Force

    • Reinstall Azure PowerShell:

    Install-Module -Name Az -AllowClobber -Scope CurrentUser

    • Check Azure PowerShell Version:

    Get-Module -Name Az -ListAvailable

    • Use Azure CLI as an Alternative:

    az login


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.