How to clear diagnostic logs on Azure Web Apps when using the Local Cache feature? - azure

I'm currently hosting a ASP.NET MVC Web app on Azure's App Service offering and have optionally opted into use their App Service Local Cache feature since my app does not need to write to the local file system.
This has improved the performance of my web app but I've come to realise that it fills up the local File System very quickly when a file system despite having the app setting "WEBSITE_HTTPLOGGING_RETENTION_DAYS": "2" with a quota of 99MB (not sure why I can't see this in AppSettings?) set on App > Diagnostic Logs area.
The documentation says it does modify the way logfiles are stored but doesn't mention how to remove them.
Web apps can continue to write log files and diagnostic data as they do currently. Log files and data, however, are stored locally
on the VM. Then they are copied over periodically to the shared
content store. The copy to the shared content store is a best-case
effort--write backs could be lost due to a sudden crash of a VM
instance.
There is a change in the folder structure of the LogFiles and Data folders for web apps that use Local Cache. There are now subfolders
in the storage LogFiles and Data folders that follow the naming
pattern of "unique identifier" + time stamp. Each of the subfolders
corresponds to a VM instance where the web app is running or has run.
This has been confirmed by by a quick Powershell command on the Kudu Console on the D:\home\logfiles directory.
PS D:\home\logfiles> Get-ChildItem | Sort LastWriteTime
Get-ChildItem | Sort LastWriteTime
Mode LastWriteTime Name
---- ------------- --------------------------
d----- 11/28/2017 1:52 AM http
d----- 11/28/2017 4:42 AM kudu
d----- 11/28/2017 4:46 AM SiteExtensions
d----- 12/1/2017 1:26 AM Application
d----- 12/1/2017 1:26 AM Monaco
d----- 3/7/2018 3:37 PM 5198ab_18_03_03_06_28_59
d----- 3/7/2018 4:03 PM 907c1a_18_03_06_06_44_22
d----- 3/8/2018 3:59 PM 5198ab_18_03_07_14_25_08
d----- 3/8/2018 3:59 PM ff0fc5_18_03_07_11_46_16
d----- 3/8/2018 4:02 PM 0c1a69_18_03_07_08_14_26
d----- 3/8/2018 4:03 PM a9316b_18_03_08_04_25_31
d----- 3/9/2018 4:02 PM 5e5ff2_18_03_08_08_44_41
d----- 3/9/2018 4:02 PM c87157_18_03_09_03_50_23
d----- 3/10/2018 6:18 AM 0c1a69_18_03_09_18_29_49
d----- 3/10/2018 10:32 AM 1440de_18_03_09_11_09_37
... <Excluded for brevity>
... <Excluded for brevity>
d----- 7/31/2018 12:33 PM fe780a_18_07_30_03_36_41
d----- 7/31/2018 4:02 PM f713f0_18_07_31_04_13_17
d----- 7/31/2018 4:03 PM 2a1ef5_18_07_30_23_18_41
d----- 8/1/2018 4:17 PM 7254a1_18_07_31_08_14_27
d----- 8/1/2018 4:18 PM c01540_18_08_01_02_17_00
d----- 8/1/2018 4:18 PM bcecd7_18_07_31_09_41_33
d----- 8/1/2018 4:18 PM 11e825_18_07_31_16_28_38
d----- 8/2/2018 6:18 AM 2ee8db_18_08_01_17_19_18
d----- 8/2/2018 6:18 AM 6ba224_18_08_01_04_13_34
d----- 8/2/2018 10:33 AM dca085_18_08_01_04_14_00
d----- 8/2/2018 10:33 AM 6ead4a_18_08_01_11_08_46
d----- 8/2/2018 12:32 PM 4c87a3_18_08_02_00_07_21
d----- 8/2/2018 12:33 PM faf4de_18_07_28_16_57_44
d----- 8/2/2018 4:21 PM 46b00f_18_07_31_23_36_35
d----- 8/2/2018 4:21 PM 52a38c_18_08_01_11_02_26
d----- 8/3/2018 12:33 PM bcecd7_18_08_01_07_50_23
d----- 8/3/2018 4:02 PM 8eac1e_18_08_03_02_32_24
d----- 8/5/2018 2:35 PM 2341b7_18_08_03_04_15_08
d----- 8/6/2018 12:16 AM 0d1e3e_18_08_02_09_30_34
d----- 8/6/2018 12:17 AM 540bec_18_08_01_10_02_30
d----- 8/6/2018 11:04 AM 3952e0_18_08_05_20_58_56
d----- 8/6/2018 11:59 AM NewRelic
My Environment settings are
"WEBSITE_LOCAL_CACHE_OPTION" : "Always"
"WEBSITE_LOCAL_CACHE_SIZEINMB" : "1800"
"WEBSITE_HTTPLOGGING_RETENTION_DAYS": "2"
"WEBSITE_LOCALCACHE_READY": "TRUE"
So the questions are
1) How do I remove periodically remove the "unique identifier" + time stamp folders e.g. 3952e0_18_08_05_20_58_56?
2) How can I make it respect my diagnostic settings e.g. Retention of 2 days with a maximum quota of 99MB?

