Post

Azure Web App: Handling Files with SSH

by Markus on 09-02-2025

As I was deploying this application, the only concern for me was how to actually handle deployment of patches as my database is inside the application container itself, which you cannot access via Kudu. And any further deployments would just override all database contents.

1) Open Azure Cloud shell in Windows Terminal application, it is a built in component so no need for installs


2) Authenticate to your tenant using Device login and selecting your tenant by selecing the desired tenant number


3) When the shell opens insert the following command 
az webapp create-remote-connection --subscription [SubscriptionID] --resource-group [ResourcegroupName] -n [AppName] &


4) This will open a tunneled SSH connection to the webapp resource, after tunnel is open, you can use the same shell to ssh


5) During the SSH negotiation you may run into similar MAC error, just define it in the ssh command. After this you'll be prompted for the root password which is "Docker!"


Now when you are inside the docker / your websites actual active directory, you can confirm this by just running the "ls" command.


To make a copy of your database you'll just need to run "cp database.db /home/" and the file will be copied to your Kudu home, which you can then access directly with your browser using your default domain name:
https://.scm..azurewebsites.net/newui/fileManager
Ex: https://examplewebapp.scm.westeurope-01.azurewebsites.net/newui/fileManager

 

Now you can make a copy of into your dev and proceed with what ever update or patch you might be running. 

 

Hope this helped!




Credits:

User-interface icons created by Rizki Ahmad Fauzi - Flaticon