A reference app for using the Azure Web App for Containers service.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Clone the repository
- Open a terminal in the local repo directory
- Follow CosmosDB instructions to set up KeyVault and CosmosDB
- Add the App Insights Instrumentation key to KeyVault. Call it
AppInsightsInstrumentationKey
. - Run
npm install
If you don't want to use KeyVault, set these environment variables:
export COSMOSDB_KEY="cosmosdb_key"
export APPINSIGHTS_INSTRUMENTATIONKEY="instrumentation_key"
npm run build
will transpile source files from thesrc/
directory into a destionation directory nameddist/
. Console output should appear as follows:
user@MININT-###### MINGW64 /c/users/<user>/repos/helium (<user>/<branch>)
$ npm run build
> [email protected] build C:\users\<user>\repos\helium
> gulp scripts
[11:28:19] Using gulpfile C:\users\<user>\repos\helium\gulpfile.js
[11:28:19] Starting 'scripts'...
[11:28:21] Finished 'scripts' after 1.97 s
- Create your unit test file adjacent to your source file in the
src/
directory. Name your test as*.test.ts
. - From the project root, run
npm test
in the terminal. - Output should show that your test ran.
npm start
will start the server locally. If no environment variable is provided, the application will run on the default port defined inserver.ts
.- Once running, the API can be accessed at each of [https://github.com/Microsoft/helium/tree/master/src/app/routes](these routes).
docker build --target=release -t helium:canary . #production
docker build --target=test -t helium:canary . #dev
docker run -it -p 3000:3000 \
-e CLIENT_ID='client_id' \
-e CLIENT_SECRET='client_secret' \
-e TENANT_ID='tenant_id' \
-e KEY_VAULT_URL='https://keyvaultname.vault.azure.net/' \
-e COSMOSDB_URL='https://cosmosname.documents.azure.com:443/' \
helium:canary
docker run -it -p 3000:3000 \
-e COSMOSDB_KEY="your_key" \
-e APPINSIGHTS_INSTRUMENTATIONKEY="your_key" \
-e COSMOSDB_URL='https://cosmosname.documents.azure.com:443/' \
helium:canary