Related

How to generate a service using generate-odata-client from an ECC or S4 using the service's $metadata?

I'm trying to convert a $metadata into a service for use with the SAP Cloud SDK Library.
generate-odata-client --inputDir .\ctradeslipdata_metadata.xml --outputDir tradeslipdata
Error
[2022-06-10T01:36:13.788Z] ERROR (generator-cli): ErrorWithCause: Generation of services failed.
at C:\Users\Avell\AppData\Roaming\nvm\v14.17.0\node_modules\#sap-cloud-sdk\generator\dist\generator-cli.js:22:18
Caused by:
Error: EEXIST: file already exists, mkdir 'D:\PESSOAL\PROGRAMACAO\JS\nest\exemplo-api-btp\ctradeslipdata_metadata.xml'
estruct
d---- dist
d---- node_modules
d---- src
d---- test
d---- tradeslipdata
-a--- 77 .env
-a--- 20 .eslintignore
-a--- 681 .eslintrc.js
-a--- 49 .gitignore
-a--- 51 .prettierrc
-a--- 62594 ctradeslipdata_metadata.xml
-a--- 5742 default-env.json
-a--- 443 manifest.yml
-a--- 220 nest-cli.json
-a--- 3107 package.json
-a--- 97 tsconfig.build.json
-a--- 581 tsconfig.json
-a--- 317412 yarn.lock
Your command uses an option --inputDir, which needs a directory path as parameter. However, you passed a file, which should be fixed.
Please check the complete documentation of the generator here.

Unable to find pyspark testing module

Although, in source code in github I see pyspark.testing module being present, however, my local environment is throwing error that pyspark.testing is not found.
https://github.com/apache/spark/blob/master/python/pyspark/testing/sqlutils.py#L27
(Source Code)
Have installed pyspark as
pip install pyspark
Folder structure inside pyspark module in conda environment:
d---- 6/2/2022 12:15 PM bin
d---- 6/2/2022 12:15 PM cloudpickle
d---- 6/2/2022 12:15 PM data
d---- 6/2/2022 12:15 PM examples
d---- 6/2/2022 12:15 PM jars
d---- 6/2/2022 12:15 PM licenses
d---- 6/2/2022 12:15 PM ml
d---- 6/2/2022 12:15 PM mllib
d---- 6/2/2022 12:15 PM pandas
d---- 6/2/2022 12:15 PM python
d---- 6/2/2022 12:15 PM resource
d---- 6/2/2022 12:15 PM sbin
d---- 6/2/2022 12:15 PM sql
d---- 6/2/2022 12:15 PM streaming
Although all other folders from git repo are present, however, testing folder is not present.
Installed pyspark version
pyspark==3.2.1

Unable to access WebGL app as Azure Web App

