1

First of all I want to pose my question and elaborate further down this post:

Is it possible to use the an Azure IoT Edge Gateway for OPC UA servers without the Connected Factory solution accelerator and how is it done?

I know, this may sound strange but the Connected Factory solution doesn't fulfill my needs for the most aspects of my project, except for the ability to connect OPC UA servers.

Now to elaborate this further I need to outline my project. I have several OPC UA servers set up in my LAN and a Windows 10 machine running as Azure gateway. In Azure there are the ressources IoT-Hub and Time Series Insights activated. Additionally there is a WebApp which extracts data from TSI and visualizes them. Using OPC publisher on the gateway this works just fine. Both, OPC publisher and proxy are running natively on Windows and not in a docker container.

If I use the Connected Factory solution accelerator I can add and browse the publisher. However I can't connect to any other OPC UA server on the network, but this isn't the problem as I won't use Connected Factory after all. The real challenge here is how to connect to the OPC proxy without the Connected Factory solution accelerator.

The available tutorial uses the Connected Factory solution accelerator and has publisher as well as proxy running in a docker container. (https://learn.microsoft.com/de-de/azure/iot-accelerators/iot-accelerators-connected-factory-gateway-deployment and following)

And the OPC proxy github repository doesn't discuss this at all. (https://github.com/Azure/iot-edge-opc-proxy)

Even the issues on all relevant projects do not discuss this. (https://github.com/Azure/iotedge, https://github.com/Azure/iot-edge-opc-proxy)

I have absolutely no idea how to implement this functionality. The architecture overview of the solution accelerator (https://learn.microsoft.com/de-de/azure/iot-accelerators/iot-accelerators-connected-factory-sample-walkthrough) briefly mentions how this works in the solution accelerator but does not explain how to implement OPC Proxy and the OPC UA Stack in a custom WebApp.

I'm desperately in need of help and would appreciate it, if someone could give me a hint on how to solve this issue. I will gladly provide more information if needed. And surely I will post the solution if I get this to work.

Thanks in advance and have a nice day

Daniel

Daniel E.
  • 31
  • 2

2 Answers2

2

To answer your first question: Yes, you can absolutely use the OPC UA Publisher on Azure IoT Edge without using the Connected Factory solution!

See here how to configure the publisher: https://github.com/Azure/iot-edge-opc-publisher#using-it-as-a-module-in-azure-iot-edge

The module will send your data in OPC UA-JSON format to IoT Hub. From there you can do whatever you like with it. Display it in Azure Time Series Insights, run it through some stream processing (e.g. Azure Stream Analytics), process it with Azure Functions etc. pp.

silent
  • 14,494
  • 4
  • 46
  • 86
1

Check out the following lines in the OpcSessionHelper.cs, this pulls in the proxy transport into the OPC UA stack used in the WebApp:

#if !DIRECT_TCP_CONNECT
    // initialize our custom transport via the proxy
    Socket.Provider = new DefaultProvider(ConfigurationProvider.GetConfigurationSettingValue("IotHubOwnerConnectionString"));
    WcfChannelBase.g_CustomTransportChannel = new ProxyTransportChannelFactory();
#endif

After this the OPC API surface is using the proxy transport implemented in the nuget packages Microsoft.Azure.Devices.Proxy and Microsoft.Azure.Devices.Proxy.Opc.Ua

BrwoserController.cs is the main location where the OPC UA API is used in the WebApp.

You may also look at this which is going to replace the OPC Proxy functionality.