ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: Credential lifetime exceeds the max value allowed as per assigned policy '538f1913-366a-440a-95a0-e195cb55b282'.
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 52, in _send
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 1010, in send_raw_request
azure.cli.core.azclierror.HTTPError: Bad Request({"error":{"code":"CredentialInvalidLifetimeAsPerAppPolicy","message":"Credential lifetime exceeds the max value allowed as per assigned policy '538f1913-366a-440a-95a0-e195cb55b282'.","details":[{"code":"InvalidKeyEndDate","message":"Credential lifetime exceeds the max value allowed as per assigned policy '538f1913-366a-440a-95a0-e195cb55b282'.","target":"EndDate"}],"innerError":{"date":"2024-03-05T04:13:31","request-id":"d07b15e7-19ea-4d7c-b94f-d4926b208f04","client-request-id":"d07b15e7-19ea-4d7c-b94f-d4926b208f04"}}})
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/aro/custom.py", line 79, in aro_create
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/aro/_aad.py", line 27, in create_application
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/aro/_aad.py", line 56, in add_password
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 131, in application_add_password
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 55, in _send
azure.cli.command_modules.role._msgrpah._graph_client.GraphError: Credential lifetime exceeds the max value allowed as per assigned policy '538f1913-366a-440a-95a0-e195cb55b282'.
The command should success.
azure-cli 2.58.0
core 2.58.0
telemetry 1.1.0
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location 'D:\tool\azure-cli\python.exe'
Extensions directory 'C:\Users\jiasli\.azure\cliextensions'
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]
Describe the bug
az aro createprovides an empty dict{}as the body when calling application: addPassword REST API (#22549):azure-cli/src/azure-cli/azure/cli/command_modules/aro/_aad.py
Lines 55 to 57 in 8e7c613
According to https://learn.microsoft.com/en-us/graph/api/application-addpassword,
This triggers policy
538f1913-366a-440a-95a0-e195cb55b282in Microsoft tenant 72f988bf-86f1-41af-91ab-2d7cd011db47 and causes an error.Related command
az aro createErrors
Issue script & Debug output
N/A
Expected behavior
The command should success.
Environment Summary
Additional context
IcM 479021709