Search code examples
azureweb-configazure-web-app-serviceglobalization

Azure web app globalization


I develop a web app locallly using US globalization. So the web.config looks like:

<system.web>
    ...
    <globalization culture="en-US" uiCulture="en-US" />
    <!--<globalization culture="no" uiCulture="no" />-->
    ...
</system.web>

I have two separate Azure web apps to which I deploy the app. I set the connection strings and the app settings directly in the azure management portal which I find ok, since I had to do this just once. The problem is that there is no option to set the globalization element in the management portal and the deploy always rewrites it back to US (the wanted value is no - norwegian, not that it matters, it simply should be different than US).

Is there a way to handle it either using the azure portal (a better solution imho) or using a deploy script? If so, then how?


Solution

  • You could implement this using a custom deployment script: http://blog.amitapple.com/post/38417491924/azurewebsitecustomdeploymentpart1/#.Vh5_QXmFMaU

    One way to make the custom deployment script do what you want would be to have an app setting you define in your Norwegian site (via the portal) set to "Location = 'Norway'". Then in your custom deployment script you check to see if the app setting is set to Norway (it'll be available as an environment variable).

    If it is, then you override the web config with the Norway globalization setting. There are multiple ways you could implement this part.

    If the location is not defined or is set to US, then you leave it with the default US settings.