This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
azuredeploy.adu.json
64 lines (64 loc) · 3.33 KB
/
azuredeploy.adu.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "2.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"aduInstanceName": {
"type": "string",
"minLength": 3,
"metadata": {
"description": "Specifies the name of the ADU instance. There is a limit of 2 instances per subscription, so the ADU instance needs to be shared between multiple IoT hubs"
},
"defaultValue": "nRFAssetTrackerADU"
},
"nrfAssetTrackerResourceGroup": {
"type": "string",
"minLength": 3,
"metadata": {
"description": "Specifies the name of the resource group of nRF Asset Tracker instance"
},
"defaultValue": "nrfassettracker"
},
"nrfAssetTrackerAppName": {
"type": "string",
"minLength": 3,
"metadata": {
"description": "Specifies the name of the nRF Asset Tracker app."
},
"defaultValue": "nrfassettracker"
}
},
"resources": [
{
"name": "[parameters('aduInstanceName')]",
"type": "Microsoft.DeviceUpdate/accounts",
"apiVersion": "2020-03-01-preview",
"location": "[parameters('location')]",
"properties": {},
"tags": {},
"dependsOn": []
},
{
"name": "[concat(parameters('aduInstanceName'), '/', parameters('nrfAssetTrackerAppName'))]",
"type": "Microsoft.DeviceUpdate/accounts/instances",
"apiVersion": "2020-03-01-preview",
"location": "[parameters('location')]",
"properties": {
"iotHubs": [
{
"resourceId": "[resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/Iothubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub'))]",
"ioTHubConnectionString": "[concat('HostName=', reference(resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/IoTHubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).hostName, ';SharedAccessKeyName=iothubowner;SharedAccessKey=', listKeys(resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/IotHubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).value[0].primaryKey)]",
"eventHubConnectionString": "[concat('Endpoint=', reference(resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/IoTHubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).eventHubEndpoints.events.endpoint, ';SharedAccessKeyName=iothubowner;SharedAccessKey=', listKeys(resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/IotHubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).value[0].primaryKey, ';EntityPath=', reference(resourceId(parameters('nrfAssetTrackerResourceGroup'), 'Microsoft.Devices/IoTHubs', concat(parameters('nrfAssetTrackerAppName'), 'IotHub')), providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).eventHubEndpoints.events.path)]"
}
]
},
"dependsOn": ["[parameters('aduInstanceName')]"]
}
]
}