From 118d6179c1ff977e1de36ded92984404f861ebff Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Thu, 5 Feb 2026 20:16:27 -0700 Subject: [PATCH 1/2] Add ApplicationId to AzureFileSystem for SDK calls --- cpp/src/arrow/filesystem/azurefs.cc | 30 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index e47be63a4c0..3b0c99ec993 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -38,6 +38,7 @@ #include #include "arrow/buffer.h" +#include "arrow/config.h" #include "arrow/filesystem/path_util.h" #include "arrow/filesystem/util_internal.h" #include "arrow/io/util_internal.h" @@ -386,9 +387,13 @@ Result> AzureOptions::MakeBlobServiceC return Status::Invalid("AzureOptions::blob_storage_scheme must be http or https: ", blob_storage_scheme); } + Blobs::BlobClientOptions client_options; + client_options.Telemetry.ApplicationId = + "azpartner-arrow/" + GetBuildInfo().version_string; switch (credential_kind_) { case CredentialKind::kAnonymous: - return std::make_unique(AccountBlobUrl(account_name)); + return std::make_unique(AccountBlobUrl(account_name), + client_options); case CredentialKind::kDefault: if (!token_credential_) { token_credential_ = std::make_shared(); @@ -399,14 +404,14 @@ Result> AzureOptions::MakeBlobServiceC case CredentialKind::kCLI: case CredentialKind::kWorkloadIdentity: case CredentialKind::kEnvironment: - return std::make_unique(AccountBlobUrl(account_name), - token_credential_); + return std::make_unique( + AccountBlobUrl(account_name), token_credential_, client_options); case CredentialKind::kStorageSharedKey: - return std::make_unique(AccountBlobUrl(account_name), - storage_shared_key_credential_); + return std::make_unique( + AccountBlobUrl(account_name), storage_shared_key_credential_, client_options); case CredentialKind::kSASToken: - return std::make_unique(AccountBlobUrl(account_name) + - sas_token_); + return std::make_unique( + AccountBlobUrl(account_name) + sas_token_, client_options); } return Status::Invalid("AzureOptions doesn't contain a valid auth configuration"); } @@ -420,10 +425,13 @@ AzureOptions::MakeDataLakeServiceClient() const { return Status::Invalid("AzureOptions::dfs_storage_scheme must be http or https: ", dfs_storage_scheme); } + DataLake::DataLakeClientOptions client_options; + client_options.Telemetry.ApplicationId = + "azpartner-arrow/" + GetBuildInfo().version_string; switch (credential_kind_) { case CredentialKind::kAnonymous: return std::make_unique( - AccountDfsUrl(account_name)); + AccountDfsUrl(account_name), client_options); case CredentialKind::kDefault: if (!token_credential_) { token_credential_ = std::make_shared(); @@ -435,13 +443,13 @@ AzureOptions::MakeDataLakeServiceClient() const { case CredentialKind::kWorkloadIdentity: case CredentialKind::kEnvironment: return std::make_unique( - AccountDfsUrl(account_name), token_credential_); + AccountDfsUrl(account_name), token_credential_, client_options); case CredentialKind::kStorageSharedKey: return std::make_unique( - AccountDfsUrl(account_name), storage_shared_key_credential_); + AccountDfsUrl(account_name), storage_shared_key_credential_, client_options); case CredentialKind::kSASToken: return std::make_unique( - AccountBlobUrl(account_name) + sas_token_); + AccountBlobUrl(account_name) + sas_token_, client_options); } return Status::Invalid("AzureOptions doesn't contain a valid auth configuration"); } From 0cf4415e57710e73dcecc3441b2bb38d378d3af8 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Tue, 17 Feb 2026 09:16:46 -0700 Subject: [PATCH 2/2] Consolidate ApplicationId construction to a helper --- cpp/src/arrow/filesystem/azurefs.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 3b0c99ec993..7aa3e58c1d3 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -304,6 +304,10 @@ Status ExceptionToStatus(const Azure::Core::RequestFailedException& exception, return Status::IOError(std::forward(prefix_args)..., " Azure Error: [", exception.ErrorCode, "] ", exception.what()); } + +std::string BuildApplicationId() { + return "azpartner-arrow/" + GetBuildInfo().version_string; +} } // namespace std::string AzureOptions::AccountBlobUrl(const std::string& account_name) const { @@ -388,8 +392,7 @@ Result> AzureOptions::MakeBlobServiceC blob_storage_scheme); } Blobs::BlobClientOptions client_options; - client_options.Telemetry.ApplicationId = - "azpartner-arrow/" + GetBuildInfo().version_string; + client_options.Telemetry.ApplicationId = BuildApplicationId(); switch (credential_kind_) { case CredentialKind::kAnonymous: return std::make_unique(AccountBlobUrl(account_name), @@ -426,8 +429,7 @@ AzureOptions::MakeDataLakeServiceClient() const { dfs_storage_scheme); } DataLake::DataLakeClientOptions client_options; - client_options.Telemetry.ApplicationId = - "azpartner-arrow/" + GetBuildInfo().version_string; + client_options.Telemetry.ApplicationId = BuildApplicationId(); switch (credential_kind_) { case CredentialKind::kAnonymous: return std::make_unique(