You need to download the diagnostic log files from a Windows-based Azure App Service named `contoso-web` by using the Kudu REST API. You want to retrieve all log files compiled into a single compressed ZIP file.
Arrange the actions in the correct order to configure the request, authenticate, and download the logs.
- 1Retrieve the publishing profile or deployment credentials for the App Service.
- 2Construct the target URL using the App Service SCM domain and the `/api/zip/LogFiles/` path.
- 3Send an HTTP GET request to the constructed URL using the retrieved credentials for Basic Authentication.
- 4Save and extract the downloaded ZIP archive locally to access individual log files.
Answer
Retrieve the deployment credentials, construct the SCM endpoint URL targeting the zip API, execute the authenticated HTTP GET request, and extract the downloaded ZIP file.
To download logs using the Kudu API, you must first obtain valid publishing credentials to satisfy authentication requirements. Then, you construct the endpoint URL using the app's SCM site name and the `/api/zip/LogFiles/` directory path. Next, you send the authenticated GET request to receive the compressed log archive. Finally, you extract the ZIP locally to view the logs.
Step-by-Step Solution
Key Concept
Accessing App Service diagnostic logs via the Kudu (SCM) REST API zip endpoint.