Forum Discussion
Create a IoTHub Connection Using MS Fabric API
- 1 year ago
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:
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...
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.