o
    +if                     @   s0   d dl Z d dlZeeZdddZdd ZdS )    Nc                 C   s2   t jdddd }|r|S | rt| S d S )NREGION_NAME  )osenvirongetreplacelower_detect_region_of_azure_vm)http_clientregion r   D/var/www/html/corbot_env/lib/python3.10/site-packages/msal/region.py_detect_region   s   r   c                 C   sR   d}t d| z| j|ddid}W n   t d| Y d S |j S )Nz\http://169.254.169.254/metadata/instance/compute/location?format=text&api-version=2021-01-01a7  Connecting to IMDS {}. It may take a while if you are running outside of Azure. You should consider opting in/out region behavior on-demand, by loading a boolean flag "is_deployed_in_azure" from your per-deployment config and then do "app = ConfidentialClientApplication(..., azure_region=is_deployed_in_azure)"Metadatatrue)headersz5IMDS {} unavailable. Perhaps not running in Azure VM?)loggerinfoformatr   textstrip)r   urlrespr   r   r   r
      s   
r
   )N)r   logging	getLogger__name__r   r   r
   r   r   r   r   <module>   s
    

	