azure-services-web-apps.md (2449B)
1 --- 2 title: "Azure Services - Web Apps" 3 section: "Cloud" 4 sectionSlug: "cloud" 5 sourcePath: "docs/cloud/azure/azure-services-web-apps.md" 6 sourceUrl: "https://github.com/swisskyrepo/InternalAllTheThings/blob/203bb0c0b290/docs/cloud/azure/azure-services-web-apps.md" 7 sha: "203bb0c0b290" 8 isIndex: false 9 --- 10 11 # Azure Services - Web Apps 12 13 ## List Web App 14 15 ```ps1 16 az webapp list 17 ``` 18 19 ## Execute Commands 20 21 ```ps1 22 $ARMToken = Get-ARMTokenWithRefreshToken ` 23 -RefreshToken "0.ARwA6WgJJ9X2qk..." ` 24 -TenantID "contoso.onmicrosoft.com" 25 26 Invoke-AzureRMWebAppShellCommand ` 27 -KuduURI "https://<webapp>.scm.azurewebsites.net/api/command" ` 28 -Token $ARMToken ` 29 -Command "whoami" 30 ``` 31 32 ## SSH Connection 33 34 First check if the SSH over HTTP connection is enabled: `(curl https://${appName}?app.scm.azurewebsites.net/webssh/host).statuscode` 35 36 ```powershell 37 az webapp create-remote-connection --subscription <SUBSCRIPTION-ID> --resource-group <RG-NAME> -n <APP-SERVICE-NAME> 38 ``` 39 40 ## Kudu 41 42 In Azure App Service, Kudu is the advanced management and deployment tool used for various operations such as continuous integration, troubleshooting, and diagnostic tasks for your web applications. It provides a set of utilities and features for managing your app’s environment, including access to application settings, log streams, and deployment management. 43 44 You can access this Kudu app at the following URLs: 45 46 * App not in the Isolated tier: `https://<app-name>.scm.azurewebsites.net` 47 * Internet-facing app in the Isolated tier (App Service Environment): `https://<app-name>.scm.<ase-name>.p.azurewebsites.net` 48 * Internal app in the Isolated tier (App Service Environment for internal load balancing): `https://<app-name>.scm.<ase-name>.appserviceenvironment.net` 49 50 Key Features of Kudu in App Service: 51 52 * **Web-Based Console**: Provides a command-line interface (CLI) to execute commands directly on the App Service environment. 53 * **File Explorer**: Lets you view and manage files in your app’s environment. 54 * **Environment Diagnostics**: Offers insights into the environment variables, app settings, and detailed diagnostic logs. 55 * **Process Explorer**: Allows you to monitor and manage running processes in your app’s environment. 56 * **Access to Logs**: Easily view, download, and stream logs for debugging and troubleshooting. 57 58 ## References 59 60 * [Training - Attacking and Defending Azure Lab - Altered Security](https://www.alteredsecurity.com/azureadlab)