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

Log diagnostic event if files not found in deployed payload #10647

Open
brettsam opened this issue Nov 21, 2024 · 0 comments
Open

Log diagnostic event if files not found in deployed payload #10647

brettsam opened this issue Nov 21, 2024 · 0 comments
Assignees

Comments

@brettsam
Copy link
Member

This is another scenario that we should add to our "bad zipped directory" detection. A customer had deployed a zip that was somewhat correct, but we were unable to find any of the assemblies referenced in extensions.json due to a custom targets file that moved some files around during publishing. This was inadvertently copying these assemblies elsewhere and ended up with a structure like this:

|   extensions.json
|   functions.metadata
|   host.json
| ... assemblies
|   worker.config.json
|
+---.azurefunctions
|       function.deps.json
|       Microsoft.Azure.Functions.Worker.Extensions.pdb
|
+---bin
|   +---.azurefunctions
|   |       Microsoft.Azure.Functions.Worker.Extensions.dll
|   |       Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll
|   |       Microsoft.Azure.WebJobs.Host.Storage.dll
|   |       Microsoft.WindowsAzure.Storage.dll
|   |
|   ... some other folders/files

With those required folders being moved to /bin/.azurefunctions, we couldn't find them. The error is cryptic with:

Unable to load startup extension 'Startup' (Type: 'Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.Startup, Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=551316b6919f366c'). The type does not exist. Please validate the type and assembly names.

I propose that if we run into issues like this, we write a debug log with the customer's directory structure that allows us to quickly diagnose what they've done wrong. We should also emit a diagnostic event with a link to our docs (https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#deployment-payload)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants