Error in biceps deployment for IOTHub routing when creating endpoints to the same storage container

Alexander Broska | statworx 0 Reputation points
2023-06-01T12:39:45.3+00:00

I would like to route my device to cloud messages to different endpoints based on message type. The solution works fine, when created in the portal, but when automating the same using biceps an error message occurs:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"xxx","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/xxx","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"xxx","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/xxx/deployments/iotHubRoutingDeployment","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/xxx/deployments/iotHubRoutingDeployment","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","target":"/xxx/deployments/iotHubRoutingDeployment","message":"{\r\n "code": 400117,\r\n "httpStatusCode": "BadRequest",\r\n "message": "Storage endpoints 'enpoint1' and 'endpoint2' have the same container. If you contact a support representative please include this correlation identifier: 6c760c7d-ee87-4bf3-9bf8-b9c679f92852, timestamp: 2023-06-01 12:19:49Z, errorcode: IH400117."\r\n}"}]}]}]}]}]}}

The biceps module contains several routes and endpoints. When limiting to one endpoint it works fine, but as soon as I use two or more endpoints the above error occurs.

Any ideas how to solve the issue without doing a manual deployment in the portal?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,156 questions
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 13,956 Reputation points
    2023-06-01T22:41:45.28+00:00

    Hi @Alexander Broska | statworx Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here. Inspecting the error message you have posted, it looks like the deployment of Arm template is failing because of this error "message": "Storage endpoints 'enpoint1' and 'endpoint2' have the same container.

    I have tested the ARM template deployment by creating a Duplicate end point with the same Azure storage container and the deployment succeeded without any issues.

    Please refer the below image from my ARM template which shows the storageContainers section pointing to the same container. I have tried to add a new Custom End point TestDup3Container through the ARM template.

    User's image

    I have added the following in the routes section to create a route and link the TestDup3Container custom end point.

    User's image

    After I deployed the file using the command az deployment group create --name RajIoTHub-template --resource-group <ResourceGroupName> --template-file "file-path\template.json" I could see the new route getting created and receiving updates. Refer the below image

    enter image description here

    Please refer to the resource Add a new endpoint to your Resource Manager template that will help you guide through the steps needed to add a custom end point. Please also note that, if you already have created routes to IoT Hub portal, you can extract the ARM template by utilizing Automation section and Export template option on your IoT Hub. This will avoid any unexpected formatting issues within the template.

    If you still face the issue, I appreciate it if you can share the deployment template file for further investigation by redacting any sensitive information such as connection strings and subscription IDs.

    0 comments No comments