Skip to content

Commit f15e98e

Browse files
authored
Revert "allow MI endpoint changing through environment variable (#754)"
This reverts commit 7db6c2c.
1 parent 7db6c2c commit f15e98e

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

msal/managed_identity.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,6 @@ class ManagedIdentityClient(object):
134134
135135
It also provides token cache support.
136136
137-
.. admonition:: Special case when your local development wants to use a managed identity on Azure VM.
138-
139-
By setting the environment variable ``MSAL_MANAGED_IDENTITY_ENDPOINT``
140-
you override the default identity URL used in MSAL's Azure VM managed identity
141-
code path.
142-
143-
This is useful during local development where it may be desirable to
144-
utilise the credentials assigned to an actual VM instance via SSH tunnelling.
145-
146-
For example, if you create your SSH tunnel this way (assuming your VM is on ``192.0.2.1``)::
147-
148-
ssh -L 8000:169.254.169.254:80 192.0.2.1
149-
150-
Then your code could run locally using::
151-
152-
env MSAL_MANAGED_IDENTITY_ENDPOINT=http://localhost:8000/metadata/identity/oauth2/token python your_script.py
153-
154137
.. note::
155138
156139
Cloud Shell support is NOT implemented in this class.
@@ -463,7 +446,7 @@ def _obtain_token_on_azure_vm(http_client, managed_identity, resource):
463446
}
464447
_adjust_param(params, managed_identity)
465448
resp = http_client.get(
466-
os.getenv('MSAL_MANAGED_IDENTITY_ENDPOINT', 'http://169.254.169.254/metadata/identity/oauth2/token'),
449+
"http://169.254.169.254/metadata/identity/oauth2/token",
467450
params=params,
468451
headers={"Metadata": "true"},
469452
)

0 commit comments

Comments
 (0)