Search code examples
pythonazure-eventhub

Event hub Regenerate keys missing parameter "parameters"


I'm using new version of azure-mgmt-eventhub v9.0.0 with python. In this version there is a new parameter "parameters". My working code to rotate keys it's failing with error: "missing parameter parameters".

Working code with version 4.0:

key = client.namespace.regenerate_keys(rg_name, namespace_name, some_authorization_rule_name, key_type: 'PrimaryKey') 

With new version 9.0.0 it should be :

key = client.namespace.regenerate_keys(rg_name, namespace_name, some_authorization_rule_name, parameters='PrimaryKey') 

this gives other error's like has no self token.

Can someone help with the correct use for version 9.0.0


Solution

  • Try this :

    params = {
        'keyType' : 'PrimaryKey'
    }
    
    client.namespaces.regenerate_keys(rg_name,namespace_name,some_authorization_rule_name,parameters=params)