I'm trying to deploy a Unity WebGL app to Azure to run as a Web App. But I cannot get the app to deploy. I am using the latest version of Unity (2022.1.3f1).
I have built the app, and here are the contents of my `Build`` directory:
# Build> ll
-rw-r--r-- 1 DKS0510862 staff 3664517 Jun 9 11:12 DSG Westy Unity PoC.data.gz
-rw-r--r-- 1 DKS0510862 staff 78822 Jun 9 11:14 DSG Westy Unity PoC.framework.js.gz
-rw-r--r--# 1 DKS0510862 staff 20484 Jun 9 11:09 DSG Westy Unity PoC.loader.js
-rw-r--r-- 1 DKS0510862 staff 7390463 Jun 9 11:14 DSG Westy Unity PoC.wasm.gz
In VS Code, I am navigating to the Build directory, right-clicking on the directory, and then selecting Deploy to Web App. I am logged in to Azure, and I am prompted to select the App Service that I created in Azure, so my connection is okay.
The deployment seems to have run successfully.
4:02:14 PM innovation-unity-poc-dev: Starting deployment...
4:02:18 PM innovation-unity-poc-dev: Creating zip package...
4:02:22 PM innovation-unity-poc-dev: Zip package size: 10.9 MB
4:02:24 PM innovation-unity-poc-dev: Updating submodules.
4:02:24 PM innovation-unity-poc-dev: Preparing deployment for commit id '38620705e7'.
4:02:24 PM innovation-unity-poc-dev: Generating deployment script.
4:02:24 PM innovation-unity-poc-dev: Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"'.
4:02:26 PM innovation-unity-poc-dev: Generating deployment script for Web Site
4:02:27 PM innovation-unity-poc-dev: Generated deployment script files
4:02:27 PM innovation-unity-poc-dev: Running deployment command...
4:02:27 PM innovation-unity-poc-dev: Command: "C:\home\site\deployments\tools\deploy.cmd"
4:02:30 PM innovation-unity-poc-dev: Handling Basic Web Site deployment.
4:02:30 PM innovation-unity-poc-dev: Creating app_offline.htm
4:02:30 PM innovation-unity-poc-dev: KuduSync.NET from: 'C:\local\Temp\zipdeploy\extracted' to: 'C:\home\site\wwwroot'
4:02:30 PM innovation-unity-poc-dev: Deleting file: 'hostingstart.html'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.data.gz'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.framework.js.gz'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.loader.js'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.wasm.gz'
4:02:30 PM innovation-unity-poc-dev: Deleting app_offline.htm
4:02:30 PM innovation-unity-poc-dev: Finished successfully.
4:02:30 PM innovation-unity-poc-dev: Running post deployment command(s)...
4:02:30 PM innovation-unity-poc-dev: Triggering recycle (preview mode disabled).
4:02:30 PM innovation-unity-poc-dev: Deployment successful.
4:03:18 PM: Deployment to "innovation-unity-poc-dev" completed.
However, when I try to connect to the app, in the browser I am seeing the error message "You do not have permission to view this directory or page".
I see the following in the Web Server logs, but these don't appear to be error messages.
022-06-09 20:08:09 ~1INNOVATION-UNITY-POC-DEV GET /api/logstream/http X-ARR-LOG-ID=bba7b8a4-5d1e-4616-8f43-5237acd8a969 443 - 199.30.194.254 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/102.0.5005.61+Safari/537.36 - - innovation-unity-poc-dev.scm.azurewebsites.net 200 0 64 2729 1541 180037
2022-06-09 20:08:20 INNOVATION-UNITY-POC-DEV GET / X-ARR-LOG-ID=628fa657-ed76-4252-a55d-c15b3f4150cf 443 - 199.30.194.254 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/102.0.5005.61+Safari/537.36 ARRAffinity=22a7daa836b64a8ce56c907737553d08297ff2e76cd06a1f52c29956b9a85c17;+ARRAffinitySameSite=22a7daa836b64a8ce56c907737553d08297ff2e76cd06a1f52c29956b9a85c17 - innovation-unity-poc-dev.azurewebsites.net 403 14 0 422 1626 62
The only entry I am seeing in the Application Logs is a request to the logstream API.
I have no idea where to look to do any more troubleshooting. Is there some way I can see what the filesystem looks like for the app, to see if my files were deployed correctly?

Flutter packages not recognised in Android Studio

Flutter(1.22.5) packages are not recognized in Android Studio(Windows-10(64bit)),eventhough they are available in the "C:\src\flutter\packages\flutter\lib" directory.
How to resolve this?
Flutter path - C:\src\flutter
DartSdk path - C:\src\flutter\bin\cache\dart-sdk
Packages -
C:\src\flutter>cd "C:\src\flutter\packages\flutter\lib"
C:\src\flutter\packages\flutter\lib>dir
Volume in drive C has no label.
Volume Serial Number is 2EAF-73E1
Directory of C:\src\flutter\packages\flutter\lib
16-Dec-20 04:43 PM <DIR> .
16-Dec-20 04:43 PM <DIR> ..
16-Dec-20 04:43 PM 3,076 analysis_options_user.yaml
16-Dec-20 04:43 PM 9,707 animation.dart
16-Dec-20 04:43 PM 2,024 cupertino.dart
16-Dec-20 04:43 PM 1,777 foundation.dart
16-Dec-20 04:43 PM 1,216 gestures.dart
16-Dec-20 04:43 PM 6,018 material.dart
16-Dec-20 04:43 PM 2,464 painting.dart
16-Dec-20 04:43 PM 677 physics.dart
16-Dec-20 04:43 PM 3,170 rendering.dart
16-Dec-20 04:43 PM 694 scheduler.dart
16-Dec-20 04:43 PM 707 semantics.dart
16-Dec-20 04:43 PM 1,664 services.dart
16-Dec-20 04:43 PM <DIR> src
16-Dec-20 04:43 PM 5,308 widgets.dart
13 File(s) 38,502 bytes
3 Dir(s) 27,227,918,336 bytes free
main.dart -
import 'package:flutter/material.dart';
import 'C:\src\flutter\packages\flutter\lib\material.dart';
ERROR -
Error: Could not resolve the package 'flutter' in 'package:flutter/material.dart'.
^
lib/main.dart:6:8: Error: Not found: 'package:flutter/material.dart'
import 'package:flutter/material.dart';
^
lib/main.dart:7:8: Error: Error when reading 'c:src%0Clutterpackages%0Clutterlibmaterial.dart': StandardFileSystem only supports file:* and data:* URIs
import 'C:\src\flutter\packages\flutter\lib\material.dart';
The original project was created by downloading Flutter via Git ,maybe the latest Flutter version has some bugs.
Downloading Flutter stable version from the official website solved the issue.

webapp doesn't exist with Azure CLI 2.0.79

I have upgraded recently to 2.0.79 due to the problems with 2.0.78 caused with static HTML pages
I am following this Microsoft tutorial but keep getting the error
"webapp anotherwebapp doesn't exist"
when I enter the command:
az webapp up --location westeurope --name anotherwebapp --html
The contents on the directory is listed below (dir):
08/01/2020 08:27 PM <DIR> .
08/01/2020 08:27 PM <DIR> ..
08/01/2020 08:27 PM 4,447 .gitignore
08/01/2020 08:27 PM <DIR> css
08/01/2020 08:27 PM <DIR> fonts
08/01/2020 08:27 PM <DIR> img
08/01/2020 08:27 PM 2,338 index.html
08/01/2020 08:27 PM <DIR> js
08/01/2020 08:27 PM 1,183 LICENSE
08/01/2020 08:27 PM 608 README.md
4 File(s) 8,576 bytes
6 Dir(s) 1,214,520,279,040 bytes free
Any help with resolving this would be much appreciated!
First, are you sure "webapp anotherwebapp doesn't exist" is an error message? it should be a prompt since it actually does not exist.
I can successfully deploy it with 2.0.79, and the steps are as below:
1.Install azure cli 2.0.79 via downloading the .msi, then restarts the machcine.
2.Then in cmd prompt, nav to the folder where my html project resides -> run the command:
az webapp up --location westeurope --name anotherwebapp111 --html
The screenshot as below:
3.Nav to azure portal, I can see the site is deployed successfully.

Resources