I wrote a blog in the past about adding and updating device registration using the Azure SDK in C#.
Perhaps this helps you to automate the process.
It needs only the right access policy for the IoT Hub.
Be aware, this policy/connection string has te be kept secure, at least in production! I recommend to execute the code (and the key) within Azure (eg a webapp or an azure function) and not on your laptop. This way the actual secret can be stored in Azure Vault.