Tracking file history in Azure App service - azure

I'm hosting a website on Azure using an App Service. Suddenly one of the .config files (I have both a Web.config and a Config.config file) went missing and the website stopped working.
When I deploy the website to Azure for some reason the Config.config file is not included (even though I set it to be copied always) and I have to add it manually afterwards. But there were no recent deploys for that website, so I have no explanation for how that file suddenly disappeared and caused the website to crash.
I was wondering if there is any way to pin down the exact moment when the file was deleted and what caused it to be deleted (if a certain user deleted it or something like that)? A Git-like history for the files hosted in the Azure App Service, if you will...

I am not sure if you enabled the Web server logging in your web app in the portal -> App Service logs like below.
If you enabled it, the log will send to your storage blob container which you configured. If not, I suppose you may could not find the log.
For example, I delete the file test.js in the kudu console wwwroot of my web app, you could find the log in the storage like below.
For more details about app service logs, you could check this doc(the doc has not been updated for three years, something is different from that currently).

Related

Azure Web App with Linux Logging not works

i try my first steps with Azure. I have upload a WebApp (Blazor WASM Serverhosted) on a Linux System. Now i want to see the logs. My application brokes on Azure on startup. Everything I have tried has not worked.
The logstream shows nothing.
The Monitoring/logs are disabled
I activate in Monitoring/App Service Logs the File System and go to FTP Folder and i don't find a log-folder or something like this
I hope for help to fix my App or Configuration on Azure
Still the issue can be available in github . You can achieve this by using below steps.
Steps provided here. And I am deployed in Linux app service
Now you can be able to view the logs in application insights
You can add/modify the custom logs as well by using the custom telemetry client.
Refer here for detailed information

Azure App Service Kudu tool "LogFiles" Deleted Automatically -- app service for container (linux)

I hosted my dotnet core app on app service for containers and I'm using the standard logging to log http request, but when I check my log files from kudu, it seems that files deleted automatically each day to add new day-file
As example,
on 25/10/2020 I got those files
(22-10-2020_docker_log, 19-10-2020_docker_log, 25-10-2020_docker_log)
and on 26/10/2020 I got those files
(22-10-2020_docker_log, 19-10-2020_docker_log, 26-10-2020_docker_log)
Why this happened? is log files deleted daily? I think it should never deleted, isn't it?
Thanks in advance.
Enable application logging by navigating to your app, select App Service logs.
In Application logging, select File System.
In Quota (MB), specify the disk quota for the application logs. In Retention Period (Days), set the number of days the logs should be retained.
Click Save.

Azure web hosting using FTP / MS WebDeploy

Can I host a web application created on .net core 2.1 with sql server as database to azure web app service using CI tools / MS WebDeploy?
The following points I want to take care:
The application is using file system for temp storage and file storage
Deployment should be managed by some CI tools such as jenkins
After deployment, the app settings file should be modified with some keys/server details
Log files(stored on app root) should be accessible by application administrator
Is there a way to create a virtual directory same as in IIS and upload the files using FTP or similar protocols..?
All your doubts about deploying .net core 2.1 web app are achievable.
Suppose our projects are all completed and uploaded to github.
Questions and explanations about your concerns:
About the connection configuration using the database, you can directly configure it in web.config. If you are using azure sql server, find the connection string, set up the firewall, and pass the SSMS test, you can test the connection in the code. It can also be added in the Configuration -> Application settings -> Connection strings in the portal. After the addition, the priority is higher than the configuration in web.config, which will override the configuration and not modify the web.config file.
Regarding the use of file storage, you can use azure storage services or not. Looking specifically at the business, for example, very small pictures, documents and other files can be stored in the current program running directory, which is consistent with the original development at the code level. When publishing, you need to include the MyFiles file in the publishing process, or wait for the publishing to be completed and add folders manually in kudu, or the program can judge. It is recommended to use the program to judge that the subsequent program upgrade will not lose data.
The confidential information in the app settings file can actually be configured in web.config or appsetting.json. Make sure that the offline project is running properly when you are debugging locally, and then you can publish it. The rest is configured in the portal as in the first explanation.
The Log Files file storage can fully achieve the effect you want. It should be enough to set the owner permissions of this app services. For details, please refer to the official documentation.
Virtual directories and virtual applications, I have a better answer in another post here, you can refer to it.
Steps:
First of all, we can create a web app in portal and select .net core 2.1. Create appservices, and click Deployment Center when finished.
Follow the prompts step by step, and wait until the Action in github is completed, and the release is successful.

