Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yvaubourg
Resolver I
Resolver I

Create a IoTHub Connection Using MS Fabric API

Hi,

 

I'm trying to create an IoTHub connection using the MS Fabric API.

 

Based on the sample in the documentation, I create my json body: 

yvaubourg_0-1747407325664.png

 

I'm not able to fin the parameter name expected for an IoTHub connection.

 

When I create this type of connection in MS Fabric, I assume it's waiting only 1 parameter.

yvaubourg_1-1747407441439.png

 

I have tried multiple parameter name (iothub, azureiothub, name, ...) but I keep geting the same error:

Error response: {"requestId":"2b70a182-9448-439b-b732-f9338bb229a3","errorCode":"InvalidInput","moreDetails":[{"errorCode":"InvalidParameter","message":"Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path 'connection
Details.parameters[0]', line 18, position 79."}],"message":"The request has an invalid input"}

 

Here is my powershell object used to construct the body

yvaubourg_2-1747407943323.png

 

Can you help me find this parameter name please? 

 

Many thanks!

 

Regards,

Yohann 

1 ACCEPTED SOLUTION
yvaubourg
Resolver I
Resolver I

Hi,
I found an API endpoint in the documentaion to list the supported connection types.

And with the "try it" option, you can retreive the needed information:

yvaubourg_0-1747810680715.png

 

So the connections details for an IoTHub should have "IoTHub.Contents" as creation methods and "entutyPath" as parameter. Here is my body the is actually working. Which is akward because it's not matching exactly, I let you check the differences...

 

yvaubourg_1-1747810929814.png

 

View solution in original post

4 REPLIES 4
yvaubourg
Resolver I
Resolver I

Hi,
I found an API endpoint in the documentaion to list the supported connection types.

And with the "try it" option, you can retreive the needed information:

yvaubourg_0-1747810680715.png

 

So the connections details for an IoTHub should have "IoTHub.Contents" as creation methods and "entutyPath" as parameter. Here is my body the is actually working. Which is akward because it's not matching exactly, I let you check the differences...

 

yvaubourg_1-1747810929814.png

 

yvaubourg
Resolver I
Resolver I

Hi @burakkaragoz,

Can you provide a full JSON sample of your body?

It's seem that I don't use the correct "creationMethod" value.

Hi @yvaubourg ,

yeah, that part’s not super well documented tbh. there’s no single public list with all connection types + their expected parameter names (at least not yet).

what we do is:

  • go to Fabric UI → create the connection manually
  • open Dev Tools (F12) → Network tab
  • watch the request payload when you hit “Create”
  • you’ll see the exact structure + parameter names used by the UI

it’s a bit hacky but works every time.

also, some connection types are documented here (but not all):
https://learn.microsoft.com/en-us/fabric/data-factory/connector-overview

 

burakkaragoz
Community Champion
Community Champion

Hi @yvaubourg ,

 

ran into the same issue when trying to create an IoTHub connection via API. The key thing is: the parameters array needs to contain objects, not plain strings.

Here’s a working example of the structure we used:

"connectionDetails": {
  "parameters": [
    {
      "name": "connectionString",
      "value": "<your-iothub-connection-string>"
    }
  ]
}

Make sure:

  • parameters is an array of objects
  • Each object has a name and value
  • For IoTHub, the expected parameter name is usually "connectionString"

Also double-check the content type and headers in your request – sometimes the API is picky about that too.

Let me know if you want a full sample PowerShell or REST call.

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.