thelastpickle / cassandra-medusa

Apache Cassandra Backup and Restore Tool
Apache License 2.0
266 stars 143 forks source link

Azure Storage Support for different Cloud Contexts (e.g. AzureUSGovernment) #680

Closed ernstae closed 1 year ago

ernstae commented 1 year ago

Project board link

Overview

Azure Storage looks to be configured for only Commercial cloud on line https://github.com/thelastpickle/cassandra-medusa/blob/master/medusa/storage/azure_storage.py#L58 windows.net

In AzureUSGovernment cloud, the URLs end with usgovcloudapi.net.

The Azure SDK allows for the appropriate cloud context to be set, and with the original azure-cli implementation of storage that was possible < 0.16.0.

The Ask

The connection string for Azure Blob Storage should support a conditional so that it can either be the current blob.core.windows.net for "Azure" cloud or blob.core.usgovcloudapi.net for "AzureUSGovernment" cloud.
This should be configurable in the medusa configuration file, rather than hard-coded in the above-referenced file.

I'd code this up and offer a patch, but I don't immediately have the time, and hoped that the maintainers and existing contributors could tackle that faster than I can

Additional Azure References

https://learn.microsoft.com/en-us/azure/azure-government/compare-azure-government-global-azure

Screen Shot 2023-11-07 at 3 18 07 PM

rzvoncek commented 1 year ago

Hello @ernstae! Thanks for raising this. The task seems fairly straightforward, so I might be able to squeeze it into our current iteration.

rzvoncek commented 1 year ago

Hi @ernstae , perhaps you've noticed already, but I now have #685 out. I debated how precisely to do this. In the end I decided to use the host field in the config/storage section to specify the domain that is different for the gov cloud. We don't have access to the US GOV Azure region, so I can only do unit tests and ask you if:

ernstae commented 10 months ago

Hi @ernstae , perhaps you've noticed already, but I now have #685 out. I debated how precisely to do this. In the end I decided to use the host field in the config/storage section to specify the domain that is different for the gov cloud. We don't have access to the US GOV Azure region, so I can only do unit tests and ask you if:

  • This sort of solution works for you.
  • Give it a try out and let us know if it works.

Sorry for the very delayed response (between time off, holidays and health issues). I'll see if I can do a test of this in the not-so-distant future. Thank you for your contribution and grabbing it so quickly, @rzvoncek