Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
82 stars 64 forks source link

[Technical Question] Create Azure IoT Hub with turned-on preview mode #685

Closed bastyuchenko closed 1 month ago

bastyuchenko commented 9 months ago

I need to create an Azure IoT Hub through my deployment pipeline with turned-on preview mode. In the pipeline, I use az iot hub create cli but I cannot find any option to create Azure IoT Hub in preview mode.

c-ryan-k commented 9 months ago

Hey @bastyuchenko - you are correct, there is not currently a parameter in iot hub create to specify features like Preview Mode on create.

I'll create a task on our end to discuss adding this as a CLI parameter on create.

However, you should still be able to use ARM template deployments to create preview hubs:

Here's an example JSON file, you can either create a barebones one like this below (just change your hub name, location, and SKU) or use the portal UI to export a template for automation:

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "apiVersion": "2023-06-30-preview",
            "type": "Microsoft.Devices/IotHubs",
            "name": "[your_hub_name]",
            "location": "centralus",
            "properties": {
                "features": "GWV2"
            },
            "sku": {
                "name": "S1",
                "capacity": 1
            }
        }
    ]
}
c-ryan-k commented 1 month ago

Closing due to inactivity, if the provided solution isn't a sufficient workaround please let me know and we can re-open.