Open kfwalther opened 1 year ago
@kfwalther apologies for the delayed response - are you still experiencing issues? If this is production-impacting, please engage our support team.
Since you use DI and have a startup class, I recommend checking out this official guide for DI in dotnet. Please make sure you are not overriding any host services since that will especially lead to unexpected behavior.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
If you are not the original author (kfwalther) and believe this issue is not stale, please comment with /bot not-stale
and I will not close it.
@satvu Thanks for the link to the official guide, we used that to construct our initial implementation. We did find a work-around for the issue (which had the behavior of a race condition), but we're not sure why it works. We had to remove the _GenerateFunctionsExtensionsMetadataPostBuild
dependency target from our ZipFunctions target in the .csproj file to get the extensions.json
file consistently populated. So, we changed this:
<Target Name="ZipFunctions" AfterTargets="build" DependsOnTargets="_GenerateFunctionsExtensionsMetadataPostBuild;_GenerateFunctionsPostBuild">
<Exec Command="powershell.exe Compress-Archive -Path $(ProjectDir), $(OutDir)\bin, $(ProjectDir)host.json -DestinationPath $(ProjectDir)..\output\functionApp.zip -Force" />
</Target>
to this:
<Target Name="ZipFunctions" AfterTargets="build" DependsOnTargets="_GenerateFunctionsPostBuild">
<Exec Command="powershell.exe Compress-Archive -Path $(ProjectDir), $(OutDir)\bin, $(ProjectDir)host.json -DestinationPath $(ProjectDir)..\output\functionApp.zip -Force" />
</Target>
I would have thought this might exclude the extensions.json
files from our zip, but it appears to be present. We have a few more questions than answers at this point, but at least it's working...
@kfwalther thanks for the additional information! Will discuss with team.
When building and running our Azure functions in Visual Studio 2022 locally, we usually receive these
not registered
errors.We're using DI for a number of services within our Azure functions (including
GraphServiceClient
). Per the error, we've triple checked that theMicrosoft.Azure.WebJobs.Extensions.Storage
package is installed. We've tried downgrading to v4.0.5 of this package, but the symptoms persist. Here is our csproj file housing the Azure functions:One of our functions looks like this:
When this occasionally works, the
extensions.json
file in the output directory will be populated, and all of the Azure functions properly register their bindings:However, usually the
extensions.json
file appears blank as:Investigative information