This guide is for agencies and consultancies that use Teams to communicate with clients.
Default:
teams auth login --device-codeLocked-down client tenant:
teams auth login --device-code \
--client-id <client-approved-app-id> \
--tenant-id <client-tenant-id>Run diagnostics:
teams auth doctor --output jsonteams chat list --page-size 20 --output jsonStore the chosen chat ID in your project automation secret store or local config.
teams message list --chat "$CLIENT_CHAT_ID" --page-size 10 --output json |
jq '.data[] | {id, createdDateTime, messageType, bodyChars: (.body.content | length)}'This proves access without leaking client text into logs.
cat <<'TEXT' | teams message send --chat "$CLIENT_CHAT_ID" --stdin --output json
Daily update:
- Deployment completed
- Smoke tests passed
- No client action required
TEXT- Use a named profile per client.
- Keep customer tenant IDs and chat IDs out of public repos.
- Do not paste raw client messages into bug reports.
- Use a dedicated test chat before first production use.
- Confirm the consent screen shows the expected app and publisher before approval.