Azure / Azure/azure-sdk-for-python
[docs] Fix outdated API references in doc/dev/mgmt/tests.md
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 3.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 193
Description
## Summary
Reviewed all markdown files under `doc/` and `doc/dev/` for inconsistencies with the current source code. One file had outdated API references.
### Changes in `doc/dev/mgmt/tests.md`
| Issue | Fix |
|-------|-----|
| `ClientSecretCredential(secret=...)` | Changed to `client_secret=` (correct parameter name per `azure-identity`) |
| `ClientSecretCredential(tenant=...)` | Changed to `tenant_id=` (correct parameter name per `azure-identity`) |
| `get_azure_core_credential()` (singular) | Changed to `get_azure_core_credentials()` (plural) — matches `mgmt_settings_fake.py` |
| `get_credential()` (singular) | Changed to `get_credentials()` (plural) — matches actual helper function name |
| `AzureTestCase` class reference | Changed to `AzureMgmtRecordedTestCase` — `AzureTestCase` no longer exists |
### Files verified clean (no changes needed)
- `doc/README.md`, `doc/dev/README.md`, `doc/tool_usage_guide.md`
- `doc/dev/tests.md`, `doc/dev/dev_setup.md`, `doc/dev/release.md`
- `doc/dev/pylint_checking.md`, `doc/dev/static_type_checking.md`, `doc/dev/static_type_checking_cheat_sheet.md`
- All other `doc/` and `doc/dev/` markdown files
No stale `tox` references were found (docs already use `azpysdk`). No broken internal links. No `setup.py` vs `pyproject.toml` mismatches.
> Generated by [Documentation Consistency Check](https://github.com/Azure/azure-sdk-for-python/actions/runs/30788416408) · 262.9 AIC · ⌖ 12.2 AIC · ⊞ 5.8K · [◷](https://github.com/search?q=repo%3AAzure%2Fazure-sdk-for-python+%22gh-aw-workflow-id%3A+doc-consistency-check%22&type=pullrequests)
---
> [!NOTE]
> This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
> The changes have been pushed to branch `doc/fix-mgmt-tests-api-references-b4c97c893c05f6c0`.
>
> **[Click here to create the pull request](https://github.com/Azure/azure-sdk-for-python/compare/main...doc/fix-mgmt-tests-api-references-b4c97c893c05f6c0?expand=1&title=%5Bdocs%5D%20Fix%20outdated%20API%20references%20in%20doc%2Fdev%2Fmgmt%2Ftests.md)**
To fix the permissions issue, go to **Settings** → **Actions** → **General** and enable **Allow GitHub Actions to create and approve pull requests**. See also: [gh-aw FAQ](https://github.github.com/gh-aw/reference/faq/#why-is-my-create-pull-request-workflow-failing-with-github-actions-is-not-permitted-to-create-or-approve-pull-requests)
Show patch preview (62 of 62 lines)
```diff
From d395145311ea7297a2733317323e2dcefbc2e155 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Mon, 3 Aug 2026 06:05:28 +0000
Subject: [PATCH] Fix outdated API references in doc/dev/mgmt/tests.md
- Fix ClientSecretCredential parameter names: secret= -> client_secret=, tenant= -> tenant_id=
- Fix function name references: get_azure_core_credential -> get_azure_core_credentials, get_credential -> get_credentials
- Fix class reference: AzureTestCase -> AzureMgmtRecordedTestCase
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
doc/dev/mgmt/tests.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/doc/dev/mgmt/tests.md b/doc/dev/mgmt/tests.md
index 7f7bfdd4..44e71108 100644
--- a/doc/dev/mgmt/tests.md
+++ b/doc/dev/mgmt/tests.md
@@ -77,8 +77,8 @@ from azure.identity import ClientSecretCredential
credentials = ClientSecretCredential(
client_id = os.environ['AZURE_CLIENT_ID'],
- secret = os.environ['AZURE_CLIENT_SECRET'],
- tenant = os.environ['AZURE_TENANT_ID']
+ client_secret = os.environ['AZURE_CLIENT_SECRET'],
+ tenant_id = os.environ['AZURE_TENANT_ID']
)
```
Or you can use `DefaultAzureCredential`, which we prefer.
@@ -98,9 +98,9 @@ In live mode, you need to use real credentials like those you obtained in the pr
Then make the following changes:
* Change the value of the `SUBSCRIPTION_ID` constant to your subscription ID. (If you don't have it, you can find it in the "Overview" section of the "Subscriptions" blade in the [Azure portal][azure_portal].)
-* Change the `get_azure_core_credential()` function to construct and return a `ClientSecretCredential`:
+* Change the `get_azure_core_credentials()` function to construct and return a `ClientSecretCredential`:
```python
-def get_azure_core_credential(**kwargs):
+def get_azure_core_credentials(**kwargs):
from azure.identity import ClientSecretCredential
import os
... (truncated)
```
Contributor guide
Research direction
Review doc/dev/mgmt/tests.md against the current azure-identity API and the helper names in mgmt_settings_fake.py. Confirm the credential parameters, helper functions, and test-case class references match the source, then verify the documented examples are internally consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100