OPCFoundation / UA-CloudLibrary

OPC UA Information Model database with a REST and GraphQL interface, as well as user management. The global instance of this (hosted by the OPC Foundation) can be found at https://uacloudlibrary.opcfoundation.org.
Other
39 stars 18 forks source link
cloud digitaltwin opcua

UA Cloud Library

The reference implementation of the UA Cloud Library. The UA Cloud Library enables the storage in and querying of OPC UA Information Models from anywhere in the world.

Features

Getting Started (Client Access)

If you want to access the globally hosted instance from the OPC Foundation at https://uacloudlibrary.opcfoundation.org from our software, you can integrate the source code from the SampleConsoleClient found in this repo. It exercises both the GraphQL and REST API, so you have the choice.

Development Setup

Start development in three simple steps:

  1. Checkout git clone https://github.com/OPCFoundation/UA-CloudLibrary.git
  2. Open with Visual Studio 2019+
  3. Select docker-compose as startup project and hit F5 or the "play button"

The OPC UA CloudLib Website should open in the browser.

If you want to access the admin to the develpoment database instance open http://localhost:8080/ in your browser

Cloud Hosting Setup

Environment variables that must be defined:

Environment variables that can optionally be defined:

Hosting on AWS requires the identity/role used to have policies allowing access to the S3 bucket and SSM Parameter Store.

Hosting on GCP requires an identity used to have policies allowing access to the GCS bucket. In case file based authentication is used, please set the envionment variable GOOGLE_APPLICATION_CREDENTIALS pointing to the SA-Key.

Microsoft Identity Platform Login (aka Azure AD, Microsoft Entra Id)

  1. Create an application registration for an ASP.Net web app using Microsoft identity, as per the documentation.

    Specifically:

  2. Add an Administrator App role:

    • Name and Description per your conventions
    • Value must be "Administrator"
  3. Assign administrator role to the desired users.

  4. Configure the server to use the application:

  "AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
    "ClientId": "<clientid>", //"[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]",
    "TenantId": "<tenantid>", //"[Enter 'common', or 'organizations' or the Tenant Id (Obtained from the Azure portal. Select 'Endpoints' from the 'App 
  }

You can use the corresponding environment variables (AzureAd__XYZ ) or Azure configuration names (AzureAd:XYZ).

Deployment

Docker containers are automatically built for the UA Cloud Library. The latest version is always available via:

docker pull ghcr.io/opcfoundation/ua-cloudlibrary:latest

Build Status

Docker Image CI

.NET