-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for COPY TO/FROM Azure Blob Storage #55
base: main
Are you sure you want to change the base?
Conversation
fe03728
to
4dc228c
Compare
b9114cf
to
2feb683
Compare
afb3c71
to
2a3061f
Compare
2a3061f
to
0a3281f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 92.11% 92.35% +0.23%
==========================================
Files 71 71
Lines 9109 9434 +325
==========================================
+ Hits 8391 8713 +322
- Misses 718 721 +3 ☔ View full report in Codecov by Sentry. |
0a3281f
to
80e449f
Compare
} | ||
|
||
// ~/.azure/config | ||
let azure_config_file_path = std::env::var("AZURE_CONFIG_FILE").unwrap_or( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use from_env()?
it's a bit surprising that we're inflicting the environment variables on ourselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some of the tests, we need to make sure only a subset of the all env vars should exist to verify that different auth methods or scenarios work.
Supports following Azure Blob uri forms: - `az://{container}/key` - `azure://{container}/key` - `https://{account}.blob.core.windows.net/{container}` **Configuration** The simplest way to configure object storage is by creating the standard [`~/.azure/config`](https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest) file: ```bash $ cat ~/.azure/config [storage] account = devstoreaccount1 key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== ``` Alternatively, you can use the following environment variables when starting postgres to configure the Azure Blob Storage client: - `AZURE_STORAGE_ACCOUNT`: the storage account name of the Azure Blob - `AZURE_STORAGE_KEY`: the storage key of the Azure Blob - `AZURE_STORAGE_SAS_TOKEN`: the storage SAS token for the Azure Blob - `AZURE_CONFIG_FILE`: an alternative location for the config file **Bonus** Additionally, PR supports following S3 uri forms: - `s3://{bucket}/key` - `s3a://{bucket}/key` - `https://s3.amazonaws.com/{bucket}/key` - `https://{bucket}.s3.amazonaws.com/key` Closes #50
80e449f
to
8553677
Compare
Supports following Azure Blob uri forms:
az://{container}/key
azure://{container}/key
https://{account}.blob.core.windows.net/{container}
Configuration
The simplest way to configure object storage is by creating the standard
~/.azure/config
file:$ cat ~/.azure/config [storage] account = devstoreaccount1 key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
Alternatively, you can use the following environment variables when starting postgres to configure the Azure Blob Storage client:
AZURE_STORAGE_ACCOUNT
: the storage account name of the Azure BlobAZURE_STORAGE_KEY
: the storage key of the Azure BlobAZURE_STORAGE_SAS_TOKEN
: the storage SAS token for the Azure BlobAZURE_CONFIG_FILE
: an alternative location for the config fileBonus
Additionally, PR supports following S3 uri forms:
s3://{bucket}/key
s3a://{bucket}/key
https://s3.amazonaws.com/{bucket}/key
https://{bucket}.s3.amazonaws.com/key
Closes #50