Swap Slots on Windows Azure but don't copy AppSettings - azure

Hello,
I noticed that when i want to swap slots on Azure the whole configuration will also be copied. I have a lot of environment-specific settings that i wanted to have configured automatically on a swap. So for example, i want that the ENVIRONMENT_TYPE of the test slot stays on TEST and doesn't change to DEV. Like you can see in the Screenshot, these preview messages don't really make sense.
Can anybody help me changing this option? How do you handle this?
Thanks a lot, have a nice day!

In the Azure Preview Portal, you can mark individual AppSettings as "Slot Setting" which means that they won't get swapped. This is described at https://azure.microsoft.com/en-gb/documentation/articles/web-sites-staged-publishing/.
You can access the Preview Portal at https://ms.portal.azure.com/. Choose Browse everything and select your Web-App. On the blade for your web-app, there is a box called Deployment Slots. If you select this, it will list the available Deployment slots - choose the one that you wish to modify, and you can then mark the individual App Settings as "Slot Setting".

Related

Azure ARM Deployment slot - adding application settings

When I read the doc for both slot and site,
Website: https://learn.microsoft.com/en-us/azure/templates/microsoft.web/2018-02-01/sites
Deployment slot: https://learn.microsoft.com/en-us/azure/templates/microsoft.web/2018-11-01/sites/slots
I can see that I can apply application settings by adding to properties.siteconfig.appsettings to either the website or a slot. This I how I do it today for the website, but I am wondering if, even though the deployment slot has the same structure, if I can add settings to my slot by doing the same? I don't care about sticky settings. The reason why I am asking is that when I export from the portal I can't see how they do it and everywhere I look on the Internet people is using the Microsoft.Web/sites/config type or Microsoft.Web/sites/slots/config type. Can't i just use properties.siteconfig.appsettings as in the doc for the deploy slot, or am I missing something fundamental?
I am not in a position where I can go to a computer and test it, but my mind is going nuts to find out.
You could indeed configure the appsettings through the siteconfig tag. As for your puzzle, it's because you don't understand why there are two ways to set the appsettings.
Actually the siteconfig is used to Prevent copying settings from the Prod site, you could check the github pull.
Hope this could help you.

ARM Template redeploy is broken

This is actually about REDEPLOYing an ARM template with a new scale set but all other resources are the same as they were. This used to work and its now been broken by Microsoft Azure. Have redeployed a template many hundreds of times. This exact same template.
Go to the Resource Group you deployed with the ARM template.
Under 'Deploments' there will be a link to the template blade. Click
on it and then click on the template
At the top of the blade is a redeploy button. Click on it.
Select the current existing Resource Group. Enter all other
parameters the same as the original deployment.
Agree to the terms and conditions
Click purchase and there will be validation errors shown.
Click to see the error details. They are all about resources already existing. This used to not occur - sensibly and thus a template could be redeployed.
Here is a link to the template in question, but its not template specific. All templates now fail to re-deploy. http://docs.lansa.com/14/en/Lansa022/index.htm#lansa/vldtoolct_0330.htm#VLDToolCT_0330 The particular resource group that I used to repo this has already been deleted.
Its easy to repro.
ps I created a new VM in a Resource Group using the standard Azure Windows Server 2012 Datacenter image, and it too cannot be re-deployed due to the same errors.
You can work around this using Powershell or Azure Cli or any other template deployment technique (both modes work, complete and incremental), it appears it only affects the portal.
As of 18.02 everything seems to be back to normal.
This issue is now fixed in the portal. It was fixed on about 17th February.

Trouble with Slot Setting for Azure App Services

I need to understand Slot Application Settings better for Azure App Services. When they apply and how to use them correctly.
I have 2 App Services set up each running 2 slots as below.
Site 1 with slot - building-staging
Site 1 with slot - staging
Site 2 with slot - building-production
Site 2 with slot - production
So for each site, I'd like to be able to put an invalid connectionstring for the build slot in the Application Settings blade so that the site can't be accessed and will just give you basically an error page on the azuerwebsites.net url for that slot.
In my production slot of each I then want to put the correct connectionstring so that once swapped they will work.
I can not get this to work reliably, the settings don't apply when I swap. Should I be marking the connection strings on the production slot as slot settings? Should the original one on the build slot be a slot settings? Do I need some kind of nuget package installed I'm not aware of.
Please help
If I understood your question correctly, you need to mark them all as slot settings.
App settings and connection strings marked as slot settings will stay on the slot when a swap is done. Any settings/connection strings not marked as slot settings will be swapped with the app.
The answer to my question was found in this document. (Which if anybody from the Azure team comes accross, should really be linked to from the Configuration for deployment slots section here )
Windows Azure Web Sites: How Application Strings and Connection Strings Work
In a nutshell, you shouldn't use ConfigurationManager to get settings from the Application Settings blade UNLESS you are using .NET 4.5 framework.
If you don't use .NET 4.5 framework you should be using Environment.GetEnvironmentVariable instead.
This tripped me up as I was converting an existing environment of mine over to App Services. I would have loved a big warning somewhere to tell me to make sure of this.
EDIT: So this was not the whole story;
The other part is what is meant by "sticky" and "not sticky" settings in the documentation. I kept finding references to the fact that the settings aren't actually put into your web.config file but rather lives in an in memory property bag accessible to your app. I couldn't find any reference of how I could see what was in this mysterious bag, but the answer it obvious once you know it.
During a swap, any settings on your staging slot is actually copied over to the settings of your production slot, i.e. it actually changes it in the production slots "Application Settings" blade. And whatever is in your slot's Application Settings blade is what is in the in memory property bag.

Azure website disable FREB in deployment slots

I'm trying to clean up my Event logs which show lots of identical errors
Event ID 2284 seems to be related to FREB, so when Anil (see link) says
" if you have multiple apps running under multiple app-pools, they
will each try to use the next filename in sequence and hence fail "
it made me wonder if the different staging slots were causing a conflict - which led me to want to try and turn off FREB for non-Production slots (with a sticky app setting slot maybe) to see if that stops all these log entries.
Is there a way to disable FREB on a per-slot basis?
edit: I can see there is a CLI command (-F) but I'm not sure how to bind this to the staging slot, permanently.
Yes you can do this, select the targeted deployment slot in azure portal. a setting blade opens, look for diagnostics logs and then you should be able to enable/disable required logging settings.
Hope this helps.

portal.azure.com WebApp Panel without info/tabs

I have 4 different azure accounts, each on with its own subscription and 5 WebApps on each subscription.
On my last created account+subscription+WebApps something really strange is happening in the "WebApp Panel" of the portal.azure.com: when I select any of my webapps the panel does not have the usual information.
It is best explained with pictures:
A normal WebApp Panel:
A fail WebApp Panel
As you can see it doesn't contain the usual information.
For more info, I don't know if it has any sense, autoswap is not working for these WebApps :S
I've created an empty website following these steps: http://emptywebsite-for-stackoverflow.azurewebsites.net
We have removed parts that users were not using often from the default web app blade, you can add any of the parts you like by click on the "Add Tile" Button and You can add a group via the "Add Group" button on the bottom and add your tiles there as well.
You should see a pane of tile that you can drag tiles from and drop on your blade. Let us know if this helps, and if you like to see any other part more often on the website blade after creating the blade. After you have customized the blade it will not change again.
The Part Gallery will look like this,
Hope this helps !

Resources