Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions influxdb3/src/help/serve_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Examples:
2. influxdb3 create token --admin
3. Write and query with unhashed token

# Run with Azure Blob Storage:
1. influxdb3 serve --node-id node1 --object-store azure --bucket influxdb-data \
--azure-storage-account STORAGE_ACCOUNT \
--azure-storage-access-key STORAGE_ACCESS_KEY
2. influxdb3 create token --admin
3. Write and query with unhashed token

{} [OPTIONS] --node-id <NODE_IDENTIFIER_PREFIX> --object-store <OBJECT_STORE_TYPE>

{}
Expand Down Expand Up @@ -95,6 +102,8 @@ Examples:
{}
--azure-storage-account <ACCT> Azure storage account name [env: AZURE_STORAGE_ACCOUNT=]
--azure-storage-access-key <KEY> Azure storage access key [env: AZURE_STORAGE_ACCESS_KEY=]
--azure-endpoint <ENDPOINT> Azure blob storage endpoint [env: AZURE_ENDPOINT=]
--azure-allow-http Allow unencrypted HTTP to Azure [env: AZURE_ALLOW_HTTP=]

{}
--plugin-dir <DIR> Location of plugins [env: INFLUXDB3_PLUGIN_DIR=]
Expand Down
37 changes: 34 additions & 3 deletions influxdb3_clap_blocks/src/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,29 @@ macro_rules! object_store_config_inner {
)]
pub azure_storage_access_key: Option<String>,

/// When using Microsoft Azure blob storage, you can set a custom endpoint.
///
/// Useful for local development with Azure storage emulators like Azurite.
///
/// Must also set `--object-store=azure`, `--bucket`, `--azure-storage-account`,
/// and `--azure-storage-access-key`.
#[clap(
id = gen_name!($prefix, "azure-endpoint"),
long = gen_name!($prefix, "azure-endpoint"),
env = gen_env!($prefix, "AZURE_ENDPOINT"),
action
)]
pub azure_endpoint: Option<Endpoint>,

/// Allow unencrypted HTTP connection to Azure.
#[clap(
id = gen_name!($prefix, "azure-allow-http"),
long = gen_name!($prefix, "azure-allow-http"),
env = gen_env!($prefix, "AZURE_ALLOW_HTTP"),
action
)]
pub azure_allow_http: bool,

/// When using a network-based object store, limit the number of connection to this value.
#[clap(
id = gen_name!($prefix, "object-store-connection-limit"),
Expand Down Expand Up @@ -678,6 +701,8 @@ macro_rules! object_store_config_inner {
aws_credentials_file: Default::default(),
azure_storage_access_key: Default::default(),
azure_storage_account: Default::default(),
azure_endpoint: Default::default(),
azure_allow_http: Default::default(),
bucket: Default::default(),
database_directory,
google_service_account: Default::default(),
Expand Down Expand Up @@ -843,18 +868,24 @@ macro_rules! object_store_config_inner {
use object_store::limit::LimitStore;

info!(bucket=?self.bucket, account=?self.azure_storage_account,
object_store_type="Azure", "Object Store");
endpoint=?self.azure_endpoint, object_store_type="Azure", "Object Store");

let mut builder = MicrosoftAzureBuilder::new().with_client_options(self.client_options());

if let Some(bucket) = &self.bucket {
builder = builder.with_container_name(bucket);
}
if let Some(account) = &self.azure_storage_account {
builder = builder.with_account(account)
builder = builder.with_account(account);
}
if let Some(key) = &self.azure_storage_access_key {
builder = builder.with_access_key(key)
builder = builder.with_access_key(key);
}

builder = builder.with_allow_http(self.azure_allow_http);

if let Some(endpoint) = &self.azure_endpoint {
builder = builder.with_endpoint(endpoint.to_string());
}

Ok(Arc::new(LimitStore::new(
Expand Down