Skip to content

Commit 627e6eb

Browse files
authored
Revert defaulting use_azure_cli to True (#325)
1 parent 0f5b7fd commit 627e6eb

File tree

4 files changed

+2
-21
lines changed

4 files changed

+2
-21
lines changed

docs/authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Note that many authentication variants are already supported natively.
4444
- Workload identity OAuth2, using a `client_id`, `tenant_id`, and `federated_token_file` passed in by the user
4545
- OAuth2, using a `client_id`, `client_secret`, and `tenant_id` passed in by the user
4646
- A SAS key passed in by the user.
47-
- Azure CLI. (If you want to ensure the IMDS authentication is used below, pass [`use_azure_cli=False`][obstore.store.AzureConfig.use_azure_cli] to `AzureStore`.)
47+
- Azure CLI. (When constructing `AzureStore` you must set [`use_azure_cli`][obstore.store.AzureConfig.use_azure_cli] to `True`, either by passing `use_azure_cli=True` or by setting the `AZURE_USE_AZURE_CLI` environment variable to `"TRUE"`).
4848
- IMDS Managed Identity Provider.
4949

5050
(A transcription of [this underlying code](https://github.com/apache/arrow-rs/blob/a00f9f43a0530b9255e4f9940e43121deedb0cc7/object_store/src/azure/builder.rs#L942-L1019)).

docs/dev/overridden-defaults.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,4 @@ In general, we wish to follow the upstream `object_store` as closely as possible
44

55
However, there are occasionally places where we want to diverge from the upstream decision making, and we document those here.
66

7-
## Azure CLI
8-
9-
We always check for Azure CLI authentication as a fallback.
10-
11-
If we stuck with the upstream `object_store` default, you would need to pass `use_azure_cli=True` to check for Azure CLI credentials.
12-
13-
The Azure CLI is the [second-to-last Azure authentication method checked](https://github.com/apache/arrow-rs/blob/9c92a50b6d190ca9d0c74c3ccc69e348393d9246/object_store/src/azure/builder.rs#L1015-L1016) checked. So this only changes the default behavior for people relying on instance authentication. For those people, they can still pass `use_azure_cli=False`.
14-
15-
See upstream discussion [here](https://github.com/apache/arrow-rs/issues/7204).
7+
(Currently none).

obstore/python/obstore/store/_azure.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ class AzureConfig(TypedDict, total=False):
150150
use_azure_cli: bool
151151
"""Set if the Azure Cli should be used for acquiring access token.
152152
153-
Defaults to `True` (as a fallback).
154-
155153
<https://learn.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-get-access-token>.
156154
157155
**Environment variable**: `AZURE_USE_AZURE_CLI`.

pyo3-object_store/src/azure/store.rs

-9
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ impl PyAzureStore {
9292
kwargs: Option<PyAzureConfig>,
9393
) -> PyObjectStoreResult<Self> {
9494
let mut builder = MicrosoftAzureBuilder::from_env();
95-
builder = PyAzureConfig::OVERRIDDEN_DEFAULTS().apply_config(builder);
9695
let mut config = config.unwrap_or_default();
9796
if let Some(container) = container.clone() {
9897
// Note: we apply the bucket to the config, not directly to the builder, so they stay
@@ -261,14 +260,6 @@ impl PyAzureConfig {
261260
Self(HashMap::new())
262261
}
263262

264-
/// Default values that we opt into that differ from the upstream object_store defaults
265-
#[allow(non_snake_case)]
266-
fn OVERRIDDEN_DEFAULTS() -> Self {
267-
let mut map = HashMap::with_capacity(1);
268-
map.insert(AzureConfigKey::UseAzureCli.into(), true.into());
269-
Self(map)
270-
}
271-
272263
fn apply_config(self, mut builder: MicrosoftAzureBuilder) -> MicrosoftAzureBuilder {
273264
for (key, value) in self.0.into_iter() {
274265
builder = builder.with_config(key.0, value.0);

0 commit comments

Comments
 (0)