Teams error AADSTS7000218: Client secret missing from token request
Last verified against Microsoft Learn - Status codes from bot conversational APIs
The request body must contain the following parameter: 'client_assertion' or 'client_secret'.What error AADSTS7000218 means
Your bot asked Microsoft Entra for a token with a client ID but no credential at all. The Entra error reference lists AADSTS7000218 with exactly that text: "The request body must contain the following parameter: 'client_assertion' or 'client_secret'." Entra never got as far as checking a secret - there was nothing to check.
Compare it with its neighbors. AADSTS7000215 means a secret arrived and was wrong; AADSTS7000222 means it arrived and had expired. AADSTS7000218 means the password setting your SDK reads (MicrosoftAppPassword in the Bot Framework samples) resolved to an empty value at runtime. In practice that is almost always a deployment problem rather than an Entra problem: the variable name differs between environments, a config file wasn't packaged with the build, or a secret-store reference failed to resolve and the platform quietly substituted an empty string.
The Teams symptom is the usual one for credential failures - the bot stops answering and Teams shows nothing - so the evidence lives in your logs at the first outbound call or at startup.
What it looks like
curl -X POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token \
-d "grant_type=client_credentials&client_id=APP_ID&client_secret=&scope=https%3A%2F%2Fapi.botframework.com%2F.default"
{
"error_description": "AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. ...",
"error_codes": [7000218]
}Why it happens
- The app setting or environment variable that should hold the password is unset or misnamed in this environment.
- appsettings.json or .env wasn't included in the deployed package.
- A Key Vault or secret-manager reference didn't resolve, leaving an empty value.
- The bot is configured for a secret-based app type while the deployment was set up for managed identity, so no secret was ever provided.
How to fix Teams error AADSTS7000218
- 1Log at startup whether the app ID and password settings are present (log the length, never the value).
- 2Compare the setting names your SDK reads with the names in the hosting platform's configuration, character by character.
- 3Run the token check from Microsoft's Bot Framework authentication guide with the deployed values; URL-encode the secret if it contains special characters.
- 4Fix the configuration source, restart the bot, and confirm a token is issued before testing in Teams.
How to stop it recurring
Fail fast: make the bot refuse to start when the app ID or password is empty instead of discovering it on the first user message. Keep one documented list of required settings per environment and check it in your deploy pipeline. If you move to managed identity, change the app type in the same release so the SDK stops expecting a secret.
Official reference: Microsoft Learn - Status codes from bot conversational APIs. See all Teams error codes or the Teams limits and quotas.
Related codes
- 401 Unauthorized (invalid app ID / password): Invalid Microsoft App ID or passwordAADSTS7000215: Invalid client secret provided.
- 401 Unauthorized (expired client secret): Expired client secretAADSTS7000222: The provided client secret keys are expired.
- 401 Unauthorized (tenant mismatch): Single-tenant vs multi-tenant mismatchAADSTS700016: The application wasn't found in the directory/tenant.
- AADSTS90002: Tenant not foundInvalidTenantName - The tenant name wasn't found in the data store. Check to…
Error AADSTS7000218 - quick answers
What does Teams error AADSTS7000218 mean?
Your bot asked Microsoft Entra for a token with a client ID but no credential at all. The Entra error reference lists AADSTS7000218 with exactly that text: "The request body must contain the following parameter: 'client_assertion' or 'client_secret'." Entra never got as far as checking a secret - there was nothing to check. Compare it with its neighbors.
How do I fix Teams error AADSTS7000218?
1. Log at startup whether the app ID and password settings are present (log the length, never the value). 2. Compare the setting names your SDK reads with the names in the hosting platform's configuration, character by character. 3. Run the token check from Microsoft's Bot Framework authentication guide with the deployed values; URL-encode the secret if it contains special characters. 4. Fix the configuration source, restart the bot, and confirm a token is issued before…
Stop debugging Teams by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.