Reply to 1409494210718453760
Someone found the solution for me: https://docs.microsoft.com/en-us/answers/questions/454654/using-role-to-access-iot-hub-registry.html?childToView=456415#answer-456415
Remember to add permissions for the service principal explicitly to the IoT Hub.