Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Awesome-Ideas configuration on arm templates #1008

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion templates/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,32 @@
"metadata": {
"description": "Enable LoRaWAN feature?"
}
},
"ideasEnabled": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "To enable Awesome-Ideas feature when set to true"
}
},
"ideasUrl": {
"type": "string",
"metadata": {
"description": "Url of Awesome-Ideas, to publish ideas submitted by users"
}
},
"ideasAuthenticationHeader": {
"type": "string",
"defaultValue": "Ocp-Apim-Subscription-Key",
"metadata": {
"description": "Authentication header to interact with Awesome-Ideas"
}
},
"ideasAuthenticationToken": {
"type": "string",
"metadata": {
"description": "Authentication token to interact with Awesome-Ideas"
}
}
},
"variables": {
Expand All @@ -100,7 +126,7 @@
"portalWithoutLoRaDeploymentName": "iothub-portal-without-lora"
},
"resources": [
{
{
"condition": "[parameters('isLoRaFeatureEnabled')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2021-04-01",
Expand Down Expand Up @@ -168,6 +194,18 @@
},
"clientId": {
"value": "[parameters('clientId')]"
},
"ideasEnabled": {
"value": "[parameters('ideasEnabled')]"
},
"ideasUrl": {
"value": "[parameters('ideasUrl')]"
},
"ideasAuthenticationHeader": {
"value": "[parameters('ideasAuthenticationHeader')]"
},
"ideasAuthenticationToken": {
"value": "[parameters('ideasAuthenticationToken')]"
}
}
}
Expand Down Expand Up @@ -201,6 +239,18 @@
},
"clientId": {
"value": "[parameters('clientId')]"
},
"ideasEnabled": {
"value": "[parameters('ideasEnabled')]"
},
"ideasUrl": {
"value": "[parameters('ideasUrl')]"
},
"ideasAuthenticationHeader": {
"value": "[parameters('ideasAuthenticationHeader')]"
},
"ideasAuthenticationToken": {
"value": "[parameters('ideasAuthenticationToken')]"
}
}
}
Expand Down
74 changes: 73 additions & 1 deletion templates/azuredeployUI.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,74 @@
]
}
]
},
{
"name": "awesomeIdeasStep",
"label": "Awesome-Ideas",
"elements": [
{
"name": "ideasInfo",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "Awesome-Ideas allows users to submit ideas using Iot Portal Hub. By this feature is disabled",
"uri": "https://github.com/CGI-FR/IoT-Hub-Portal/discussions/categories/ideas"
}
},
{
"name": "ideasEnabled",
"type": "Microsoft.Common.OptionsGroup",
"label": "Do you want to enable Awesome-Ideas feature?",
"defaultValue": "No",
"toolTip": "Enable Awesome-Ideas feature",
"constraints": {
"allowedValues": [
{
"label": "No",
"value": false
},
{
"label": "Yes",
"value": true
}
],
"required": true
},
"visible": true
},
{
"name": "ideasUrl",
"type": "Microsoft.Common.TextBox",
"label": "Awesome-Ideas url",
"toolTip": "Url of Awesome-Ideas, to publish ideas submitted by users",
"visible": "[equals(steps('awesomeIdeasStep').ideasEnabled,true)]",
"constraints": {
"required": true
}
},
{
"name": "ideasAuthenticationHeader",
"type": "Microsoft.Common.TextBox",
"label": "Awesome-Ideas authentication header",
"toolTip": "Authentication header to interact with Awesome-Ideas",
"visible": "[equals(steps('awesomeIdeasStep').ideasEnabled,true)]",
"defaultValue": "Ocp-Apim-Subscription-Key",
"constraints": {
"required": true
}
},
{
"name": "ideasAuthenticationToken",
"type": "Microsoft.Common.TextBox",
"label": "Awesome-Ideas authentication token",
"toolTip": "Authentication token to interact with Awesome-Ideas",
"visible": "[equals(steps('awesomeIdeasStep').ideasEnabled,true)]",
"constraints": {
"required": true
}
}
]
}
]
},
Expand All @@ -245,7 +313,11 @@
"resetPin": "[steps('lorawanStep').lorawanSection.resetPin]",
"region": "[steps('lorawanStep').lorawanSection.region]",
"spiSpeed": "[steps('lorawanStep').lorawanSection.spiSpeed]",
"spiDev": "[steps('lorawanStep').lorawanSection.spiDev]"
"spiDev": "[steps('lorawanStep').lorawanSection.spiDev]",
"ideasEnabled": "[steps('awesomeIdeasStep').ideasEnabled]",
"ideasUrl": "[steps('awesomeIdeasStep').ideasUrl]",
"ideasAuthenticationHeader": "[steps('awesomeIdeasStep').ideasAuthenticationHeader]",
"ideasAuthenticationToken": "[steps('awesomeIdeasStep').ideasAuthenticationToken]"
},
"kind": "ResourceGroup",
"location": "[steps('basics').resourceScope.location.name]",
Expand Down
42 changes: 42 additions & 0 deletions templates/portalDeployWithLoRa.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@
"metadata": {
"description": "The API client ID for the B2C tenant"
}
},
"ideasEnabled": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "To enable Awesome-Ideas feature when set to true"
}
},
"ideasUrl": {
"type": "string",
"metadata": {
"description": "Url of Awesome-Ideas, to publish ideas submitted by users"
}
},
"ideasAuthenticationHeader": {
"type": "string",
"defaultValue": "Ocp-Apim-Subscription-Key",
"metadata": {
"description": "Authentication header to interact with Awesome-Ideas"
}
},
"ideasAuthenticationToken": {
"type": "string",
"metadata": {
"description": "Authentication token to interact with Awesome-Ideas"
}
}
},
"variables": {
Expand Down Expand Up @@ -202,6 +228,22 @@
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsightName')), '2020-02-02', 'Full').properties.InstrumentationKey]"
},
{
"name": "Ideas__Enabled",
"value": "[parameters('ideasEnabled')]"
},
{
"name": "Ideas__Url",
"value": "[parameters('ideasUrl')]"
},
{
"name": "Ideas__Authentication__Header",
"value": "[parameters('ideasAuthenticationHeader')]"
},
{
"name": "Ideas__Authentication__Token",
"value": "[parameters('ideasAuthenticationToken')]"
}
]
},
Expand Down
42 changes: 42 additions & 0 deletions templates/portalDeployWithoutLoRa.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@
"metadata": {
"description": "The API client ID for the B2C tenant"
}
},
"ideasEnabled": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "To enable Awesome-Ideas feature when set to true"
}
},
"ideasUrl": {
"type": "string",
"metadata": {
"description": "Url of Awesome-Ideas, to publish ideas submitted by users"
}
},
"ideasAuthenticationHeader": {
"type": "string",
"defaultValue": "Ocp-Apim-Subscription-Key",
"metadata": {
"description": "Authentication header to interact with Awesome-Ideas"
}
},
"ideasAuthenticationToken": {
"type": "string",
"metadata": {
"description": "Authentication token to interact with Awesome-Ideas"
}
}
},
"variables": {
Expand Down Expand Up @@ -235,6 +261,22 @@
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsightName')), '2020-02-02', 'Full').properties.InstrumentationKey]"
},
{
"name": "Ideas__Enabled",
"value": "[parameters('ideasEnabled')]"
},
{
"name": "Ideas__Url",
"value": "[parameters('ideasUrl')]"
},
{
"name": "Ideas__Authentication__Header",
"value": "[parameters('ideasAuthenticationHeader')]"
},
{
"name": "Ideas__Authentication__Token",
"value": "[parameters('ideasAuthenticationToken')]"
}
]
},
Expand Down