Open ggirard07 opened 10 months ago
Thanks. I logged a workitem on our internal backlog to investigate this for 17.8
@ggirard07 I don't have a timeline for the full fix (talking to the Azure Functions team before making changes to make sure I understand the intent of the base image's configuration) but in the short term you can work-around this in your own project.
For the single tools you can add:
<PropertyGroup>
<DockerfileRunArguments>-v $(APPDATA)/Microsoft/UserSecrets:/home/.microsoft/usersecrets:ro</DockerfileRunArguments>
</PropertyGroup>
to the project file to add the correct mount.
If you're using compose you can add:
services:
functionapp10:
volumes:
- ${APPDATA}/Microsoft/UserSecrets:/home/.microsoft/usersecrets:ro
to a compose file. I recommend using docker-compose.vs.debug.yml
/ docker-compose.vs.release.yml
as this is only needed for debugging.
@NCarlsonMSFT Thanks for feedback, the volume mount in docker compose is what I am currently using :)
When adding user secrets to an isolated function app, it looks like the secrets.json file is not mounted to the location expected by default
~/.microsoft/usersecrets/<user_secrets_id>/secrets.json
according to documentation. This is especially a problem on function app images as they override the defaultHOME
location. Here is the code used in function app to setup user secrets:Currently, I end up with following expected path from configuration provider
/home/site/wwwroot/bin/Debug/net6.0/secrets.json
, as parent directory for calculated location/home/.microsoft/usersecrets/<user_secrets_id>/secrets.json
does not exists.I think this is partially linked to the fix implemented for #250