MCPcopy Create free account
hub / github.com/apache/arrow / MakeBlobServiceClient

Method MakeBlobServiceClient

cpp/src/arrow/filesystem/azurefs.cc:414–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414Result<std::unique_ptr<Blobs::BlobServiceClient>> AzureOptions::MakeBlobServiceClient()
415 const {
416 if (account_name.empty()) {
417 return Status::Invalid("AzureOptions doesn't contain a valid account name");
418 }
419 if (!(blob_storage_scheme == "http" || blob_storage_scheme == "https")) {
420 return Status::Invalid("AzureOptions::blob_storage_scheme must be http or https: ",
421 blob_storage_scheme);
422 }
423 Blobs::BlobClientOptions client_options;
424 client_options.Telemetry.ApplicationId = BuildApplicationId();
425 switch (credential_kind_) {
426 case CredentialKind::kAnonymous:
427 return std::make_unique<Blobs::BlobServiceClient>(AccountBlobUrl(account_name),
428 client_options);
429 case CredentialKind::kDefault:
430 if (!token_credential_) {
431 token_credential_ = std::make_shared<Azure::Identity::DefaultAzureCredential>();
432 }
433 [[fallthrough]];
434 case CredentialKind::kClientSecret:
435 case CredentialKind::kManagedIdentity:
436 case CredentialKind::kCLI:
437 case CredentialKind::kWorkloadIdentity:
438 case CredentialKind::kEnvironment:
439 return std::make_unique<Blobs::BlobServiceClient>(
440 AccountBlobUrl(account_name), token_credential_, client_options);
441 case CredentialKind::kStorageSharedKey:
442 return std::make_unique<Blobs::BlobServiceClient>(
443 AccountBlobUrl(account_name), storage_shared_key_credential_, client_options);
444 case CredentialKind::kSASToken:
445 return std::make_unique<Blobs::BlobServiceClient>(
446 AccountBlobUrl(account_name) + sas_token_, client_options);
447 }
448 return Status::Invalid("AzureOptions doesn't contain a valid auth configuration");
449}
450
451Result<std::unique_ptr<DataLake::DataLakeServiceClient>>
452AzureOptions::MakeDataLakeServiceClient() const {

Callers 2

MakeMethod · 0.80
TestFromUriAbfsMethod · 0.80

Calls 3

BuildApplicationIdFunction · 0.85
InvalidFunction · 0.50
emptyMethod · 0.45

Tested by 1

TestFromUriAbfsMethod · 0.64