Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: share adu instance
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Apr 27, 2021
1 parent db21417 commit 25f3120
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
--template-file azuredeploy.json \
--parameters \
appName=${APP_NAME:-nrfassettracker} \
aduInstanceName=${ADU_INSTANCE_NAME:-nRFAssetTrackerADU} \
location=$LOCATION \
appRegistrationClientId=$APP_REG_CLIENT_ID \
b2cTenant=${B2C_TENANT} \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
--template-file azuredeploy.json \
--parameters \
appName=${APP_NAME:-nrfassettrackerci} \
aduInstanceName=${ADU_INSTANCE_NAME:-nRFAssetTrackerADU} \
location=${LOCATION} \
appRegistrationClientId=${APP_REG_CLIENT_ID} \
b2cTenant=${B2C_TENANT} \
Expand Down
3 changes: 3 additions & 0 deletions arm/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export const resourceGroupName = (): string =>

export const appName = (): string => process.env.APP_NAME ?? 'nrfassettracker'

export const aduInstanceName = (): string =>
process.env.ADU_INSTANCE_NAME ?? 'nRFAssetTrackerADU'

/**
* Returns the name of the Device Provisioning Service
*/
Expand Down
14 changes: 11 additions & 3 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
"description": "Specifies the IotHub SKU. At minimum S1 is needed for IoT Device Update."
}
},
"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"
},
"capacityUnits": {
"type": "int",
"minValue": 1,
Expand Down Expand Up @@ -184,7 +192,7 @@
"dependsOn": ["[concat(parameters('appName'), 'IotHub')]"]
},
{
"name": "[concat(parameters('appName'), 'ADU')]",
"name": "[parameters('aduInstanceName')]",
"type": "Microsoft.DeviceUpdate/accounts",
"apiVersion": "2020-03-01-preview",
"location": "[parameters('location')]",
Expand All @@ -193,7 +201,7 @@
"dependsOn": []
},
{
"name": "[concat(parameters('appName'), 'ADU/ADUInstance')]",
"name": "[concat(parameters('aduInstanceName'), '/', parameters('appName'))]",
"type": "Microsoft.DeviceUpdate/accounts/instances",
"apiVersion": "2020-03-01-preview",
"location": "[parameters('location')]",
Expand All @@ -209,7 +217,7 @@
"tags": {},
"dependsOn": [
"[concat(parameters('appName'), 'IotHub')]",
"[concat(parameters('appName'), 'ADU')]"
"[parameters('aduInstanceName')]"
]
},
{
Expand Down

0 comments on commit 25f3120

Please sign in to comment.