Start here. This is the direct spoken answer to practice first.
Why this question matters
HTTP 500 responses immediately after a slot swap point toward the newly active artifact, production-bound configuration, cold initialization, dependency access, or incompatible data changes. Safe mitigation depends on knowing whether the old slot can still run against current state.
I would first reduce impact by deciding whether to swap back, disable a feature, or keep production stable another way. Then I would inspect the production slot logs, recent exceptions, failed request traces, dependency failures, and the exact time of the swap. I would compare staging and production slot settings, especially sticky settings, connection strings, Key Vault references, auth URLs, feature flags, and database targets. The goal is to find whether the new code is broken or the slot received the wrong environment behavior.