Hello Emil Paaske Kvandal,
Greetings! Thanks for raising this question in Q&A forum.
Great observation and a very well-described issue! What you are seeing in the swap preview is actually the key clue to what is happening here. Let me explain what is going on and how to fix it.
The swap preview you described tells the whole story. Look at it this way:
In the Source slot changes (staging), it shows the settings going to "Not set" meaning staging will lose those values after the swap. In the Target slot changes (production), it shows the old value as "Not set" and the new value as your expected setting meaning production will receive those values. This is actually the swap working correctly! The settings are being moved from staging to production as expected.
However, the real problem here is a subtler one. The swap preview is showing you that your production slot currently has no values set for those environment variables at all ("Not set" as the old value). This means your app in production may not be picking up the new values because either the app needs a restart to load them, or the values were not saved properly before the swap.
Here is what you should check and do step by step:
Step 1 — Verify the swap actually completed by checking production settings
After the swap, go directly to the production slot and confirm the values are really there.
- In the Azure Portal, open your App Service.
- Click on the Production slot (not staging).
- Go to Settings > Environment variables.
- Check if your expected env variable values are now showing there.
If they are present — great, the swap worked! Your app just might need a restart to pick them up (see Step 3).
Step 2 — Check if "Deployment slot setting" is accidentally enabled anywhere
Even though you mentioned it is NOT checked, it is worth double-checking every single variable individually, as it is easy to miss one.
- Go to the staging slot in the portal.
- Open Settings > Environment variables.
- Click on each variable one by one and confirm the Deployment slot setting toggle is turned OFF for all of them.
- If even one is toggled ON, that specific variable will stay in staging and never move to production during a swap.
Step 3 — Restart the production slot after the swap
Sometimes the app does not automatically pick up newly swapped environment variables without a restart.
- Go to the Production slot in the Azure Portal.
- Click Restart at the top of the Overview page.
- Wait for it to come back up and then re-check if the env variables are being read by your application.
Step 4 — Understand the swap preview correctly going forward
This is important to avoid confusion in the future. The swap preview table works like this:
- Source slot changes shows what the staging slot's settings will look like AFTER the swap (it will lose the values it gave to production).
- Target slot changes shows what the production slot's settings will look like AFTER the swap (it will gain the values from staging).
So seeing "Not set" under source slot changes is completely expected and normal — it just means staging is giving away those values to production. The swap is working correctly.
Step 5 — If production still shows "Not set" after the swap
If after following the above steps the values are still missing in production, try this as a workaround:
- Manually add the environment variables directly in the production slot as well (with their production-appropriate values).
- Then on the next swap, both slots will have values and the swap preview will make more sense going forward.
To summarise based on the swap preview you shared, it looks like the swap is actually working as expected. The most likely culprits are either the app needing a restart to pick up the new values, or the production slot genuinely not having received them due to a "Deployment slot setting" being checked on one of the variables. A quick check of each variable's toggle and a production restart should resolve this for you.
If this answer helps you kindly accept the answer which will help others who have similar questions.
Best Regards,
Jerald Felix.