Set-AzServiceBusGeoDRConfigurationFailOver error in Azure automation account

pancakes0111992 20 Reputation points
2023-09-20T01:16:29.63+00:00

I am trying to trigger failover between my service bus namespaces.

When I run the following command locally from my computer, it works fine. However, when I run it from a runbook in azure automation (PowerShell), it fails with the following error: A parameter cannot be found that matches parameter name 'NamespaceName', how is this possible?

Command:

Set-AzServiceBusGeoDRConfigurationFailOver -ResourceGroupName $resourceGroupName -NamespaceName $secondaryNameSpace -Name $serviceBusDRAlias
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,234 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,504 questions
{count} votes

Accepted answer
  1. tbgangav-MSFT 10,426 Reputation points
    2023-09-20T05:27:39.6033333+00:00

    Hi @pancakes0111992 ,

    Short answer:

    Make sure Az.ServiceBus module version in your Azure Automation account is updated to latest version or to same version that you have in your local machine.

    Long answer:

    Check what's the version of Set-AzServiceBusGeoDRConfigurationFailOver cmdlet related module Az.ServiceBus in both local machine and in Azure Automation account by running below commands.

    Get-Command Set-AzServiceBusGeoDRConfigurationFailOver
    Get-Module Az.ServiceBus
    (Get-Command Set-AzServiceBusGeoDRConfigurationFailOver).Parameters['NamespaceName']
    

    For illustration, check below screenshots.

    Local Machine:User's image

    Azure Automation account:

    User's image

    User's image

    As I could see that NamespaceName parameter doesn't exist for 1.9.0 version of Az.ServiceBus module in my Azure Automation account so I have validated the same in modules tile of my Azure Automation account and have updated them as shown below.

    Note that while adding the new version of Az.ServiceBus module if you get a warning to update dependent modules like Az.Accounts then please do it and then add the new version of Az.ServiceBus module. Also, note that the module runtime version should match with the runbook runtime version.

    User's image

    User's image

    User's image

    User's image

    Then, I have executed the runbook again to see if it gets the NamespaceName parameter after updating the Az.ServiceBus module as shown below.

    User's image

    User's image

    So, to resolve the issue, make sure Az.ServiceBus module version in your Azure Automation account is updated to latest version or to same version that you have in your local machine.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.