Azure / Azure/azure-cli

Service principal expiry query command not working

Open
#27,507 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-identity-squad Auto-Assign Azure CLI Team customer-reported Graph potential-pruning question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Looking for an automated way to identify a list of service principals Expiry date in advance and notify the related team if the expiry date is within 60 days of span. I tried below bash command in azuredevops pipeline, but its not providing any output.

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

### Related command

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

### Errors

Blank error

### Issue script & Debug output

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

### Expected behavior

Expiry details notification if its less than 60 days

### Environment Summary

Azure Platform

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.