Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyvault environmental variable reference support #90

Open
Perks-of-Being-a-Cauliflower opened this issue Nov 19, 2024 · 6 comments
Open
Labels
investigating investigating if this is a bug or feature

Comments

@Perks-of-Being-a-Cauliflower
Copy link

Perks-of-Being-a-Cauliflower commented Nov 19, 2024

Is your feature request related to a problem? Please describe.
Keyvault reference support. I would like to reference the key vault values exactly the same as if I were creating a function app on an app service plan in the environmental variables.

This is the error I got when I tried:
"Key Vault References are currently not supported for Functions on ACA. Please provide another value."

Describe the solution you'd like
I have sensitive keys/secrets that are stored in an azure keyvault. I want to references these values in a secure way by referencing the keyvault in the function app environment variables. e.g. '@Microsoft.KeyVault(VaultName=keyVaultFullName;SecretName=KeyvaultSecretName)'
https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references?tabs=azure-cli

Describe alternatives you've considered
Going to look into a dapr secret store as an alternative or referencing key vault in the code. not sure if managed identity is used at code level.

Additional context
I appreciate the error message being very explicit as to the issue.

@Perks-of-Being-a-Cauliflower Perks-of-Being-a-Cauliflower changed the title Keyvault environmenta variable reference support Keyvault environmental variable reference support Nov 19, 2024
@aloiva
Copy link

aloiva commented Nov 20, 2024

Hi @Perks-of-Being-a-Cauliflower, could you please provide details about which location you've faced the error in, name of the app/resource id? Functions on ACA currently supports Managed Identity as well as Key vault references. It could be that you're trying to create the resource in a region where Functions on Container Apps is not supported. I suggest trying out a different region. You can find the list of supported regions here: https://aka.ms/functionacaregions. Please look for regions supported by Azure Container Apps.

@raorugan raorugan added the investigating investigating if this is a bug or feature label Nov 20, 2024
@raorugan
Copy link
Collaborator

@Perks-of-Being-a-Cauliflower - appreciate your response here. Else you can drop me a note to - [email protected]

@Perks-of-Being-a-Cauliflower
Copy link
Author

Sorry for the delayed response. The container/function app was created in Australia East, and the key vault is in Australia South-East (VNETs are peered). The portal had Australia East as an option, so I just assumed that it was supported when I was creating the bicep. I can't see Azure Container Apps in the list you provided so perhaps it's just not supported despite being available in the portal.

@raorugan
Copy link
Collaborator

raorugan commented Dec 2, 2024

Hi @Perks-of-Being-a-Cauliflower Functions on Azure COntainers apps is supported in Australia east. Are you still seeing this issue

@raorugan
Copy link
Collaborator

raorugan commented Dec 2, 2024

Can you email us the resource id and time the error occurred as this is not expected behaviour?

@Perks-of-Being-a-Cauliflower
Copy link
Author

I don't have the original resource because I had to change to a Flex Consumption plan Function app due to time constraints. I will try to dig out the original code from source control.

I did suspect that AustraliaEast was supported. I just double-checked the documentation and the line that mentions that Keyvault references through environment variables not being supported is no longer there so I wonder if support has now been added.

I might try and do another deployment in my own time if/when I find the original code. My understanding was that the subnet delegation didn't allow for VNET-integrated function apps to access the keyvault via environmental variables but perhaps that has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating investigating if this is a bug or feature
Projects
None yet
Development

No branches or pull requests

3 participants