farmer icon indicating copy to clipboard operation
farmer copied to clipboard

Ability to upload files/blobs to storage accounts

Open TheRSP opened this issue 2 years ago • 3 comments

I have come across a use-case recently where I'd like to be able to upload a number of blobs to a storage account as part of a deployment through Farmer. I tried doing this with an object expression but couldn't find a way to have a PostDeploy task with out any ARM model at the same time. As such, I propose this be added to the storage account itself.

I propose the following overloads for uploading blobs to a storage account as a post-deploy task.

storageAccount{
  name "mystorage"
  add_blob_container "myblobs"

  // upload a single blob with a given name
+  upload_blob "myblobs" "blob1" "/path/to/my/blobs/1.blob"

  // upload a directory to a blob container at a given root path
+  upload_blobs "myblobs", "dest/", "/path/to/my/blobs"

  // upload specific files to a blob container at a given root path
+  upload_blobs "myblobs", "dest/", ["/path/to/my/blobs/1.blob"; "/path/to/my/blobs/2.blob"]

  // upload specific files to a blob container at a given root path with given names
+  upload_blobs "myblobs", "dest/" ["blob1","/path/to/my/blobs/1.blob"; "blob2","/path/to/my/blobs/2.blob"]
}

TheRSP avatar Nov 05 '21 14:11 TheRSP

Sounds like a good idea to me. Can the Azure CLI do this? If so, great - we can just piggy back on that.

isaacabraham avatar Jan 23 '22 00:01 isaacabraham

I think this would need to be done with azcopy, which is independent of the auzre cli. How would this be handled if running farmer with Powershell?

cmarshall10450 avatar Sep 29 '22 21:09 cmarshall10450

I really wouldn't want to add another dependency to Farmer (i.e. AzCopy) if we can avoid it :-/

isaacabraham avatar Oct 03 '22 09:10 isaacabraham