服务主体到期查询命令不起作用

问题描述 投票:0回答:1

寻找一种自动方法来提前识别服务主体列表的到期日期,并在到期日期在跨度的 60 天内通知相关团队。我在 azuredevops 管道中尝试了以下 bash 命令,但它没有提供任何输出。

az ad sp credential list --id "xxxxxxxxxxxxxxxxxxx" --query "[].endDate" -o tsv
azure azure-cli
1个回答
0
投票

我在 azuredevops 管道中尝试了以下 bash 命令,但它没有提供任何输出。

az ad sp credential list --id "xxxxxxxxxxxxxxxxxxx" --query "[].endDate" -o tsv

由于 Azure Active Directory (Azure AD) Graph 的停用

Azure CLI Version 2.37.0
将合并
Microsoft Graph API
以替换底层
Active Directory Graph API

az ad app credential list
命令已更新,而不是
az ad sp credential list
,请参阅schaffererin
Ms Doc
了解更多详细信息。

要显示 Azure 服务主体到期日期,您可以使用以下命令。

旧命令:

az ad sp credential list --id 48bb608e-4779-465a-xvxvxvxvxvxvxvxvxve7d62fbc23 --query "[].endDate" -o tsv

更新命令:

az ad app credential list --id 48bb608e-hfhfhfh-465a-fhfhfh-2fe7d62fbc23 --query '[].endDateTime' --output tsv

输出:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.