Skip to content

Commit fcc2766

Browse files
authored
Copy iothub connection string sample into smoke test arm template (Azure#17758)
1 parent a0cccce commit fcc2766

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

common/SmokeTests/SmokeTest/test-resources.json

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,6 @@
5454
"kafkaEnabled": false
5555
}
5656
},
57-
{
58-
"type": "Microsoft.Resources/deployments",
59-
"apiVersion": "2017-05-10",
60-
"name": "sample-IotHubConnectionString",
61-
"properties": {
62-
"mode": "Incremental",
63-
"templateLink": {
64-
"uri":"https://raw.githubusercontent.com/Azure/azure-sdk-for-net/master/samples/iothub-connect-to-eventhubs/sample-resources.json",
65-
"contentVersion":"1.0.0.0"
66-
},
67-
"parameters": {
68-
"hubname": {"value": "[variables('iotHubName')]" },
69-
"location": {"value": "[parameters('location')]" }
70-
}
71-
}
72-
},
7357
{
7458
"type": "Microsoft.KeyVault/vaults",
7559
"apiVersion": "2016-10-01",
@@ -251,6 +235,25 @@
251235
"properties": {
252236
"publicAccess": "None"
253237
}
238+
},
239+
{ /* TODO: Remove this once file URIs are supported. See https://github.com/Azure/azure-sdk-for-net/pull/17524#discussion_r543362690 */
240+
"apiVersion": "2019-11-04",
241+
"type": "Microsoft.Devices/IotHubs",
242+
"name": "[variables('iotHubName')]",
243+
"location": "[parameters('location')]",
244+
"properties": {
245+
"eventHubEndpoints": {
246+
"events": {
247+
"retentionTimeInDays": 1,
248+
"partitionCount": "4"
249+
}
250+
},
251+
"features": "None"
252+
},
253+
"sku": {
254+
"name": "B1",
255+
"capacity": "5"
256+
}
254257
}
255258
],
256259
"outputs": {
@@ -282,9 +285,13 @@
282285
"type": "string",
283286
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]"
284287
},
285-
"IOTHUB_CONNECTION_STRING": {
288+
"IOTHUB_CONNECTION_STRING": { /* TODO: Remove this once file URIs are supported. See https://github.com/Azure/azure-sdk-for-net/pull/17524#discussion_r543362690 */
289+
"type": "string",
290+
"value": "[concat('HostName=', reference(resourceId('Microsoft.Devices/IoTHubs', variables('iotHubName')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).hostName, ';SharedAccessKeyName=iothubowner;SharedAccessKey=', listKeys(resourceId('Microsoft.Devices/IotHubs', variables('iotHubName')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).value[0].primaryKey)]"
291+
},
292+
"IoTHubName": { /* TODO: Remove this once file URIs are supported. See https://github.com/Azure/azure-sdk-for-net/pull/17524#discussion_r543362690 */
286293
"type": "string",
287-
"value": "[reference('sample-IotHubConnectionString').outputs.IoTHubConnectionString.value]"
294+
"value": "[variables('iotHubName')]"
288295
}
289296
}
290-
}
297+
}

0 commit comments

Comments
 (0)