Webapp Webjob logs not appearning in storage container - azure

I have a webapp for which I have configured the App setting under configuration "AzureWebJobsDashboard" and "Azurewebjobstorage" which has the value for storage account and its access key.
As described in this article : https://www.marathonus.com/about/blog/introduction-to-azure-webjobs/
Once I set these setting and restart the app service, logs should appear in two storage containers as below
azure-webjobs-hosts
azure-jobs-host-output
However I see only azure-webjobs-hosts created and logging happening only sometimes. While I check for the webjob logs via Kudu site, I can see logs under the jobs folder, my job in txt files.
What am I doing wrong here?

I have followed the steps from the blog which you have provided and created one web job.
And Created one storage account and configured with the web job and published it into azure.
I can see created log files in storage account and kudu site.
You can restart your webjobs and check the storage account for the newly created logs.

Related

Where can i see App Service azure logs in Azure Portal

I have read several docs and tutorials about Azure App Services.
What i want to do is to see my application log (errors, exceptions, etc.) in azure portal.
I have read i need to configure something in order to store my logs to a Storage account, Log analytics, or Event Hub.
But, this command line shows me the logs !
az webapp log tail --name myapp --resource-group mygroup
So there is no need to configure anything in order to collect log, if this command can do it...
How can i do the same thing in azure portal ?
And how can i see more than 10 lines with this tail ?
Thanks
I find using "Log Stream" very useful. It outputs all your logs in realtime to the portal.
You can enable logging on the app service by browsing to the app service logs section under the app service blade in the azure portal. Here is a link that shows how to do it: https://manojchoudhari.wordpress.com/2019/11/01/azure-app-service-and-diagnostics-logging/
Here is another article that shows how to enable diagnostic logging on the app service from the portal: https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs
In terms of the tailing command, the documentation doesn't have any params to do this so I doubt it you can increase the number of lines. However, you can output your logs with -o which you might already know.
When your web apps service is down you can get more details in "Diagnose and solve problems" in azure portal, you can get application logs, container issue, memory usage and other details.
https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics
If you want to debug your code deployed in app service inside azure portal then you can go to advanced tool and launch KUDU.
https://www.gslab.com/blogs/kudu-azure-web-app
Note: You need to have contributor permissions for this.

Sitefinity 12.1 is crashing Azure Webapp

Sitefinity is crashing himself which is hosted in azure .Net webapp while uploading the documents into azure blob storage
We do have multiple Sitefinity sites and only one site is crashing himself while document publishing in to azure blob storage.
Created a separate Resource group and hosted the web app and separate SQL DB and storage account also.
Exactly crashing while uploading the documents but it's working fine while with local file storage.
Checked all the logs and found no issues... any clue ...
Seems to me it's trying to upload files locally (inside the web app), but using a wrong path rather than uploading to azure storage. One thing you can do: enable log streamming then you'll know for sure what happenned.
https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs
If the azure blob storage is failing on local does your IP have access to the resource in azure? If not this could cause a failed.

Mount Azure Web App Files' folder into VM?

