Deploy your app to Azure App Service using FTP/S
This article shows you how to use FTP or FTPS to deploy your web app, mobile app backend, or API app to Azure App Service.
The FTP/S endpoint for your app is already active. No configuration is necessary to enable FTP/S deployment.
Step 1: Set deployment credentials
To access the FTP server for your app, you first need deployment credentials.
To set or reset your deployment credentials, see Azure App Service Deployment Credentials. This tutorial demonstrates the use of user-level credentials.
Step 2: Get FTP connection information
- In the Azure portal, open your app's resource page.
Select Overview in the left navigation, then note the values for FTP/Deployment User, FTP Host Name, and FTPS Host Name.
To provide proper context for the FTP server, the FTP/Deployment User value displayed by the Azure portal includes the app name. You can find the same information when you select Properties in the left navigation.
Also, the deployment password is never shown. If you forget your deployment password, go back to step 1 and reset your deployment password.
Step 3: Deploy files to Azure
- From your FTP client (for example, Visual Studio or FileZilla), use the connection information you gathered to connect to your app.
- Copy your files and their respective directory structure to the /site/wwwroot directory in Azure (or the /site/wwwroot/App_Data/Jobs/ directory for WebJobs).
- Browse to your app's URL to verify the app is running properly.
Unlike Git-based deployments, FTP deployment doesn't support the following deployment automations:
- dependency restores (such as NuGet, NPM, PIP, and Composer automations)
- compilation of .NET binaries
- generation of web.config (here is a Node.js example)
Generate these necessary files manually on your local machine, and then deploy them together with your app.
For enhanced security, you should allow FTP over SSL only. You can also disable both FTP and FTPS if you don't use FTP deployment.
In your app's resource page in Azure portal, select App settings in the left navigation.
To disable unencrypted FTP, select FTPS Only. To disable both FTP and FTPS entirely, select Disable. When finished, click Save.
Troubleshoot FTP deployment
- How can I troubleshoot FTP deployment?
- I'm not able to FTP and publish my code. How can I resolve the issue?
- How can I connect to FTP in Azure App Service via passive mode?
How can I troubleshoot FTP deployment?
The first step for troubleshooting FTP deployment is isolating a deployment issue from a runtime application issue.
A deployment issue typically results in no files or wrong files deployed to your app. It can be addressed by investigating your FTP deployment or selecting an alternate deployment path (such as source control).
A runtime application issue typically results in the right set of files deployed to your app but incorrect app behavior. It can be addressed by focusing on code behavior at runtime and investigating specific failure paths.
To determine a deployment or runtime issue, see Deployment vs. runtime issues.
I'm not able to FTP and publish my code. How can I resolve the issue?
Check that you've entered the correct hostname and credentials. Check also that the following FTP ports on your machine are not blocked by a firewall:
- FTP control connection port: 21
- FTP data connection port: 989, 10001-10300
How can I connect to FTP in Azure App Service via passive mode?
Azure App Service supports connecting via both Active and Passive mode. Passive mode is preferred because your deployment machines are usually behind a firewall (in the operating system or as part of a home or business network). See an example from the WinSCP documentation.
For more advanced deployment scenarios, try deploying to Azure with Git. Git-based deployment to Azure enables version control, package restore, MSBuild, and more.