add python best practice and update python skills accordingly#295
Open
xiangyan99 wants to merge 11 commits intomicrosoft:mainfrom
Open
add python best practice and update python skills accordingly#295xiangyan99 wants to merge 11 commits intomicrosoft:mainfrom
xiangyan99 wants to merge 11 commits intomicrosoft:mainfrom
Conversation
scottaddie
reviewed
Apr 24, 2026
| 8. **Use async clients** for high-throughput scenarios | ||
| 1. **Pick sync OR async and stay consistent.** Do not mix `azure.xxx` sync clients with `azure.xxx.aio` async clients in the same call path. Choose one mode per module. | ||
| 2. **Always use context managers for clients and async credentials.** Wrap every client in `with Client(...) as client:` (sync) or `async with Client(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up. | ||
| 3. **Use DefaultAzureCredential** for authentication |
Member
There was a problem hiding this comment.
Be more specific about when it's appropriate to use DAC. See previous suggestion.
| 7. **Configure proper CORS** for Web Chat channel | ||
| 1. **Pick sync OR async and stay consistent.** Do not mix `azure.xxx` sync clients with `azure.xxx.aio` async clients in the same call path. Choose one mode per module. | ||
| 2. **Always use context managers for clients and async credentials.** Wrap every client in `with Client(...) as client:` (sync) or `async with Client(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up. | ||
| 3. **Use DefaultAzureCredential** for authentication |
| 8. **Monitor capacity usage** via Azure Monitor metrics | ||
| 1. **Pick sync OR async and stay consistent.** Do not mix `azure.xxx` sync clients with `azure.xxx.aio` async clients in the same call path. Choose one mode per module. | ||
| 2. **Always use context managers for clients and async credentials.** Wrap every client in `with Client(...) as client:` (sync) or `async with Client(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up. | ||
| 3. **Use DefaultAzureCredential** for authentication |
| 8. **Use context manager** — Ensures proper client cleanup | ||
| 1. **Pick sync OR async and stay consistent.** Do not mix `azure.xxx` sync clients with `azure.xxx.aio` async clients in the same call path. Choose one mode per module. | ||
| 2. **Always use context managers for clients and async credentials.** Wrap every client in `with Client(...) as client:` (sync) or `async with Client(...) as client:` (async) to ensure proper cleanup. For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up. | ||
| 3. **Use DefaultAzureCredential** for authentication |
| 7. **Set appropriate content types** for web-served blobs | ||
| 1. **Pick sync OR async and stay consistent.** Do not mix `azure.storage.blob` sync clients with `azure.storage.blob.aio` async clients in the same call path. Choose one mode per module. | ||
| 2. **Always use context managers for clients and async credentials.** Wrap every client in `with BlobServiceClient(...) as client:` (sync) or `async with BlobServiceClient(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up. | ||
| 3. **Use DefaultAzureCredential** instead of connection strings |
…y-py/SKILL.md Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
…L.md Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
…metry-exporter-py/SKILL.md Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
scottaddie
reviewed
Apr 24, 2026
…metry-py/SKILL.md Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
…re-py/SKILL.md Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
…n99/skills into add_python_best_practice
Collaborator
|
@xiangyan99 - for @scottaddie's changes were these reflected back into the skill creator? |
Member
Author
Yes. I updated in the skill-creator to use
|
# Conflicts: # .github/plugins/azure-sdk-python/skills/hosted-agents-v2-py/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add python best practice and update python skills accordingly