how do I mount an azure webb app folder on VM, I've a webb App and a Virtual Machine and I need to mount the web app files and folders to my VM.
If it’s a local VM, you cannot mount the drive. However, you have ways to copy files/folders to and from Azure App Service.
You could use an FTP app or Kudu service.
Based on the WebApp App Service Plan the volume of the storage varies. You could use Kudu console (https://yoursite.scm.azurewebsites.net) to manage the files- it gives you both command line and file browser access to your sites, all from the comfort of a web browser.
Every Azure WebApp has a home directory stored/backed by Azure Storage. It is owned by Azure WebApp Service and cannot be chosen currently; however, you could select storage account for Azure WebApp Diagnostic logs.
Additionally, one of the unique aspects of App Service that makes app deployment and maintenance straightforward is that all user content is stored on a set of UNC shares. This model maps well to the common pattern of content storage used by on-premises web hosting environments that have multiple load-balanced servers.
Within App Service, there is a number of UNC shares created in each datacenter. A percentage of the user content for all customers in each data center is allocated to each UNC share. Furthermore, all of the file content for a single customer's subscription is always placed on the same UNC share.
Also, mapping Azure File Share isn't supported on Azure App Service:
https://feedback.azure.com/forums/169385-web-apps-formerly-websites/suggestions/6084609-allow-map-azure-file-share-microsoft-azure-file-s
it's impossibe,
you must use one of the five Azure auto deploy option, (Github, Bitbuket etc ..)

How do I configure which storage account my Web Apps and Function Apps use?

Is this even possible? I have a couple web apps and a couple of Azure Functions running under the same App Service Plan. I'd like to (ideally) have them use a specific Storage plan, so I can keep everything in one place. I envision them in different containers under the same plan.
If that's not possible...then where are the files? Are they on the storage that's built into the App Service Plan itself? If so, can I connect to this somehow, so I can manage the files through something like Storage Explorer?
Today when playing with the Azure Az Powershell tool I found I was able to provision a Function App without a Azure Storage back-end. This cannot be done via the UI. An easy way to provision a Function App with a storage account backend is by leveraging the Azure UI for provisioning.
When a Function App is provisioned via command line, the bits seem to be stored within the function app itself. There is an FTP URL given if you download the publish profile. The files can be read and written to using an FTP tool like WinSCP (as alternative to Kudu)
I'd like to (ideally) have them use a specific Storage plan, so I can keep everything in one place. I envision them in different containers under the same plan. If that's not possible...then where are the files? 
Every Azure Web App has a home directory stored/backed by Azure Storage. More detail info please refer to Azure WebApp sandbox. It is owned by Azure WebApp Service, we are not able to choose Azure Storage to setup WebApp by ourselves currently. But we could config storage account for Azure WebApp Diagnostic logs.
Are they on the storage that's built into the App Service Plan itself? If so, can I connect to this somehow, so I can manage the files through something like Storage Explorer?
Different WebApp Service Plan has different volume of the storage. We could use Kudu tool (https://yoursite.scm.azurewebsites.net) to manage the files. More detail info about Kudu please refer to the document.
Update:
We could access the home directory with the Kudu tool. More details please refer to the snapshoot

How to display azure app service's web server log on Azure log Analytics?

I have an api application hosted on azure App services. For the web server log (iis logs) I've turned on web server logging from Azure portal. Look at the screenshot below.
For storing web server logging
Server Logs are allowed to be stored on the Azure blob containers only. As per the configuration the logs are stored on blob container as expected. Now I want to use these logs to be displayed on Azure Log Analytics.
I've the following storage configurations on Log Analytics in Azure Web portal.
On Log Analytics explorer I can view logs from all other sources except the web server (iis logs). What I'm missing here?
Verified with App Services team that Log Analytics is only supported at the IaaS (VM) level, not at PaaS (App Service) level.
Hopefully we can get this on their roadmap soon - for now you have to manually ingest this data into an external log management tool (Splunk, Sumo Logic, Azure Data Explorer).
Update 12/02/2019
Azure App Service has announced a Public Preview for IIS App Log integration with Azure Log Analytics.
Expanding on the prior answer, under the Diagnostic settings (preview) pane you can now integrate multiple logs to Azure via Add diagnostics setting, this can store:
AppServiceAntivirusScanAuditLogs
AppServiceHTTPLogs
AppServiceConsoleLogs
AppServiceAppLogs
AppServiceFileAuditLogs
AppServiceAuditLogs
AppServiceIPSecAuditLogs
AppServicePlatformLogs
AllMetrics
You can send them to:
Log Analytics workspace
Archive to storage account
Stream to event hub
Send to partner solution
Additionally, Application Insights is migrating to be backed by Log Analytics so we are getting close to fully integrated platform for metrics and logs

Resources