@@ -109,7 +109,7 @@ class ClientApplication(object):
109
109
GET_ACCOUNTS_ID = "902"
110
110
REMOVE_ACCOUNT_ID = "903"
111
111
112
- ATTEMPT_REGION_DISCOVERY = "TryAutoDetect"
112
+ ATTEMPT_REGION_DISCOVERY = True # "TryAutoDetect"
113
113
114
114
def __init__ (
115
115
self , client_id ,
@@ -242,7 +242,8 @@ def __init__(
242
242
(However MSAL Python does not support managed identity,
243
243
so this one does not apply.)
244
244
245
- 3. An app authenticated by Subject Name/Issuer (SNI).
245
+ 3. An app authenticated by
246
+ `Subject Name/Issuer (SNI) <https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/60>`_.
246
247
247
248
4. An app which already onboard to the region's allow-list.
248
249
@@ -258,10 +259,22 @@ def __init__(
258
259
259
260
An app running inside Azure Functions and Azure VM can use a special keyword
260
261
``ClientApplication.ATTEMPT_REGION_DISCOVERY`` to auto-detect region.
261
- (Attempting this on a non-VM could hang indefinitely.
262
- Make sure you configure a short timeout,
263
- or provide a custom http_client which has a short timeout.
264
- That way, the latency would be under your control.)
262
+
263
+ .. note::
264
+
265
+ Setting ``azure_region`` to non-``None`` for an app running
266
+ outside of Azure Function/VM could hang indefinitely.
267
+
268
+ You should consider opting in/out region behavior on-demand,
269
+ by loading ``azure_region=None`` or ``azure_region="westus"``
270
+ or ``azure_region=True`` (which means opt-in and auto-detect)
271
+ from your per-deployment configuration, and then do
272
+ ``app = ConfidentialClientApplication(..., azure_region=azure_region)``.
273
+
274
+ Alternatively, you can configure a short timeout,
275
+ or provide a custom http_client which has a short timeout.
276
+ That way, the latency would be under your control,
277
+ but still less performant than opting out of region feature.
265
278
"""
266
279
self .client_id = client_id
267
280
self .client_credential = client_credential
0 commit comments