@@ -109,7 +109,7 @@ class ClientApplication(object):
109109 GET_ACCOUNTS_ID = "902"
110110 REMOVE_ACCOUNT_ID = "903"
111111
112- ATTEMPT_REGION_DISCOVERY = "TryAutoDetect"
112+ ATTEMPT_REGION_DISCOVERY = True # "TryAutoDetect"
113113
114114 def __init__ (
115115 self , client_id ,
@@ -242,7 +242,8 @@ def __init__(
242242 (However MSAL Python does not support managed identity,
243243 so this one does not apply.)
244244
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>`_.
246247
247248 4. An app which already onboard to the region's allow-list.
248249
@@ -258,10 +259,22 @@ def __init__(
258259
259260 An app running inside Azure Functions and Azure VM can use a special keyword
260261 ``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.
265278 """
266279 self .client_id = client_id
267280 self .client_credential = client_credential
0 commit comments