|
1 | | -# Project |
| 1 | +# DeviceScript Development Gateway |
2 | 2 |
|
3 | | -> This repo has been populated by an initial template to help get you started. Please |
4 | | -> make sure to update the content to build a great experience for community-building. |
| 3 | +This project contains a prototype development gateway implementation |
| 4 | +for the built-in DeviceScript cloud integration. |
5 | 5 |
|
6 | | -As the maintainer of this project, please make a few updates: |
| 6 | +| :exclamation: This implementation is for prototyping only and not meant for production. | |
| 7 | +| --------------------------------------------------------------------------------------- | |
7 | 8 |
|
8 | | -- Improving this README.MD file to provide a great experience |
9 | | -- Updating SUPPORT.MD with content about this project's support experience |
10 | | -- Understanding the security reporting process in SECURITY.MD |
11 | | -- Remove this section from the README |
| 9 | +## TODOs |
| 10 | + |
| 11 | +- [ ] program deployment |
| 12 | +- [ ] figure out why methods don't work |
| 13 | +- [ ] |
| 14 | + |
| 15 | +## Setup |
| 16 | + |
| 17 | +The ARM template creates a Web App (F1 by default), Server farm, Application Insights, a Key Vault and a Storage. |
| 18 | +Once the ARM template has run, your DeviceScript development gateway will be ready to use. |
| 19 | + |
| 20 | +- create a parameter file `azuredeploy.parameters.json` (it's .gitignored) |
| 21 | + |
| 22 | +```json |
| 23 | +{ |
| 24 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", |
| 25 | + "contentVersion": "1.0.0.0", |
| 26 | + "parameters": { |
| 27 | + "namePrefix": { |
| 28 | + "value": "" |
| 29 | + }, |
| 30 | + "adminUserId": { |
| 31 | + "value": "" |
| 32 | + }, |
| 33 | + "adminPassword": { |
| 34 | + "value": "" |
| 35 | + } |
| 36 | + } |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +- choose a name prefix and update it |
| 41 | +- find your user id and update `adminUserId` value |
| 42 | + |
| 43 | +```bash |
| 44 | +az ad signed-in-user show --output yaml |
| 45 | +``` |
| 46 | + |
| 47 | +- create a new password and udpate `adminPassword` |
| 48 | + |
| 49 | +```bash |
| 50 | +openssl rand -base64 32 |
| 51 | +``` |
| 52 | + |
| 53 | +- create new resource group and run template and enter user id, admin password |
| 54 | + |
| 55 | +```bash |
| 56 | +templateFile="azuredeploy.json" |
| 57 | +parametersFile="azuredeploy.parameters.json" |
| 58 | +az group create --name DeviceScriptCloud --location centralus --output yaml |
| 59 | +az deployment group create \ |
| 60 | + --name devicescript \ |
| 61 | + --resource-group DeviceScriptCloud \ |
| 62 | + --template-file $templateFile \ |
| 63 | + --parameters $parametersFile \ |
| 64 | + --output yaml |
| 65 | +``` |
| 66 | + |
| 67 | +- clean up resources |
| 68 | + |
| 69 | +```bash |
| 70 | +az group delete --name DeviceScriptCloud --output yaml |
| 71 | +``` |
| 72 | + |
| 73 | +Key vaults might have a soft-delete policy and you'll need to change the prefix or purge them. |
| 74 | + |
| 75 | +- create a new `.env` file (it is git ignored) and include the key vault name and the local url |
| 76 | + |
| 77 | +```txt |
| 78 | +KEY_VAULT_NAME="create key vault name" |
| 79 | +SELF_URL="http://0.0.0.0:7071" |
| 80 | +``` |
| 81 | + |
| 82 | +## Local development |
| 83 | + |
| 84 | +- start a local instance using |
| 85 | + |
| 86 | +``` |
| 87 | +yarn dev |
| 88 | +``` |
| 89 | + |
| 90 | +- after running head to http://127.0.0.1:7071/swagger/ or otherwise the live site |
| 91 | +- Click Authorize |
| 92 | +- Use user/password from the `passwords` secret in the key vault |
| 93 | + |
| 94 | +## Deployment |
12 | 95 |
|
13 | 96 | ## Contributing |
14 | 97 |
|
|
0 commit comments