Azure / Azure/azure-functions-host

Caching issue - function app staging slot keys appear in portal to change after swap slot performed

Open
#7,710 7 comments 5 reactions 1 assignee Claimed by @satvu View on GitHub
bug needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Caching issue - When a Function app with both a prod and staging slot performs a swap, the functions keys for the staging slot appear in the portal to adopt the same values as the prod keys, but in storage they do not change. (Not changing keys on swap is the expected behavior with default settings).

#### Investigative information

This [IcM](https://portal.microsofticm.com/imp/v3/incidents/details/254306950/home) was filed

Please provide the following:

- Timestamp: 9-28-21 23:07:00 UTC
- Function App version: 3
- Function App name: SlotsSwapKey
- Function name(s) (as appropriate):
- Invocation ID:
- Region: Central US

#### Repro steps

Provide the steps required to reproduce the problem:

1. Create a function app with 2 deployment slots.
2. Go to function app's storage account (name can be found in Configuration --> AzureWebJobsStorage)
3. In the storage account: containers --> azure-webjobs-secrets, then for each slot, host.json --> Edit --> set masterKey "encrypted" to false.
4. Note keys for each slot. (App keys)
5. Perform a slot swap in the function app, check keys for both prod and staging slot.

#### Expected behavior

Provide a description of the expected behavior.

After step 5, the keys should have stayed the same.

#### Actual behavior

Instead, the portal shows that the staging slot adopted the prod slot's keys.

#### Known workarounds
Setting WEBSITE_FUNCTIONS_ARMCACHE_ENABLED=0 makes the issue go away.

#### Related information
screenshot of portal after a slot swap:
![keys](https://user-images.githubusercontent.com/50681653/135178357-a4cbe384-8879-4109-98fb-728684bcb07e.JPG)
arounds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.