Hello @SAWICKI Peter ,
Azure IoT supports a wide range of devices, like a Raspberry PI or VM running a general-purpose operating system like Linux and Windows, or constrained (embedded) devices like an ESP having an MCU.
Check out this list of SDKs available to start programming.
Regarding embedded devices, here is a list of SDKs each for its own middleware.
As an alternative, I can recommend checking out the Nanoframework which enables programming in C# for a various list of embedded devices.
Once you have your device connected to the Azure cloud, especially the IoT Hub, you have a secure channel to communicate two-way, both device-to-cloud and cloud-to-device.
Device messages can be routed to cloud logic (like an Azure Function) and a response can be sent back to the device using eg. a Direct method or a Device Twin desired property update.
Use this channel to connect to AAD/LDAP directly in a secure manner (access to the directory starts within the cloud, no keys or access is 'leaked' to the device).