Azure App Service on Linux - Static File Content not updated - azure

I have created an App Service (inside Linux based App Service Plan). I have connected to wwwroot folder using FTP Client
In the hostingstaart.html, I made a simple text change.
I couldn't see the change getting reflected when I navigate to https://.azurewebsites.net/
However, when I navigate to Kudu and access the same page, I can see the change.
Below is the screenshot.
In the left hand side (kudu website), I can see the change that I have made (DevOps Engineers). However, In this right hand side, the changes is not shown.
In order to troubleshoot, I have added another file as well which is visible in Kudu. But, I'm not able to access the same.
This is not at all an issue in Windows Based App Service Plan. This is an issue only with Linux based app.
Is there any docker container internally where it reads the files from? if yes, how do change those files?
Appreciate any help here .
Thanks,
Praveen

Yes, Azure App Service on Linux run in containers and depending on the platform, different webservers and locations are used which can get confusing.
For SSH access into the container go to https://<yourappname>.scm.azurewebsites.net/webssh/host - in .NET projects on Linux the default page you'll see on a new app service is stored at /defaulthome/hostingstart/wwwroot/hostingstart.html while files you upload via FTP will go to /home/site/wwwroot.
That being said, I'd recommend to use the documented ways to publish content based on the platform you want to use. For .NET, you can find the docs here.

Related

How delete all the files that are in Folder in Azure app service using Kudu console

I have a Temp Folder in Azure app service, I need to delete files that are inside it, I use Kudu console to login, the Folder in c:\Home\Mysite\wwwroot\Temp
How and with what command I can delete all the files that are in this folder?
We can use below command to delete all files from respective folder through KUDU console using cmd.
Remove-Item –path c:\Home\Mysite\wwwroot\Temp\* –recurse
I understand it’s a delayed response. Apologies for the late answer.
On Azure App Service WebApp (PAAS solution), unlike Persisted files, these files (temp) are not shared among site instances. Also, you cannot rely on them staying there. When you scale out, each instance has its own temp folder. When you restart your WebApp, you'll find that all of these folders get reset to their original state. Those files only get cleaned when your site is restarted.
Another important note is that the Main site and the scm site do not share temp files. So, if you write some files there from your site, you will not see them from Kudu Console (and vice versa). You can make them use the same temp space if you disable separation (via WEBSITE_DISABLE_SCM_SEPARATION). Just highlight this for additional info, but note that this is a legacy flag, and its use is not recommended/supported.
You may check your WebApp limit and usage in portal by going to "Diagnose and solve problems" section of your App Service blade, selecting "Best Practices", "Best Practices for Availability, Performance", and then "Temp File Usage On Workers". Please note that the displayed usage and limits are per worker, and are aggregated across all apps in the same app service plan.
Ref: Kindly check these GitHub wiki and Operating system functionality on Azure App Service for more info.

Large number of files missing in fileManager of a website deployed on Azure App Service

I am unsure if this is happening by design, or it's supposed to work this way. Through Visual studio Publish option, I published my ASP.NET Core website on Azure App Service. Now, when I access the fileManager on https://mywebsite.scm.azurewebsites.net/fileManager, I am missing majority of the files. I can only browse some log files, several zipped packages.
The website itself works fine when I am trying to access it on the link, however I am unable to browse all the files for it. I was wondering if this is an intended design, or I have done something wrong.
Kind Regards.
HTML5 component, that allows web pages to store named key value pairs locally. It just setting to store our web app.
To solve the files not able to view via kudu
Open Browser -> go to Developer tools or hit F12 -> In the console run the following cmd
window.localStorage['maxViewItems'] = 1000
Still you are facing issue please check and compare with Azure App Service Editor and Kudu files. I had checked both Kudu and App Service Editor shows the same files which contain the web app.
Refer Kudu error with maxViewItems in localstorage

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.

Clarification on Azure Web App Scale Instance

Per article below web app has an option to either auto or manual scale:
https://azure.microsoft.com/en-us/documentation/articles/insights-how-to-scale/
Would appreciate if I can get clarification on below:
Scenario:
I've ASP.NET Sitecore CMS which uses Lucene behind the scene for search. Lucene index gets rebuilt upon publish of new pages.
Lets say I manually or auto scale to 2 instances:
What exactly happens behind the scene i.e. copies all the website folder to new VM and sets up IIS etc?
Web App has functionality to FTP and view website folders. Is it possible to FTP to both of these instances? From what I know I can only FTP to one of them.
Update:
Problem we are facing:
We use lucene index for our web applications. Looks like the index is built on one web app and not other (website works for some user and not for others). We would like to FTP or RDP and see to make sure this is the case.
Thanks.
The FTP or the GIT provided by the Azure is not on the same instance when you use WebApps, So if you do FTP its not to one of the instances - its somewhere else, but when you change files in the FTP or push to GIT, the triggers kick in and a continuous deployment to the Webapp instance/s is done. You can be very well assured that when you upload new files to your FTP that comes with WebApp the build will be updated on both instances. In fact that's one of the driving forces behind webapps that you don't need to think about a VM.
We used once Lucene on Web Apps with multiple instances. What we did back then was use Azure Blob Storage to keep the index files, no matter the number of instances, all had the same index information.
The only problem was that when new instances would come up (autoscale), they had to load the index on memory and that lead to some cold-starts.
We moved to Azure Search afterwards and never looked back :)

Geoserver on Microsoft Azure Website

I need to add some Geoserver data on my Azure Website. I'm just wondering that if I need to install Geoserver for that on my account (if it is possible) or is there some other way?
As I was just looking around, I found this link working
http://geoserver.azurewebsites.net/
If this link is working, does it mean that we can configure Geoserver on Azure
There are a couple of ways to do this.
One option is to use a plain old Azure Web App with the GeoServer web archive (WAR file).
To do this download the web archive version of GeoServer. Then create a web app in the Azure portal. Under application settings you need to specify Java version 8 and a Tomcat version above 7.0.65. Then all you need to do is ftp the GeoServer WAR file to /site/wwwroot/webapps.
Once you have done that you should be able to access GeoServer by visiting your web app with the path /geoserver appended to the url. But be patient, the initial start up is slow and can take a few minutes.
Another option is to deploy a container image. I have ended up creating one myself that is tailored for use in an Azure Web App.
To use it you will need a Linux App Service Plan. When creating your web app select Docker Hub as the container image source and use coderpatros/geoserver-azure-web-app as the image. You can also specify a tag to use a particular GeoServer version. i.e. coderpatros/geoserver-azure-web-app:2.14.2. The available tags can be found on Docker Hub at https://hub.docker.com/r/coderpatros/geoserver-azure-web-app/tags. After you've created the web app you need to go to application settings and set WEBSITES_ENABLE_APP_SERVICE_STORAGE to true to enable persistent storage.
There is a OpenGeo Suite in Azure marketplace which helps in publishing maps and data from a variety of formats and sources with GeoServer.
Not sure if it will help you, but here ... OpenGeo Suite

Resources