Azure App Service - App Domain restarted when adding new files into wwwroot folder

I have an App Service deployed on three different regions (exact same code). My services needs to syncup some files at run-time and put them in the local cache of the app service.
For convenience, I have placed the files under the wwwroot folder. This is because when a new deployment happens, I want them to be gone too.
The thing is that in two of the three App Services, every time that a folder gets created under the wwwroot, the App Domain restarts and it breaks the functionality of the service. For the third service, the App Domain does not restart at all and requests to it work well. I know that changes in the wwwroot folder may trigger an App Domain recycle but don't get why it only happens in two of the regions.
Is there any configuration that might affect the behavior and how/when the App Domain gets restarted?
I also tried to add below on the web.config of my service but then the service doesn't even load up.
<httpRuntime fcnMode="Disabled" />
I got that information from this thread: Azure Websites AppDomain many restarts
Deployment pretty much does only one thing: it deploys files into the wwwroot folder. It never directly does anything to restart the App.
This is true whether you use Visual Studio deployment (msdeploy), git/GitHub/etc deployment, FTP, or manually copy some files over using Kudu Console.
The key word above is directly, meaning the deployment doesn't make any magic API calls that cause a site restart. However, in some cases, the act of deploying files into wwwroot can cause some form of restart. In that sense, the deployment is indirectly causing a restart, but it really knows nothing about it. It's up to the Application's runtime to react to file change notifications and do what it thinks is right.
For more details, you could refer to this article.
You can optionally use the configSource attribute to reference external configuration files that do not cause a restart when a change is made. For more information, see configSource in General Attributes Inherited by Section Elements.

Azure Continuous Delivery - How to deploy a folder to an App Service?

I'm pretty sure i am doing something wrong.
But let me attempt to explain my situation...
I created an Azure App Service with Continuous Delivery configured. So far i see that all my deployments are successful. When i go to my app service URL i see Service Unavailable.
Now i suspect my problem could be related to what is being deployed.
Note that I am using Visual Studio Online for my source control and build system.
The source/repo only has 3 folders:
- A folder called .vscode
- A folder called Tools (a bunch of .net console apps)
- A folder called Service (my node.js based service)
Now, the source builds successfully.
And the continuous deployment, triggered after a queued build, completes successfully.
But when i go to the service url i see the dreaded message "Service Unavailable".
I suspect the problem is related to this:
Basically im not sure what is being deployed here.
What i want to deploy is just the Service folder (my node.js app).
I suspect somehow that the entire source tree is being deployed.
Some additional details:
Http Protocol: HTTPS
Error: 503 - Service Temporarily Unavailable
Any help/insights are much appreciated!
Updates
I am confused if the Continuous Delivery option can deploy the node.js app. I did come across this article which shows how to deploy node.js app via "Push to Azure from Git".
Updates 2
I'm not entirely sure right now because i havent tried this out. But the answer to this question seems to hold the key (it seems like it is exactly what im looking for).
Updated 3
I was able actually get the node.js app to start. The issue was that the .js file is two folders deep (in the Service folder). I updated the "Startup command" setting under the "Deploy Azure App Service" (under Continuous Delivery build definition). Now i can see (from the Kudu Docker logs) that it is running.
The problem im having now is that the node.js app can't seem to conenct to the Azure SQL database (this works when i run locally).

Resources