Microsoft.Azure.Devices 1.38.1 exposes an HTTP proxy through its service-side HttpTransportSettings. Supply it when creating RegistryManager:

var proxy = new System.Net.WebProxy("http://proxy.example:8080");
var settings = new Microsoft.Azure.Devices.HttpTransportSettings
{
    Proxy = proxy
};

var registry = Microsoft.Azure.Devices.RegistryManager
    .CreateFromConnectionString(iotHubConnectionString, settings);

Use this registry instance for the intended operations and retain it for the workload’s lifetime. Keep the actual IoT Hub connection string: the proxy address belongs in the transport settings. The HTTP proxy list provides candidates for a public HTTP route used by this RegistryManager.

If the proxy requires a login, set proxy.Credentials before constructing the client. The IoT Hub connection string authenticates the service request and does not supply that intermediary account.

This HttpTransportSettings belongs to the service package Microsoft.Azure.Devices. Device-client MQTT and AMQP connections use other settings, so a successful registry operation only establishes that the HTTP service route worked.

ХӀокхунах тера йаззамаш