locked
Copy file from Web App to Storage RRS feed

  • Question

  • Hello,

    we need some help to get the best choice for transfer client files from Web App hosted on Azure (files are in the wwwroot folder) to Azure storage.

    Actually clients save personal files in a directory identified by own id.

    These are most important requirements with some doubts:

    1. Client Authorization on directory;
    2. Files backup;
    3. Preview and Updating files on the actually WebApp;
    4. any solution for transferring all file with some tool (-> AzCopy?);

    We see both Blob Storage and FileStorage, but we are confused. Does these option meet our requirements?

    Thank you for any help about.

    David


    Tuesday, May 15, 2018 10:46 AM

Answers

  • Yes. You can Use Azure Blob storage for storing your data and have your app talk to this to get data. This would give you as much storage as you want, but obviously your app needs to know how to talk to blob storage. Azure Blob storage is useful for massive-scale, cloud-native applications that need to store unstructured data. To maximize performance and scale, Azure Blob storage is a simpler storage abstraction than a true file system.

    Also, check out the suggestions mentioned in the documentation Get started with Azure Blob storage using .NET for using blob storage with WebApps.

    --------------------------------------------------------------------------------------------------

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click here

    • Proposed as answer by Sandeep BR Wednesday, May 16, 2018 5:51 PM
    • Marked as answer by Davide D'Angelo Friday, May 18, 2018 2:04 PM
    Wednesday, May 16, 2018 5:51 PM

All replies

    1. What exactly you are trying to do? See  Authentication and authorization in Azure App Service
    2. What type of backup you are looking? See it might help you Back up a web app in Azure App Service
    3. Could you little elaborate the scenario? If you are looking to update web.config file see this link
    4. Yes, you can transfer the files using Azcopy.
            

    Refer :     Securing PaaS web and mobile applications using Azure Storage

                      https://stackoverflow.com/questions/36298620/copy-empty-folders-with-azcopy

                      How To Copy Files From An Azure App Service With PowerShell

    5. See  Deciding when to use Azure Blobs, Azure Files, or Azure Disks

    Tuesday, May 15, 2018 5:09 PM
  • Hello Sandeep BR,

    thank you for your answer.

    I try to explain my project and what we'd like to do better.

    Actually we have a web app on Azure, every clients save their files on the web app in the wwwroot folder, in subfolders. 

    Problem: backup on Azure for WebApp cannot be larger than 10 GB (actually web site is about 40 GB size), and on wwwroot files can be accessed everywhere if you know the url.

    So, the requirements are to move files on another place like Blob Storage or File Storage, moving files on subfolders which can be accessed only if you know the credentials, so if you are logged in the website, you can see your files of your virtual directory on Blob or Files Storage.

    Can Blob Storage meet all of these requirements?

    Thanks,

    David


    Wednesday, May 16, 2018 7:41 AM
  • Yes. You can Use Azure Blob storage for storing your data and have your app talk to this to get data. This would give you as much storage as you want, but obviously your app needs to know how to talk to blob storage. Azure Blob storage is useful for massive-scale, cloud-native applications that need to store unstructured data. To maximize performance and scale, Azure Blob storage is a simpler storage abstraction than a true file system.

    Also, check out the suggestions mentioned in the documentation Get started with Azure Blob storage using .NET for using blob storage with WebApps.

    --------------------------------------------------------------------------------------------------

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click here

    • Proposed as answer by Sandeep BR Wednesday, May 16, 2018 5:51 PM
    • Marked as answer by Davide D'Angelo Friday, May 18, 2018 2:04 PM
    Wednesday, May 16, 2018 5:51 PM
  • Hey Davide ,

    Just checking in to see if the above suggestions helped or you need further assistance on this issue.

    Friday, May 18, 2018 1:38 PM
  • Thanks Sandeep,

    next week I try to implements all discussed points.

    David

    Friday, May 18, 2018 2:05 PM
  • Hi Sandeep,

    I try to use AzCopy to transfer my data from wwwroot folder to a container on Blob Storage, but I'm getting this error:

     The syntax of the command is incorrect. The source azure storage location type can not be inferred. Use /sourceType:blob to specify the location type explicitly.

    Command used: AzCopy /Source:https://***..../upload/ /Dest:https://***.blob.core.windows.net/blobstfiles /DestKey:********* /S

    I try to upload from my own PC and it works.

    I try even with ****.scm.azurewebsites.net:443... but even i get this error: "The syntax of the command is incorrect. Invalid SAS token in parameter "Source". The syntax of the command is incorrect. Invalid SAS token in parameter "Source"."

    Any ideas?

    Thanks a lot,

    David

    Thursday, May 24, 2018 6:20 PM
  • Hi David,

    Modify your webapp at the points you read/write to wwwroot and read/write from/to the blob storage instead (see link from Sandeep)

    You can easily download the content of your wwwroot folder from kudu, just zip the wwwroot folder and download local, from there, upload to blob storage and a one off migration. You can do this via the Debug Console -> CMD, navigate to the site folder and click the first icon before the wwwroot folder to create a zipfile and download it.

    Remco


    Thursday, May 24, 2018 6:57 PM
  • Please surround your whole source argument with quotes, since it contains special characters to command prompt. Refer similar discussion on the stack overflow .

    --------------------------------------------------------------------------------------------------

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on  your forum experience, click here


    • Proposed as answer by Sandeep BR Saturday, May 26, 2018 7:32 PM
    Saturday, May 26, 2018 7:32 PM