Simulating an OPC UA Server with .NET Aspire and OPC PLC
Deploying an OPC UA server simulation is a common need during development and testing of industrial IoT applications. Recently, a customer asked how to set up such a simulation using .NET Aspire, in order to streamline development workflows and easily monitor system components, logs, metrics, and inter-service communication.
.NET Aspire provides an ideal environment for orchestrating microservices and dependencies, making it a great fit for hosting a simulated OPC UA server. For the server simulation, I use the free and open-source OPC PLC provided by Microsoft. While it’s possible to run the server from source, I prefer using the containerized version published on the Microsoft Container Registry (MCR), which integrates more easily into an Aspire-based solution.