'key vault references in a staging deployment slot

I have a function app in which I added a new staging deployment slot as follows:

enter image description here

Looking at the configuration of staging slot, I see that the key vault references are errored out:

enter image description here

enter image description here

Why is that?

UPDATE:

On enabling Identity, I now see a different error:

enter image description here



Solution 1:[1]

Your app should have a system-assigned managed identity to be able to connect to your Key Vault. Ensure that your app has a system-assigned identity.

enter image description here

MSINotEnabled is caused by the absence of a managed identity for your app. You have to Enable the system-assigned identity for your app to resolve this issue.

update answer:

AccessToKeyVaultDenied error signifies that your app is unable to reach the secrets stored in the Key Vault. The likely reasons could be:

  • Your app can’t reach the Key Vault — add your app’s IP (available under Custom domains) to your Key Vault’s firewall (under Networking).

  • Your app doesn’t have the correct permission to read your secrets — assign the correct (Get) permission to your app to read the appropriate credentials from the Vault.

enter image description here

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1