Azure Provisioning IotHub client library for .NET - version 1.0.0-beta.1

Azure.Provisioning.IotHub simplifies declarative resource provisioning for Azure IoT Hub in .NET.

Getting started

Install the package

Install the client library for .NET with NuGet:

dotnet add package Azure.Provisioning.IotHub --prerelease

Prerequisites

You must have an Azure subscription.

Authenticate the Client

Key concepts

This library allows you to specify your infrastructure in a declarative style using .NET. You can then use azd to deploy your infrastructure to Azure directly without needing to write or maintain Bicep or ARM templates.

Examples

Create an IoT hub

This example creates an IoT hub using the S1 tier.

Infrastructure infra = new();

IotHubDescription hub =
    new(nameof(hub), IotHubDescription.ResourceVersions.V2026_03_01_PREVIEW)
    {
        Tags = { ["environment"] = "test" },
        Sku = new IotHubSkuInfo
        {
            Name = IotHubSku.S1,
            Capacity = 1,
        },
    };
infra.Add(hub);

infra.Add(new ProvisioningOutput("iotHubName", typeof(string)) { Value = hub.Name });
infra.Add(new ProvisioningOutput("resourceId", typeof(string)) { Value = hub.Id });

Troubleshooting

Next steps

Contributing

For details on contributing to this repository, see the contributing guide.

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.

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 questions or comments.