diff --git a/influxdb3/src/help/serve_all.txt b/influxdb3/src/help/serve_all.txt index ae59cc7cc6e..a93ae311c0e 100644 --- a/influxdb3/src/help/serve_all.txt +++ b/influxdb3/src/help/serve_all.txt @@ -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 --object-store {} @@ -95,6 +102,8 @@ Examples: {} --azure-storage-account Azure storage account name [env: AZURE_STORAGE_ACCOUNT=] --azure-storage-access-key Azure storage access key [env: AZURE_STORAGE_ACCESS_KEY=] + --azure-endpoint Azure blob storage endpoint [env: AZURE_ENDPOINT=] + --azure-allow-http Allow unencrypted HTTP to Azure [env: AZURE_ALLOW_HTTP=] {} --plugin-dir Location of plugins [env: INFLUXDB3_PLUGIN_DIR=] diff --git a/influxdb3_clap_blocks/src/object_store.rs b/influxdb3_clap_blocks/src/object_store.rs index 7f4e518aa8a..7caaf99bcce 100644 --- a/influxdb3_clap_blocks/src/object_store.rs +++ b/influxdb3_clap_blocks/src/object_store.rs @@ -574,6 +574,29 @@ macro_rules! object_store_config_inner { )] pub azure_storage_access_key: Option, + /// 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, + + /// 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"), @@ -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(), @@ -843,7 +868,7 @@ 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()); @@ -851,10 +876,16 @@ macro_rules! object_store_config_inner { 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(