Home > Enterprise >  Azure Web Apps: Fastest Way(s) to Transfer Files Between Apps
Azure Web Apps: Fastest Way(s) to Transfer Files Between Apps

Time:02-04

I've found many questions and answers that are similar to mine, but they all seem to be very specific use cases - or, at least, different/old enough to not really apply to me (I think).

What I want to do is something that I thought would be simple today. The most inefficient thing with the web apps is that copying files between them can be slow and/or time-consuming. You have to FTP (or similar) down, the send it back up.

There must be a way to do this same thing, but natively within Azure so the files don't necessarily have to go far and certainly not with the same bandwidth restrictions.

Are there any solid code samples or open-source/commercial tools out there that help make this possible? So far, I haven't come across any code samples, products, or anything else that makes it possible (aside from many very old PowerShell blogs from 5 years ago). (I'm not opposed to a PowerShell-based solution, either.)

In my case, these are all the same web apps that have minor configuration-based customization differences between them. So, I don't think webdeploy is an option because it's not about deployment of code. Sometimes it's simply creating a clone for a new launch, and other times its creating a copy for staging/development.

Any help in the right direction is appreciated.

CodePudding user response:

If you are transferring only a handful of files and you don't need to automate data transfer, consider the tools with a graphical interface.

  • Graphical interface tools such as Azure Storage Explorer and Azure Storage in Azure portal. These provide an easy way to view your data and quickly transfer a few files.

If you are comfortable with system administration, consider command line or programmatic/scripting tools.

  • Scripting/programmatic tools such as AzCopy/PowerShell/Azure CLI and Azure Storage REST APIs.

The format of the AzCopy command line is:

AzCopy [optional filespec] /S /DestKey:

Uploading files to Azure App Service directly from the Azure portal

This can be done via the Kudo Console or in the new App Service Editor (preview).

To open the Kudo Console

  • Navigate to YOUR APP SERVICE -> Development Tools -> Advanced Tools or bookmark https://yourappservice.scm.azurewebsites.net/DebugConsole. And then just drag and drop the files you want to upload onto the relevant folder.

enter image description here

  • To open App Service Editor navigate to YOUR APP SERVICE -> Development Tools -> App Service Editor (Preview) or bookmark https://yourappservice.scm.azurewebsites.net/dev. You can upload files by dragging them onto the Explore pane on the LHS.

Please refer Migrating Data to Microsoft Azure Files , Choose an Azure solution for data transfer and Transfer data to and from Azure for more information

CodePudding user response:

As you've noticed, copying files over to AppService is not the way to go. For managing files across different AppService instances, try using a Storage Account. You can attach an Azure Storage file share to the app service and mount it. There's a comprehensive answer below on how to get files into the storage account.

Alternatively, if you have control over the app code, you can use blob storage instead of files and read the content directly from the app.

  •  Tags:  
  • Related