We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.iot.getDpsSharedAccessPolicy
Explore with Pulumi AI
Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.iot.getDpsSharedAccessPolicy({
    name: "example",
    resourceGroupName: exampleAzurermResourceGroup.name,
    iothubDpsName: exampleAzurermIothubDps.name,
});
import pulumi
import pulumi_azure as azure
example = azure.iot.get_dps_shared_access_policy(name="example",
    resource_group_name=example_azurerm_resource_group["name"],
    iothub_dps_name=example_azurerm_iothub_dps["name"])
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iot.LookupDpsSharedAccessPolicy(ctx, &iot.LookupDpsSharedAccessPolicyArgs{
			Name:              "example",
			ResourceGroupName: exampleAzurermResourceGroup.Name,
			IothubDpsName:     exampleAzurermIothubDps.Name,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Iot.GetDpsSharedAccessPolicy.Invoke(new()
    {
        Name = "example",
        ResourceGroupName = exampleAzurermResourceGroup.Name,
        IothubDpsName = exampleAzurermIothubDps.Name,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.iot.IotFunctions;
import com.pulumi.azure.iot.inputs.GetDpsSharedAccessPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = IotFunctions.getDpsSharedAccessPolicy(GetDpsSharedAccessPolicyArgs.builder()
            .name("example")
            .resourceGroupName(exampleAzurermResourceGroup.name())
            .iothubDpsName(exampleAzurermIothubDps.name())
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: azure:iot:getDpsSharedAccessPolicy
      arguments:
        name: example
        resourceGroupName: ${exampleAzurermResourceGroup.name}
        iothubDpsName: ${exampleAzurermIothubDps.name}
Using getDpsSharedAccessPolicy
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 getDpsSharedAccessPolicy(args: GetDpsSharedAccessPolicyArgs, opts?: InvokeOptions): Promise<GetDpsSharedAccessPolicyResult>
function getDpsSharedAccessPolicyOutput(args: GetDpsSharedAccessPolicyOutputArgs, opts?: InvokeOptions): Output<GetDpsSharedAccessPolicyResult>def get_dps_shared_access_policy(iothub_dps_name: Optional[str] = None,
                                 name: Optional[str] = None,
                                 resource_group_name: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetDpsSharedAccessPolicyResult
def get_dps_shared_access_policy_output(iothub_dps_name: Optional[pulumi.Input[str]] = None,
                                 name: Optional[pulumi.Input[str]] = None,
                                 resource_group_name: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetDpsSharedAccessPolicyResult]func LookupDpsSharedAccessPolicy(ctx *Context, args *LookupDpsSharedAccessPolicyArgs, opts ...InvokeOption) (*LookupDpsSharedAccessPolicyResult, error)
func LookupDpsSharedAccessPolicyOutput(ctx *Context, args *LookupDpsSharedAccessPolicyOutputArgs, opts ...InvokeOption) LookupDpsSharedAccessPolicyResultOutput> Note: This function is named LookupDpsSharedAccessPolicy in the Go SDK.
public static class GetDpsSharedAccessPolicy 
{
    public static Task<GetDpsSharedAccessPolicyResult> InvokeAsync(GetDpsSharedAccessPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetDpsSharedAccessPolicyResult> Invoke(GetDpsSharedAccessPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDpsSharedAccessPolicyResult> getDpsSharedAccessPolicy(GetDpsSharedAccessPolicyArgs args, InvokeOptions options)
public static Output<GetDpsSharedAccessPolicyResult> getDpsSharedAccessPolicy(GetDpsSharedAccessPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: azure:iot/getDpsSharedAccessPolicy:getDpsSharedAccessPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- IothubDps stringName 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- Name string
- Specifies the name of the IotHub Shared Access Policy.
- ResourceGroup stringName 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
- IothubDps stringName 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- Name string
- Specifies the name of the IotHub Shared Access Policy.
- ResourceGroup stringName 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
- iothubDps StringName 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- name String
- Specifies the name of the IotHub Shared Access Policy.
- resourceGroup StringName 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
- iothubDps stringName 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- name string
- Specifies the name of the IotHub Shared Access Policy.
- resourceGroup stringName 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
- iothub_dps_ strname 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- name str
- Specifies the name of the IotHub Shared Access Policy.
- resource_group_ strname 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
- iothubDps StringName 
- Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs.
- name String
- Specifies the name of the IotHub Shared Access Policy.
- resourceGroup StringName 
- Specifies the name of the resource group under which the IotHub Shared Access Policy resource exists.
getDpsSharedAccessPolicy Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- IothubDps stringName 
- Name string
- PrimaryConnection stringString 
- The primary connection string of the Shared Access Policy.
- PrimaryKey string
- The primary key used to create the authentication token.
- ResourceGroup stringName 
- SecondaryConnection stringString 
- The secondary connection string of the Shared Access Policy.
- SecondaryKey string
- The secondary key used to create the authentication token.
- Id string
- The provider-assigned unique ID for this managed resource.
- IothubDps stringName 
- Name string
- PrimaryConnection stringString 
- The primary connection string of the Shared Access Policy.
- PrimaryKey string
- The primary key used to create the authentication token.
- ResourceGroup stringName 
- SecondaryConnection stringString 
- The secondary connection string of the Shared Access Policy.
- SecondaryKey string
- The secondary key used to create the authentication token.
- id String
- The provider-assigned unique ID for this managed resource.
- iothubDps StringName 
- name String
- primaryConnection StringString 
- The primary connection string of the Shared Access Policy.
- primaryKey String
- The primary key used to create the authentication token.
- resourceGroup StringName 
- secondaryConnection StringString 
- The secondary connection string of the Shared Access Policy.
- secondaryKey String
- The secondary key used to create the authentication token.
- id string
- The provider-assigned unique ID for this managed resource.
- iothubDps stringName 
- name string
- primaryConnection stringString 
- The primary connection string of the Shared Access Policy.
- primaryKey string
- The primary key used to create the authentication token.
- resourceGroup stringName 
- secondaryConnection stringString 
- The secondary connection string of the Shared Access Policy.
- secondaryKey string
- The secondary key used to create the authentication token.
- id str
- The provider-assigned unique ID for this managed resource.
- iothub_dps_ strname 
- name str
- primary_connection_ strstring 
- The primary connection string of the Shared Access Policy.
- primary_key str
- The primary key used to create the authentication token.
- resource_group_ strname 
- secondary_connection_ strstring 
- The secondary connection string of the Shared Access Policy.
- secondary_key str
- The secondary key used to create the authentication token.
- id String
- The provider-assigned unique ID for this managed resource.
- iothubDps StringName 
- name String
- primaryConnection StringString 
- The primary connection string of the Shared Access Policy.
- primaryKey String
- The primary key used to create the authentication token.
- resourceGroup StringName 
- secondaryConnection StringString 
- The secondary connection string of the Shared Access Policy.
- secondaryKey String
- The secondary key used to create the authentication token.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.