Event Hub Connection String Error using ARM template

Juliano Custódio 101 Reputation points MVP
2020-06-09T20:27:20.187+00:00

I am working with ARM template and I have one Event Hub and I need connect to many Logic Apps. For this i use the API Connection. (Example image below)
9711-estrutura.png

In the Api Connection (eventhubs) when I not set connection string in the ARM template. The API Connection status is "Error".

Then I set the Connection String from my Event Hub in API Connection, then the Api Connection status is "Connected". (Ok here, I thinked tha my problem was solved) But not... When a i run one Logic App i received one message that my Connection String is invalid.

I set the Connection String from my Event Hub in my ARM template of API Connection like the example below:
(The complete code is in: https://gist.github.com/juucustodio/4a17efea4f0c60c7e1cf64892dd1f54f ).
9721-connection-string-get.png

I checked that my connection string was ok. And yes, it is right. I also tried to use type how "String" and after how "Custom". Both not work.

The problem is: When I get the Connection String from Event Hub using the Azure Portal and in the Azure Portal I set the connection in my Api Connection, my Logic Apps work. But not work using ARM template.

I try get from portal and past my connection string directly in my ARM template (just to test). Like the image below.
9722-connection-string-direta.png

And again not work in ARM template, just that i past this Connection String using the portal. (equivalent to the example shown in the image below)
9731-edit-api.png

Has anyone experienced this type of problem?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,829 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
555 questions
0 comments No comments
{count} votes

Accepted answer
  1. Juliano Custódio 101 Reputation points MVP
    2020-06-11T19:08:36.42+00:00

    I found the solution to this problem.

    I change my ARM template.

    Before:

    "parameterValues": {    
        "connectionString": {
            "type": "string",
            "value": "[listKeys(resourceId(concat('Microsoft.EventHub/namespaces/',parameters('resourceType'),'/authorizationRules'),variables('namespaceName'),parameters('resourceName'),parameters('policy')),'2015-08-01').primaryConnectionString]"
       }
    

    }

    After:

    "parameterValues": {
        "connectionString": "[listKeys(resourceId(concat('Microsoft.EventHub/namespaces/',parameters('resourceType'),'/authorizationRules'),variables('namespaceName'),parameters('resourceName'),parameters('policy')),'2015-08-01').primaryConnectionString]"
     }
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful