Dela via


Azure IoT Models Repository client library for .NET - version 1.0.0-preview.6

This library provides functionality for interacting with the Azure IoT Models Repository. It also aims to provide a consistent experience working with digital twin model repositories following Azure IoT conventions.

Source code | Package (nuget)

Getting started

The complete Microsoft Azure SDK can be downloaded from the Microsoft Azure downloads page, and it ships with support for building deployment packages, integrating with tooling, rich command-line tooling, and more.

For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and bug fixes.

Install the package

Install the Azure IoT Models Repository client library for .NET with NuGet:

dotnet add package Azure.IoT.ModelsRepository --prerelease

View the package details at nuget.org.

Prerequisites

  • A models repository following Azure IoT conventions
    • The models repository can be located on the local filesystem or hosted on a webserver.
    • Azure IoT hosts the global Azure IoT Models Repository which the client will point to by default if no URI is provided.

Authenticate the client

Currently no authentication mechanisms are supported in the client. The global endpoint is not tied to an Azure subscription and does not support auth. All models published are meant for anonymous public consumption.

Key concepts

The Azure IoT Models Repository enables builders to manage and share digital twin models. The models are JSON-LD documents defined using the Digital Twins Definition Language (DTDL).

The repository defines a pattern to store DTDL interfaces in a directory structure based on the Digital Twin Model Identifier (DTMI). You can locate an interface in the repository by converting the DTMI to a relative path. For example, the DTMI "dtmi:com:example:Thermostat;1" translates to /dtmi/com/example/thermostat-1.json.

Thread safety

We guarantee that all client instance methods are thread-safe and independent of each other. See thread safety guideline. This ensures that the recommendation of reusing client instances is always safe, even across threads.

Additional concepts

Client options | Accessing the response | Long-running operations | Handling failures | Diagnostics | Mocking | Client lifetime

Examples

You can familiarize yourself with the client using samples for IoT Models Repository.

Troubleshooting

All service operations will throw RequestFailedException on failure, with helpful error codes and other information. The client also produces diagnostic events and logging which can be listened to with an EventListener.

Next steps

See implementation examples with our code samples.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.