Cannot run Template code for Azure Functions

TimEichfeld 20 Reputation points
2025-01-22T20:27:00.2433333+00:00

Hello,

I am looking over the https://learn.microsoft.com/en-us/training/modules/develop-test-deploy-azure-functions-with-visual-studio/2-develop-and-test-azure-functions-locally . On 'Unit2' where the learning module goes through VS2022 to load and run Azure Functions, the Blob Trigger is broken.

I go through the wizard, choose to use the Azurite WebStorage emulator (in memory) add a test secret and click finish.

Everything seems to load, however the Azure Function tool templates are incomplete and do not load in the proper nuget packages for BlobTrigger Attribute support. When I install the recommended package 'MicrosoftAzure.WebJobs.Extensions.Storage' it will not install because it wants to downgrade dependent components in the Azure Functions app. If I manually update all of my out of date nuget packages, I can install MicrosoftAzure.WebJobs.Extensions.Storage v5.3.3 (and all dependencies) but I get runtime errors.

[2025-01-22T19:50:58.628Z] A host error has occurred during startup operation 'caa2b9bc-d6d4-4fbd-851c-fa85cfdb1d0d'.

[2025-01-22T19:50:58.630Z] System.Private.CoreLib: Exception has been thrown by the target of an invocation. Microsoft.Azure.WebJobs.Extensions.Storage.Queues: Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Value cannot be null. (Parameter 'provider')

Press any key to continue....[2025-01-22T19:51:00.495Z] A host error has occurred during startup operation 'cab9528b-ca67-487b-9518-042c35971eb3'.

...

I even tried installing System.Memory.Data v6.0.0 - (and latest) but that still gives the exact same error.

How can I test these types of functions locally?
Is the Azurite emulator no longer supported?
Please advise.

Thanks much,

-Timothy

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,985 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pradeep M 5,275 Reputation points Microsoft Vendor
    2025-01-23T04:50:27.9133333+00:00

    Hi TimEichfeld,

    Thank you for reaching out to Microsoft Q & A forum. 

    The issue you're experiencing seems to be related to NuGet package conflicts. I recommend ensuring that all relevant packages, particularly Microsoft.Azure.WebJobs.Extensions.Storage, are compatible with the version of Azure Functions and .NET you're using. Additionally, try manually installing the System.Memory.Data package (v6.0.0.0), as this may resolve the issue. Please also confirm that you are using the latest version of the Azurite emulator and that your Visual Studio installation is fully updated with the Azure Development workload. After making these updates, rebuild the project and verify if the problem persists. 

    Please feel free to contact us if you have any additional questions.     

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.  


  2. TimEichfeld 20 Reputation points
    2025-01-27T14:15:59.1133333+00:00

    Hi Pradeep,

    This is simply trying to run the template code for "Blob Trigger" in Visual Studio 2022.
    [VS Version 17.11.0 (.Net Framework 4.8.09037)]

    Project Target Framework: .Net 8.0

    -=-=-=-

    AzTest FunctionBlob:
    Project uses the Azure Template "Azure Functions" Azure Function Project.

    .Net8.0 (long term support)
    Checked "Use Azurite for Runtime storage account (AzureWebJobsStorage)
    Function: "Blob Trigger"
    Connection string name : "AzTest1"
    Path: "samples-workitems"
    When the popup to choose the storage option appears - Storage Azurite Emulator (local) with pre-filled storage options.
    -=-=-=-
    I made sure all NuGet packges are updated to latest stable.
    I tried updating to the System.Memory.Data 9.0.1 that did not work.
    I tried down grading back to the 6.0.0 (error complaint) that did not work.
    -=-=-=-
    Not sure what else to do, this is purely template code that is supposed to work out of the box.

    Capture

    CaptureNuget

    Thanks much,

    -Timothy

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.