rsm-hcd / AndcultureCode.Cli

and-cli command-line tool to manage the development of software applications
https://andculture.com
Apache License 2.0
14 stars 15 forks source link

Need ability to copy / overwrite Azure storage account contents from one container to another #148

Closed KevinBusch closed 3 years ago

KevinBusch commented 3 years ago

We need the ability copy / overwrite assets from one Azure storage account container to another container of the same Azure storage account. We need this as a part of a bigger process to restore one environment to another when needing to pull a production --> staging --> testing. Need to determine which command argument this belongs under. Not sure if deploy makes sense or if we should expand copy to include cloud assets or maybe it makes sense to add a new argument. Any and all thoughts are welcome.

CC: @brandongregoryscott @wintondeshong @Stefanie899

brandongregoryscott commented 3 years ago

Hmm, I'd hesitate to tack it on to copy at the moment because there's likely some authentication/configuration needed that would clutter up that command and in most cases won't be applicable. I agree, though, it doesn't seem like a standard deploy command, either. For now, I would probably name it azure-copy and build out the functionality there first.

Thinking ahead, we may have the need to add other cloud-based utility commands that are necessarily 'deployment' related, in which case it'll probably make sense to make azure a parent command and then register subcommands that contain more specific operations, instead of building out an azure-x command or adding a bunch of flags for each specific operation.

(For example, our github command is probably going to go the same route - it will become a parent command for the purpose of holding subcommands for topics, repos, issues, etc. since it is getting larger and operating w/ several different concerns)

I mentioned it in our Slack conversation, but if the existing and-cli-deploy-azure-storage.ts command can be used in some sequence/combination of flags to fit this purpose, let's try to use that first unless it ends up being overly complex or clunky.

KevinBusch commented 3 years ago

After talking to @brandongregoryscott , we decided to create a new AzureStorage module and, at a bare minimum, add functionality to it to allow us to use the remove capability (see https://docs.microsoft.com/en-us/cli/azure/storage?view=azure-cli-latest#az_storage_remove). The current and-cli-deploy-azure-storage command can then be updated to optional (through another optional argument) clear the existing destination's assets recursively.