Web App Diagnostic Logs: Web server logging as a slot setting - azure-web-app-service

Is it possible to configure the Web App's Diagnostic Logs "web server logging" storage account to be bound to a slot (i.e. as a slot setting), in order to prevent this during the swap:
The actual value for this is set as a WEBSITE_HTTPLOGGING_CONTAINER_URL app setting variable on the actual Web App, but it is invisible on the portal (meaning one cannot enable 'slot setting').
This is unlike the "application logging" storage account, which is made visible (meaning I can enable slot settings):
I would prefer not to have to do this via cmdlets.

According to your description, if you want to enable the "WEBSITE_HTTPLOGGING_RETENTION_DAYS" and "WEBSITE_HTTPLOGGING_CONTAINER_URL", I suggest you could try to use azure Resource explorer to change the slot settings.
More details, you could follow below ways.
1.Open the azure Resource explorer and locate your web app.
2.Open the web app's slotConfigNames tag.
3.Add the appsetting name in the properties.
Firstly click the edit and change the properties. At last click the put to save the changes.
You could find all the slot setting will not miss when using swap.

Related

How to share application settings between app services in Azure?

I have several App Services in Azure: development, test, and production. I would like to share some application settings between them like variable sets in Octopus.
Let's say I have a key A which should be same in all App Services. I would like to set its value in one place but seems that I have to configure it to each App Service. When A is changed, I have to change it to everywhere instead of having one common place to change it. Is there some way to do this?
No built-in way, app settings are part of the App Service resource.
You will need to put the settings in a common database or file.
Azure Key Vault can be used for sensitive settings and table storage/blob storage works well for other settings. Azure SQL is also an option.
Your app will then need to load these settings at startup.
This is also a documented cloud design pattern: https://learn.microsoft.com/en-us/azure/architecture/patterns/external-configuration-store

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.
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.
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.
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:
Create a Settings class that's a singleton and reads settings from a file.
Within the Settings class, set up a FileSystemWatcher on the file containing your settings.
On the FileSystemWatcher.OnChanged event, re-read your settings file.
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).
Connection strings

Azure Web Apps: Removing FTP access

I cannot find where on the portal I originally created this FTP access account. I wish to delete it. Where can this be done?
In "Application Settings" blade there's now an option to restrict to FTPS or fully disable.
Starting May 8th 2018, a new setting is available to enable or disable FTP/FTPS. You can read more about it at https://blogs.msdn.microsoft.com/appserviceteam/2018/05/08/web-apps-making-changes-to-ftp-deployments/
This is a known issue in Azure App Service. I believe that Azure team will add this feature in the future. You can check this link: https://feedback.azure.com/forums/169385-web-apps/suggestions/8211222-option-to-disable-ftp-and-force-ftps-in-azure-we for status.
In latest Azure these options are changed,
Now its App Service > Configuration(its part of Settings in left pane) > General Settings (Tab on the Top) > FTP State and than Save it

What causes azure websites to ignore settings from web.config?

My web.config contains multiple entries in "appSettings" (e.g.: twilio account key). One of these is for the asp.net chart control. It's the configuration part that states where the images the control generates are to be stored.
All of these settings work on my development machine. That is, i can connect to twilio and the chart control stores image in memory (as it should, according to the settings).
When i publish the site to my azure website (using vs), all of the settings work, apart from the chart control one. The chart control behaves as if the setting isn't even there. (it defaults to c:\TempImageFiles for storage).
I looked into the published version of the web.config and the setting is there. Only, it's beeing ignored.
My next attempt was to add that setting using the portal. (It's possible to add appSettings for a web app using the portal). I copied the exact same setting from web.config into the portal settings. This worked, so there is nothing wrong with what's in the settings.
So my question is: Why are some (at least this one) settings from web.config ignored when the app runs inside an azure web app?
You might have an app setting defined in the Web App's configuration with an identical name that overrides the web.config setting. This is typically done to have production settings stored in Azure instead of Web.config.
You can confirm if this is the case by opening your Web App's blade in the new portal, and checking the Application Settings tab there.
azure websites / azure web app service are typical web applications running on top of azure PaaS infrastructure. So whatever storage allocated to the service is accessible from the app. But it cannot be the typical C: or D: where in a regular server the app may have complete access. Mostly the C: space is allocated for IIS hosting. D:\local is something you can utilize as the app will have complete read and write access.
Please refer azure web app service sandbox details here.
If you are accessing the path via code try using Server.MapPath property to get access to the path. options like Path.GetTempPath() will not work.
One point to note is, any local storage in azure PaaS services is to be treated like a temporary storage. Whenever the site, service or role recycles the storage will be gone a fresh storage will be assigned.

How do you host multiple sites in the same Azure standard instance?

I am in the process of setting up a number of sites on our Azure subscription. I currently have one in standard and a few in shared. I would like to move the shared sites to the same standard package but there seems to be no way to do this.
When I navigate to the Scale tab of the web site configuration I see no option of adding other sites to the standard instance. All I see if
Web Hosting Plan Sites: [name of site]
With no option to add to it. Also, if I try to move a shared site to standard no drop down appears allowing me to select other sites to include.
Thanks
To add a website to the same hosting plan, click "NEW" in the command bar at the bottom of the azure management portal, choose to create a website and, in the "Web Hosting Plan" textbox, select your existing plan instead of creating a new one.
Once you do this, you can go in Scale tab and see your second website in the list.
To do the same thing in a Cloud Service instead of a website, see http://msdn.microsoft.com/en-us/library/gg433110.aspx

Resources