Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 2.13 KB

powershell-deploy-ftp.md

File metadata and controls

47 lines (31 loc) · 2.13 KB
title description tags ms.assetid ms.topic ms.date ms.custom
PowerShell: Upload files using FTP
Learn how to use Azure PowerShell to automate deployment and management of App Service. This sample shows how to upload files to an app using FTP.
azure-service-management
b7d46d6f-44fd-454c-8008-87dab6eefbc1
sample
12/06/2022
mvc, devx-track-azurepowershell

Upload files to a web app using FTP

This sample script creates a web app in App Service with its related resources, and then deploys a file to it using FTPS (via System.Net.FtpWebRequest).

If needed, install the Azure PowerShell using the instruction found in the Azure PowerShell guide, and then run Connect-AzAccount to create a connection with Azure.

Sample script

[!INCLUDE updated-for-az]

[!code-azurepowershell-interactivemain]

Clean up deployment

After the script sample has been run, the following command can be used to remove the resource group, web app, and all related resources.

Remove-AzResourceGroup -Name myResourceGroup -Force

Script explanation

This script uses the following commands. Each command in the table links to command specific documentation.

Command Notes
New-AzResourceGroup Creates a resource group in which all resources are stored.
New-AzAppServicePlan Creates an App Service plan.
New-AzWebApp Creates a web app.
Get-AzWebAppPublishingProfile Get a web app's publishing profile.

Next steps

For more information on the Azure PowerShell module, see Azure PowerShell documentation.

Additional Azure PowerShell samples for Azure App Service Web Apps can be found in the Azure PowerShell samples.