|
| 1 | +# Usage |
| 2 | + |
| 3 | +> This documenten is for users of the EasyConfig project and describe how you can use it in your Azure Web Apps. |
| 4 | +
|
| 5 | +## Requirements |
| 6 | + |
| 7 | +- Extensions can only be installed in Windows basesd App Services at the moment. |
| 8 | +- The extension is written in c# using dotnet core 3.1 as self-contained application, so there should be **no** dependency to installed frameworks |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +The Extension can be installed on the Azure Portal or with an ARM Template |
| 13 | + |
| 14 | +### Azure Portal |
| 15 | + |
| 16 | +In the Settings of the Azure Web App under the *Development Tools* section will be an *Extensions* button. On this page you can *Add* an new extension. |
| 17 | +In the *Choose extension* dialog have a look for **Easy Config** and select the extension. |
| 18 | +After that the *Accept legal terms* dialog has to be confirmed. |
| 19 | + |
| 20 | +The Insatllation will take some moments and when finished you see the extension in the table below the *Add* button. |
| 21 | + |
| 22 | +When an update to is available it will be shown in this table also. |
| 23 | + |
| 24 | +### ARM Template |
| 25 | + |
| 26 | +coming soon ™ |
| 27 | + |
| 28 | +## Configuration |
| 29 | + |
| 30 | +Which values will be included in the response JSON can be set up either using the *Application Settings*, an *Azure KeyVault* or both. |
| 31 | + |
| 32 | +### Application Settings |
| 33 | + |
| 34 | +In the Azure Portal in the Wep App under *Settings* > *Configuration* the *Application settings* can be edited. |
| 35 | + |
| 36 | +All EasyConfig settings must start with `EASYCONFIG__` followed by the name of the setting. For example: |
| 37 | + |
| 38 | +``` |
| 39 | +EASYCONFIG__setting1 |
| 40 | +``` |
| 41 | + |
| 42 | +> **Important**: the devider is 2 times `_` (**underscore**) |
| 43 | +
|
| 44 | +The *Value* field will be also the value of this setting. |
| 45 | + |
| 46 | +All other *Application settings* which does not start with `EASYCONFIG__` will be ignored by the extension. |
| 47 | + |
| 48 | +### Azure KeyVault |
| 49 | + |
| 50 | +An other way to store the Settings is using an Azure KeyVault. |
| 51 | + |
| 52 | +coming soon ™ |
| 53 | + |
| 54 | +### Using the endpoint |
| 55 | + |
| 56 | +The endpoint can be accessed by the following ways: |
| 57 | + |
| 58 | +``` |
| 59 | +...azurewebsites.net/.config/ |
| 60 | +...azurewebsites.net/.config/environment |
| 61 | +...azurewebsites.net/.config/environment.json |
| 62 | +``` |
| 63 | + |
| 64 | +> **Info**: When using the `.config/` endpoint the trailing `/` (**slash**) is nessesary and not optional. |
| 65 | +
|
| 66 | +All these endpoints will return a JSON similar to this one: |
| 67 | + |
| 68 | +```json |
| 69 | +{ |
| 70 | + "section": |
| 71 | + { |
| 72 | + "setting": "value" |
| 73 | + }, |
| 74 | + "setting1": "value 1" |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +This JSON can be used in the client app to initialize the app with all nessesary values. |
0 commit comments