farmer
farmer copied to clipboard
Ability to upload files/blobs to storage accounts
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"]
}
Sounds like a good idea to me. Can the Azure CLI do this? If so, great - we can just piggy back on that.
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?
I really wouldn't want to add another dependency to Farmer (i.e. AzCopy) if we can avoid it :-/