locked
Manage Servicebus - Eventhub with Azure Automation RRS feed

  • Question

  • Hi Joe & Experts,

    I have a powershell script which run locally perfectly and would like to make it run on Azure Automation. It seems that the root cause is somewhere on the 'ServiceBus.dll'...

    What the script does is simply to get the ServiceBus namespace then get the EventHubs.

    #Loading Windows Azure ServiceBus Library for .NET.
    $ServiceBusDll = "C:\Modules\Global\Azure\Services\Microsoft.ServiceBus.dll"
    Add-Type -Path $ServiceBusDll
    
    
    # Select my azure subscription
    # ...
    
    # Get the servicebus namespace
    $CurrentNameSpace = Get-AzureSBNamespace -Name "mylovelynamepace"
    			
    $NamespaceManager = [Microsoft.ServiceBus.NamespaceManager]::CreateFromConnectionString($CurrentNamespace.ConnectionString);
    $EventHubs = $NamespaceManager.GetEventHubs()

    When i execute the upper script on Azure automation I get the following error:

    "

    Method invocation failed because [Microsoft.ServiceBus.NamespaceManager] does not contain a method named *GetEventHubs*.
    "


    I'm curious and look for the method inside $NamespaceManager. There are plenty but nothing with EventHub which explain the failed ;(

    Not sure why locally on my computer it works and I follow tutorial from this MSDN link1.

    Is it something related to the loaded .dll file ?

    Regards,

    Terry



    Wednesday, February 3, 2016 2:10 PM

Answers

All replies