Deepak Sharma
Deepak Sharma

Reputation: 1901

Azure website: How to manually import application settings from a file

Is it possible to import azure web sites application setting from a file.I could not find a direct link from the azure portal.

Update

I want to copy some application settings from one azure web site to another azure web site in our test environment. I don't want to automate this, as we have our deployment infrastructure in place. I just want some simple solution where I can export the application settings from one web-site and import to another for testing.

Upvotes: 3

Views: 1476

Answers (3)

Bronek
Bronek

Reputation: 11235

As to Azure Portal you can go to Configuration/Application settings and open Advanced edit where you can paste JSON version of the settings. You need to do it separately for Connection strings. (If you already have settings in Azure then you can copy them from there - what would be an export in that case).

enter image description here

Connection strings

enter image description here

Upvotes: 0

Fei Han
Fei Han

Reputation: 27793

want to copy some application settings from one azure web site to another azure web site in our test environment

If you check the Azure web app in Azure Resource Explorer, you can find Application settings info is under config/web section, and it provides an API to update the configuration of an app.

enter image description here

You can try to get Application settings of one website via Azure Resource Explorer, and then you can call Rest API to update another website Application settings. If you save Application settings of one Azure website in a file, you can read file content and construct request based on it and send request to update another website.

Upvotes: 3

Rob Reagan
Rob Reagan

Reputation: 7686

You could upload a fresh copy of your web.config, but that'll recycle your app when you do so. That's about the only support out-of-the-box for manually changing settings via a file.

You could also do the following:

  1. Create a Settings class that's a singleton and reads settings from a file.
  2. Within the Settings class, set up a FileSystemWatcher on the file containing your settings.
  3. On the FileSystemWatcher.OnChanged event, re-read your settings file.

Upvotes: 0

Related Questions