Azure / Azure/azure-cli

Internal Server Error on service principal credential reset and delete

Open
#29,398 4 comments 0 reactions 2 assignees Claimed by @isra-fel View on GitHub
act-identity-squad Auto-Assign Auto-Resolve Azure CLI Team customer-reported Graph Possible-Solution question Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

When using the az cli, an internal server error is thrown when using `az ad sp credential delete --id xxxxx --key-id xxxxx --verbose` and `az ad sp credential reset --id xxxxx`

### Related command

`az ad sp credential delete`, `az ad sp credential reset`

### Errors

`Encountered an internal server error.`

### Issue script & Debug output

```
urllib3.connectionpool: Starting new HTTPS connection (1): graph.microsoft.com:443
urllib3.connectionpool: [https://graph.microsoft.com:443](https://graph.microsoft.com/) "POST /v1.0/servicePrincipals/xxxxx/removePassword HTTP/1.1" 500 None
cli.azure.cli.core.util: Response status: 500
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util: 'Cache-Control': 'no-cache'
cli.azure.cli.core.util: 'Transfer-Encoding': 'chunked'
cli.azure.cli.core.util: 'Content-Type': 'application/json'
cli.azure.cli.core.util: 'Content-Encoding': 'gzip'
cli.azure.cli.core.util: 'Vary': 'Accept-Encoding'
cli.azure.cli.core.util: 'Strict-Transport-Security': 'max-age=31536000'
cli.azure.cli.core.util: 'request-id': 'xxxxx'
cli.azure.cli.core.util: 'client-request-id': 'xxxxx'
cli.azure.cli.core.util: 'x-ms-ags-diagnostic': '{"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"4","ScaleUnit":"003","RoleInstance":"CH01EPF0002DB15"}}'
cli.azure.cli.core.util: 'x-ms-resource-unit': '1'
cli.azure.cli.core.util: 'Date': 'Tue, 16 Jul 2024 12:33:03 GMT'
cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"error":{"code":"Service_InternalServerError","message":"Encountered an internal server error.","innerError":{"date":"2024-07-16T12:33:03","request-id":"xxxxx","client-request-id":"xxxxx"}}}
```

### Expected behavior

When a user has the proper permissions to delete or reset the credentials on a service principal, they would be able to do this without encountering an internal server error.

### Environment Summary

azure-cli 2.62.0

core 2.62.0
telemetry 1.1.0

Extensions:
account 0.2.5
aks-preview 0.5.174
kusto 0.5.0

Dependencies:
msal 1.28.1
azure-mgmt-resource 23.1.1

Python location '/usr/local/Cellar/azure-cli/2.62.0/libexec/bin/python'
Extensions directory '/Users/jpacheco/.azure/cliextensions'

Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

This occurred for all team members who attempted to delete or reset credentials.

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.