upload file by using R shiny to azure cloud

Good Morning
I have very simple shiny app where I'm using it to upload files
file.copy(input$upload$datapath,)
how I can use this app to upload the file to azure cloud container ??? I already downladed azurestor package .
Thanks in advance

You can use AzureStor from within your server app like any other R package. See the AzureStor vignette for some syntax examples.

To authenticate, you have a few options depending on what type of storage you're using:

  • Use the account key. Not recommended, as it provides full access to everything in the account.
  • Use a SAS. Better, but you'll have to remember to renew it when it expires.
  • Authenticate with an AAD token, using client credentials.
  • Authenticate with an AAD token, with user credentials (getting the user to login).

The latter 2 options would involve obtaining a token with the AzureAuth package. The client credentials flow can be done entirely within the server, so is probably a good starting point. The last option would require splitting the flow between the server and UI; see the AzureAuth Shiny vignette for some example code.

Thank you so much for your help
actually what I have is Rstudio server on azure cloud ,now I want to write shiny code on that server to save data on the cloud storage , so I'm trying to download Azurestor package it gave me this messeage error
"ERROR: dependency ‘xml2’ is not available for package ‘AzureStor’

  • removing ‘/home/demo/R/x86_64-pc-linux-gnu-library/3.6/AzureStor’
    Warning in install.packages :
    installation of package ‘AzureStor’ had non-zero exit status"
    I think the problem that I don't have xml2 package when I'm trying to download it , it gave the following error message
    "ERROR: configuration failed for package ‘xml2’
  • removing ‘/home/demo/R/x86_64-pc-linux-gnu-library/3.6/xml2’
    Warning in install.packages :
    installation of package ‘xml2’ had non-zero exit status"
    thanks in advance

Storage uses XML, hence AzureStor relies on the xml2 package. I can't help you with that error; it looks like a generic failure-to-install. Try asking another question about why xml2 can't be found.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.