{"id":22859990,"url":"https://github.com/reelyactive/pareto-anywhere-azure","last_synced_at":"2025-04-30T17:47:07.204Z","repository":{"id":69136939,"uuid":"568997317","full_name":"reelyactive/pareto-anywhere-azure","owner":"reelyactive","description":"Pareto Anywhere open source IoT middleware as a serverless Azure Function.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2024-08-15T18:40:10.000Z","size":1794,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T18:34:25.716Z","etag":null,"topics":["azure","azure-function-app","dynamb","iot","middleware","node-js","open-source","pareto-anywhere"],"latest_commit_sha":null,"homepage":"https://reelyactive.github.io/diy/pareto-anywhere-azure/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reelyactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T21:28:53.000Z","updated_at":"2024-09-20T15:15:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"615a3aa6-7cf1-4d8d-a1b8-11b5289d9abb","html_url":"https://github.com/reelyactive/pareto-anywhere-azure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fpareto-anywhere-azure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fpareto-anywhere-azure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fpareto-anywhere-azure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fpareto-anywhere-azure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/pareto-anywhere-azure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251754422,"owners_count":21638506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-function-app","dynamb","iot","middleware","node-js","open-source","pareto-anywhere"],"created_at":"2024-12-13T09:08:37.435Z","updated_at":"2025-04-30T17:47:07.180Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pareto Anywhere for Azure\n=========================\n\n__Pareto Anywhere for Azure__ is the open source middleware that unlocks the value of the [ambient data](https://www.reelyactive.com/ambient-data/) arriving at your Azure IoT Hub.\n\n![Overview of Pareto Anywhere for Azure](https://reelyactive.github.io/pareto-anywhere-azure/images/overview.png)\n\n__Pareto Anywhere for Azure__ runs efficiently as a stateless [Azure Function](https://azure.microsoft.com/products/functions/), triggered by data forwarded from IoT infrastructure, such as [Aruba APs](https://www.reelyactive.com/pareto/anywhere/infrastructure/aruba/), to [Azure IoT Hub](https://azure.microsoft.com/products/iot-hub/).\n\n__Pareto Anywhere for Azure__ provides a single standard stream of real-time data, regardless of the underlying devices \u0026 technologies, which include Bluetooth Low Energy and EnOcean Alliance.  Dynamic ambient (__dynamb__) data is output as JSON to [Azure Event Hub](https://azure.microsoft.com/products/event-hubs) from which it is easily relayed to any store, stream processor and/or application.\n\nLearn more at: [www.reelyactive.com/pareto/anywhere/integrations/azure/](https://www.reelyactive.com/pareto/anywhere/integrations/azure/)\n\n\nGetting Started\n---------------\n\nFollow our step-by-step tutorials to deploy __Pareto Anywhere for Azure__:\n- [Run Pareto Anywhere for Azure](https://reelyactive.github.io/diy/pareto-anywhere-azure/)\n- [Run Pareto Anywhere for Azure with Aruba APs](https://reelyactive.github.io/diy/pareto-anywhere-azure-aruba/)\n\nLearn \"owl\" about the __dynamb__ JSON data output:\n- [Developer's Cheatsheet](https://reelyactive.github.io/diy/cheatsheet/)\n\n\nDeployment using ARM templates\n------------------------------\n\n__Pareto Anywhere for Azure__ can be deployed in minutes to an Azure Resource Group using the infrastructure-as-code Azure Resource Manager (ARM) templates found in the /deployments folder of this repository.  The only prerequisites are:\n- an Azure account\n- an Azure subscription\n- an Azure Resource Group\n\n### Step 1: Deploy an IoT Hub and Device Provisioning Service\n\nIf the Azure Resource Group already includes an IoT Hub, skip ahead to Step 2.  Otherwise, either manually create an IoT Hub or deploy one to a Resource Group via ARM template by clicking the Deploy link below:\n\n[![Deploy IoT Hub and DPS](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Freelyactive%2Fpareto-anywhere-azure%2Fmaster%2Fdeployments%2Fiot-hub-dps%2Fazuredeploy.json)\n\n### Step 2: Deploy Pareto Anywhere for Azure and supporting resources\n\nDeploy to a Resource Group via ARM template by clicking the Deploy link below:\n\n[![Deploy Pareto Anywhere for Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Freelyactive%2Fpareto-anywhere-azure%2Fmaster%2Fdeployments%2Fpareto-anywhere-azure%2Fazuredeploy.json)\n\nThe ARM template will deploy the __pareto-anywhere-azure__ Azure Function under the Windows Consumption plan which strikes a balance between installation ease \u0026 speed, and operational costs.  Consult the official [ARM template documentation](https://learn.microsoft.com/azure/azure-resource-manager/templates/) or contact your Microsoft rep to adapt these templates to your requirements.\n\n\nUpdate an existing deployment\n-----------------------------\n\nUpdate an existing deployment's function app to the latest version of __Pareto Anywhere for Azure__ via ARM template by clicking the Deploy link below:\n\n[![Redeploy Pareto Anywhere for Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Freelyactive%2Fpareto-anywhere-azure%2Fmaster%2Fdeployments%2Fupdate-pareto-anywhere%2Fazuredeploy.json)\n\n\nManual Installation\n-------------------\n\nClone this repository and, from the root of the __pareto-anywhere-azure__ folder, install the package dependencies with the following command:\n\n    npm install\n\nThen, in that same folder, create a file called local.settings.json, and paste in the following contents:\n\n    {\n      \"IsEncrypted\": false,\n      \"Values\": {\n        \"FUNCTIONS_WORKER_RUNTIME\": \"node\",\n        \"AzureWebJobsStorage\": \"...\",\n        \"EventHubConnectionString\": \"...\",\n        \"WebPubSubConnectionString\": \"...\",\n        \"iot_hub_name\": \"...\",\n        \"event_hub_name\": \"...\",\n        \"web_pub_sub_hub_name\": \"...\"\n      }\n    }\n\nReplace the ```\"...\"``` values with the appropriate strings from the Azure Portal, as explained in our [Run Pareto Anywhere for Azure](https://reelyactive.github.io/diy/pareto-anywhere-azure/) tutorial.\n\n\nRunning locally\n---------------\n\nWith the Azure CLI installed, run __pareto-anywhere-azure__ locally from its root folder with the following command:\n\n    func start\n\nThen browse to [localhost:7071/app/](http://localhost:7071/app/) to observe data in the web app served by the function, and to [localhost:7071/app/status/](http://localhost:7071/app/status/) to observe the individual detected devices and their respective JSON data.\n\n\nRunning on Azure\n----------------\n\nWith the Azure CLI installed, push __pareto-anywhere-azure__ to Azure with the following command:\n\n    func azure functionapp publish \u003cAPP_NAME\u003e\n\nInitially, and anytime there are changes to local.settings.json, append the flag ```--publish-local-settings -i``` to the above.\n\nBrowse to ```\u003cAPP_NAME\u003e.azurewebsites.net/app/``` to observe data in the web app served by the function, and to ```\u003cAPP_NAME\u003e.azurewebsites.net/app/status/``` to observe the individual detected devices and their respective JSON data.\n\n\nData Structure\n--------------\n\n__pareto-anywhere-azure__ outputs events to the Event Hub and to the Web PubSub (for consumption in the web app) using the following structure:\n\n    {\n      \"type\": \"dynamb\",\n      \"data\": { }\n    }\n\nThe type is always _dynamb_ (but _raddec_ and _spatem_ can be accommodated in future).  And the data is the _dynamb_ data structure itself: see the [reelyActive Developers Cheatsheet](https://reelyactive.github.io/diy/cheatsheet/) for details.\n\nAn example of an event from a temperature \u0026 humidity sensor would be as follows:\n\n    {\n      \"type\": \"dynamb\",\n      \"data\": {\n        \"deviceId\": \"ac233f000000\",\n        \"deviceIdType\": 2,\n        \"timestamp\": 1645568542222,\n        \"temperature\": 21.77734375,\n        \"relativeHumidity\": 64.90625\n      }\n    }\n\n\nWeb Apps\n--------\n\nThe web apps provide an intuitive visualisation of the real-time event stream:\n\n![Pareto Anywhere for Azure web app](https://reelyactive.github.io/pareto-anywhere-azure/images/web-app-screenshot.png)\n\nBrowse to the web apps at:\n- ```\u003cAPP_NAME\u003e.azurewebsites.net/app/```\n- ```\u003cAPP_NAME\u003e.azurewebsites.net/app/status/```\n\nBe sure to include the trailing slash (/) to ensure the web content is loaded correctly.\n\nThe web apps and all their dependencies are served by the Azure Function itself from the /serveWebApp folder and its subfolders.  Simply edit the index.html files and the dependencies as required, and the changes will appear as soon as the function restarts.\n\nSee the [reelyActive Web Style Guide](https://reelyactive.github.io/web-style-guide/) to facilitate customisation, and the [beaver.js](https://github.com/reelyactive/beaver/) and [cuttlefish.js](https://github.com/reelyactive/cuttlefish/) client-side modules which collect and render the real-time dynamic ambient data, respectively.\n\n\nGitHub Codespaces\n-----------------\n\n__pareto-anywhere-azure__ supports [GitHub Codespaces](https://github.com/features/codespaces/) for development/deployment within the browser rather than a local installation.  The project Codespace is configured to include:\n- Node.js\n- Azure CLI\n- Azure Functions Core Tools\n- Port forwarding on 7071\n\n\nGitHub Actions\n--------------\n\n__pareto-anywhere-azure__ supports [GitHub Actions](https://github.com/features/actions/) to automate the deployment of Azure resources.  This is currently under development, with experimental workflows available in the .github/workflows subfolder.\n\n\nProject History\n---------------\n\n__Pareto Anywhere for Azure__ evolved from [pareto-anywhere](https://github.com/reelyactive/pareto-anywhere/), retaining the stateless processing modules such as the [advlib](https://github.com/reelyactive/advlib) libraries, facilitating efficient operation as a stateless Azure Function.\n\n__pareto-anywhere-azure__ was initially prototyped as [aruba-iot-advlib-azure-function](https://github.com/reelyactive/aruba-iot-advlib-azure-function).\n\n\nContributing\n------------\n\nDiscover [how to contribute](CONTRIBUTING.md) to this open source project which upholds a standard [code of conduct](CODE_OF_CONDUCT.md).\n\n\nSecurity\n--------\n\nConsult our [security policy](SECURITY.md) for best practices using this open source software and to report vulnerabilities.\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2022-2024 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fpareto-anywhere-azure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fpareto-anywhere-azure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fpareto-anywhere-azure/lists"}