Here is the error in full:
SharedTokenCacheCredential.get_token failed: Azure Active Directory error '(invalid_grant) AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access '---'.
[2021-11-03T09:46:40.373Z] Trace ID: ---
[2021-11-03T09:46:40.378Z] Correlation ID: ---
[2021-11-03T09:46:40.383Z] Timestamp: 2021-11-03 09:46:40Z'
[2021-11-03T09:46:40.388Z] DefaultAzureCredential.get_token failed: SharedTokenCacheCredential raised unexpected error "Azure Active Directory error '(invalid_grant) AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access '---'.
[2021-11-03T09:46:40.393Z] Trace ID: ---
[2021-11-03T09:46:40.398Z] Correlation ID: ---
[2021-11-03T09:46:40.402Z] Timestamp: 2021-11-03 09:46:40Z'"
[2021-11-03T09:46:40.408Z] DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no managed identity endpoint found.
SharedTokenCacheCredential: Azure Active Directory error '(invalid_grant) AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access '---'.
[2021-11-03T09:46:40.416Z] Trace ID: ---
[2021-11-03T09:46:40.420Z] Correlation ID: ----
[2021-11-03T09:46:40.424Z] Timestamp: 2021-11-03 09:46:40Z'
[2021-11-03T09:46:40.584Z] Executed 'Functions.Test' (Failed, Id=---, Duration=14683ms)
[2021-11-03T09:46:40.590Z] System.Private.CoreLib: Exception while executing function: Functions.Test. System.Private.CoreLib: Result: Failure
Exception: ClientAuthenticationError: DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no managed identity endpoint found.
SharedTokenCacheCredential: Azure Active Directory error '(invalid_grant) AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access '---'.
[2021-11-03T09:46:40.600Z] Trace ID: ---
[2021-11-03T09:46:40.605Z] Correlation ID: ---
[2021-11-03T09:46:40.611Z] Timestamp: 2021-11-03 09:46:40Z'
Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.6/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 405, in _handle__invocation_request
invocation_id, fi_context, fi.func, args)
File "C:\Users\thomas.duvivier\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.6/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 612, in _run_sync_func
func)(params)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.6/WINDOWS/X64\azure_functions_worker\extension.py", line 215, in _raw_invocation_wrapper
result = function(**args)
File "C:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__\Test__init__.py", line 24, in main
password = client.get_secret("pwd-admin").value
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\tracing\decorator.py", line 83, in wrapper_use_tracer
return func(*args, **kwargs)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\keyvault\secrets_client.py", line 72, in get_secret
**kwargs
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\keyvault\secrets_generated_operations_mixin.py", line 1475, in get_secret
return mixin_instance.get_secret(vault_base_url, secret_name, secret_version, **kwargs)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\keyvault\secrets_generated\v7_1\operations_key_vault_client_operations.py", line 276, in get_secret
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline_base.py", line 211, in run
return first_node.send(pipeline_request) # type: ignore
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
[Previous line repeated 1 more times]
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline\policies_redirect.py", line 158, in send
response = self.next.send(request)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\core\pipeline\policies_retry.py", line 445, in send
response = self.next.send(request)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\keyvault\secrets_shared\challenge_auth_policy.py", line 111, in send
self._handle_challenge(request, challenge)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\keyvault\secrets_shared\challenge_auth_policy.py", line 137, in _handle_challenge
self._token = self._credential.get_token(scope)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\identity_credentials\default.py", line 140, in get_token
return super(DefaultAzureCredential, self).get_token(*scopes, **kwargs)
File "c:\Users\thomas.duvivier\source\repos\Intelligent Sourcing\ETL\ETL_AFA__app__.venv\lib\site-packages\azure\identity_credentials\chained.py", line 90, in get_token
raise ClientAuthenticationError(message=message)