@MoTaar To copy files from an Azure App Service to a local machine or to an Azure file share, you can use FTPS (FTP over SSL). Here's an example PowerShell script that uses FTPS to download files from an Azure App Service to a local machine:
# Replace the values below with your own
$resourceGroupName = "myResourceGroup"
$appName = "myAppService"
$username = "username"
$password = "password"
$localPath = "C:\local\path"
$remotePath = "/site/wwwroot/remote/path"
# Connect to the Azure App Service using FTPS
$ftpsUri = "ftps://$appName.ftp.azurewebsites.windows.net/$remotePath"
$ftpsRequest = [System.Net.FtpWebRequest]::Create($ftpsUri)
$ftpsRequest.Credentials = New-Object System.Net.NetworkCredential($username, $password)
$ftpsRequest.Method = [System.Net.WebRequestMethods+Ftp]::DownloadFile
$ftpsRequest.EnableSsl = $true
# Download the files
$response = $ftpsRequest.GetResponse()
$stream = $response.GetResponseStream()
$localFilePath = Join-Path $localPath (Split-Path $ftpsRequest.RequestUri.LocalPath -Leaf)
$stream.ReadTimeout = 10000
$buffer = New-Object byte[] 1024
$fs = New-Object System.IO.FileStream($localFilePath,[System.IO.FileMode]::Create)
while (($read = $stream.Read($buffer,0,$buffer.Length)) -gt 0) {
$fs.Write($buffer,0,$read)
}
$fs.Close()
$response.Close()
Write-Host "Files downloaded to $localFilePath"
Make sure to replace the values for $resourceGroupName
, $appName
, $username
, $password
, $localPath
, and $remotePath
with your own values.
If you're still having trouble, please let me know and provide more details about the issues you're facing.