We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to access information about an existing IoTHub.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.Iot.GetIotHub.InvokeAsync(new Azure.Iot.GetIotHubArgs
{
Name = "existing",
ResourceGroupName = "existing",
}));
this.Id = example.Apply(example => example.Id);
}
[Output("id")]
public Output<string> Id { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/iot"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := iot.GetIotHub(ctx, &iot.GetIotHubArgs{
Name: "existing",
ResourceGroupName: "existing",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.iot.getIotHub({
name: "existing",
resourceGroupName: "existing",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.iot.get_iot_hub(name="existing",
resource_group_name="existing")
pulumi.export("id", example.id)
Example coming soon!
Using getIotHub
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getIotHub(args: GetIotHubArgs, opts?: InvokeOptions): Promise<GetIotHubResult>
function getIotHubOutput(args: GetIotHubOutputArgs, opts?: InvokeOptions): Output<GetIotHubResult>def get_iot_hub(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetIotHubResult
def get_iot_hub_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetIotHubResult]func GetIotHub(ctx *Context, args *GetIotHubArgs, opts ...InvokeOption) (*GetIotHubResult, error)
func GetIotHubOutput(ctx *Context, args *GetIotHubOutputArgs, opts ...InvokeOption) GetIotHubResultOutput> Note: This function is named GetIotHub in the Go SDK.
public static class GetIotHub
{
public static Task<GetIotHubResult> InvokeAsync(GetIotHubArgs args, InvokeOptions? opts = null)
public static Output<GetIotHubResult> Invoke(GetIotHubInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetIotHubResult> getIotHub(GetIotHubArgs args, InvokeOptions options)
public static Output<GetIotHubResult> getIotHub(GetIotHubArgs args, InvokeOptions options)
fn::invoke:
function: azure:iot/getIotHub:getIotHub
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of this IoTHub.
- Resource
Group stringName - The name of the Resource Group where the IoTHub exists.
- Dictionary<string, string>
- A mapping of tags which should be assigned to the IoTHub.
- Name string
- The name of this IoTHub.
- Resource
Group stringName - The name of the Resource Group where the IoTHub exists.
- map[string]string
- A mapping of tags which should be assigned to the IoTHub.
- name String
- The name of this IoTHub.
- resource
Group StringName - The name of the Resource Group where the IoTHub exists.
- Map<String,String>
- A mapping of tags which should be assigned to the IoTHub.
- name string
- The name of this IoTHub.
- resource
Group stringName - The name of the Resource Group where the IoTHub exists.
- {[key: string]: string}
- A mapping of tags which should be assigned to the IoTHub.
- name str
- The name of this IoTHub.
- resource_
group_ strname - The name of the Resource Group where the IoTHub exists.
- Mapping[str, str]
- A mapping of tags which should be assigned to the IoTHub.
- name String
- The name of this IoTHub.
- resource
Group StringName - The name of the Resource Group where the IoTHub exists.
- Map<String>
- A mapping of tags which should be assigned to the IoTHub.
getIotHub Result
The following output properties are available:
- Hostname string
- The Hostname of the IoTHub.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - Dictionary<string, string>
- Hostname string
- The Hostname of the IoTHub.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - map[string]string
- hostname String
- The Hostname of the IoTHub.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - Map<String,String>
- hostname string
- The Hostname of the IoTHub.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- resource
Group stringName - {[key: string]: string}
- hostname str
- The Hostname of the IoTHub.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- resource_
group_ strname - Mapping[str, str]
- hostname String
- The Hostname of the IoTHub.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - Map<String>
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
