Internal server Error Connection between Azure iot hub and Dps

Javier Familiar Gijón 20 Reputation points

I´m trying to connect an iot hub with a Device Provisioning Service with powershell, but I have a internal server error

I´m using this commands:


$resourceGroup = "RecursosPrueba"

$location = "West Europe"

New-AzResourceGroup -Name $resourceGroup -Location $location

$skuname = "S1"

$IotHubName = "IotHubCentroPrueba"

$iotHub = New-AzIotHub -ResourceGroupName $resourceGroup -Name $IotHubName -SkuName $skuname -Units 1 -Location $location

$ConnectionStringIotHub=Get-AzIotHubConnectionString -ResourceGroupName $resourceGroup -Name $IotHubName -KeyName iothubowner


$provisioningService = New-AzIoTDeviceProvisioningService -ResourceGroupName $resourceGroup -Name $DPSName -Location $location -Sku $skuname

Add-AzIoTDeviceProvisioningServiceLinkedHub -ResourceGroupName $resourceGroup -Name $DPSName -IotHubConnectionString $ConnectionStringIotHub -IotHubLocation $location

But It doesn´t connect

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,112 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,037 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,926 Reputation points

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query

    Please make sure that you have the correct onces since it looks like that it could be an issue with your Azure server or it could be an incorrect command.

    This article will help you to find the official documentation to set up an IoT Hub and Device provisioning service.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.