<p>Ideally, you would be injecting these via an <code>appsettings.json</code>, Key Vault reference or something and not manually setting these in the Configuration panel itself. In terms of archiving the actual values etc, this is probably most easily accomplished via the <a href="https://learn.microsoft.com/en-us/rest/api/appservice/web-apps" rel="nofollow noreferrer">App Service API</a>. There are several CRUD operations that can GET, UPDATE, etc configurations/application settings which should be able to allow you to accomplish what you have asked here.</p>

CC BY-SA 4.0
2022-10-12T19:49:17.820Z
Thanks for your answer. Should the `appsettings.json` be stored in the repo where the Python scripts are hosted?
Sheldon
CC BY-SA 4.0
2022-10-13T03:07:49.677Z
There seem to be a couple ways Fast API does this - [settings](https://fastapi.tiangolo.com/advanced/settings/)
jsprovoke
CC BY-SA 4.0
2022-10-11T03:10:32.280Z
2022-10-11T03:10:32.280Z
jsprovoke
<p>I successfully deployed a fastAPI onto Azure App Services.</p>
<p>However, the environmental variables that I specified into the <strong>Configurations</strong> &gt; <strong>App Settings</strong> pane got unexpectedly deleted, thus preventing my app from running correctly and I had to manually recreate the application settings from scratch.<a href="https://i.sstatic.net/Wpz1G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Wpz1G.png" alt="enter image description here" /></a></p>
<p>I could save these settings onto my local computer but I am wondering if there is a better way to archive these environment variables.</p>

<azure><environment-variables>
Is there a safe way to archive Azure App Services application settings?
Sheldon
# Is there a safe way to archive Azure App Services application settings?

(Asked by: username_0 on 2022-10-11)

I successfully deployed a fastAPI onto Azure App Services.

However, the environmental variables that I specified into the **Configurations** > **App Settings** pane got unexpectedly deleted, thus preventing my app from running correctly and I had to manually recreate the application settings from scratch.[![enter image description here](https://i.sstatic.net/Wpz1G.png)](https://i.sstatic.net/Wpz1G.png)

I could save these settings onto my local computer but I am wondering if there is a better way to archive these environment variables.

**Tags:** azure, environment-variables


---

## 1 answers

### Answer by username_1 on 2022-10-11. Score: 1

Ideally, you would be injecting these via an `appsettings.json`, Key Vault reference or something and not manually setting these in the Configuration panel itself. In terms of archiving the actual values etc, this is probably most easily accomplished via the [App Service API](https://learn.microsoft.com/en-us/rest/api/appservice/web-apps). There are several CRUD operations that can GET, UPDATE, etc configurations/application settings which should be able to allow you to accomplish what you have asked here.

> **Comments:**
> **username_0**: Thanks for your answer. Should the `appsettings.json` be stored in the repo where the Python scripts are hosted?  
> **username_1**: There seem to be a couple ways Fast API does this - [settings](https://fastapi.tiangolo.com/advanced/settings/)  

---

