This repository contains:
- A handcrafted C# API for OPC UA Registry as well as Device Twin and History Services.
- A sample command line interface (CLI) that allows you to exercise this API.
- A set of AutoREST generated libraries that enable access to the above services using a wider variety of languages.
Prebuilt and signed packages of the API assemblies can be installed from nuget.org. Use them to build your own applications against the corresponding services in our suite of Azure IoT Industrial components.
To build and run the sample command line interface for the services, clone the repository. Then...
- Install .NET Core 2.1+ if you want to build the services locally.
- Install Docker if you want to build and run the services using docker-compose.
- Install any recent edition of Visual Studio (Windows/MacOS) or Visual Studio Code (Windows/MacOS/Linux).
- If you already have Visual Studio installed, then ensure you have .NET Core Tools for Visual Studio 2017 installed (Windows only).
- If you already have VS Code installed, then ensure you have the C# for Visual Studio Code (powered by OmniSharp) extension installed.
The command line interface (CLI) and APIs depend on the OPC UA Services.
Follow the instructions here to deploy all required services for local development. Copy the resulting .env
file into this repository's root (or into the parent folder).
Unless you are running the above services on your local machine (localhost), the following environment variables can be added to your .env
file to configure the remote or cloud service endpoints:
PCS_TWIN_SERVICE_URL
= {http|https}://{hostname}:9041PCS_TWIN_REGISTRY_URL
= {http|https}://{hostname}:9042PCS_TWIN_HISTORY_URL
= {http|https}://{hostname}:9043
- Make sure the Prerequisites are set up.
- Change into the repo root and ensure the .env file exists there or in the parent folder.
- Open the
azure-iiot-services-api.sln
solution file in Visual Studio or VS Code - In the launchsettings.json add as command line argument
console
to start the CLI in console mode rather than in single command mode. (In Visual Studio this can also be accomplished in the Properties->Debug tab). - Run the
Microsoft.Azure.IIoT.OpcUa.Api.Cli
project (e.g. press F5). - Type
help
to see the available options.
- Make sure the Prerequisites are set up.
- Open a terminal window or command line window at the repo root.
- Ensure the .env file exists in the root or its parent folder.
- Run the following command:
cd src cd Microsoft.Azure.IIoT.OpcUa.Api cd cli dotnet run console
Refer to our contribution guidelines.
Please enter issues, bugs, or suggestions as GitHub Issues here.
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.