Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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,14 @@ 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 \
--azure-endpoint ENDPOINT_URL
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 +103,7 @@ 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=]

{}
--plugin-dir <DIR> Location of plugins [env: INFLUXDB3_PLUGIN_DIR=]
Expand Down
25 changes: 22 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,20 @@ 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>,

/// 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 +692,7 @@ 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(),
bucket: Default::default(),
database_directory,
google_service_account: Default::default(),
Expand Down Expand Up @@ -843,18 +858,22 @@ 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);
}
if let Some(endpoint) = &self.azure_endpoint {
builder = builder.with_allow_http(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @peterbarnett03 on this, the user should be able to pass a flag that sets the allow http flag.

builder = builder.with_endpoint(endpoint.to_string());
}

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