Internal server Error Connection between Azure iot hub and Dps

Javier Familiar Gijón 20 Reputation points
2023-02-27T10:27:34.4266667+00:00

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:

Connect-AzAccount

$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

$DPSName="DpsNombre"

$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
PowerShell
PowerShell
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
    2023-02-28T14:30:58.7866667+00:00

    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 https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision 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.