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.
2,000 questions
0 comments No comments
{count} votes

1 answer

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

    Hi TimEichfeld,

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

    To resolve your issue, please follow these steps: 

    1.Update Visual Studio 2022 to the latest version via the Visual Studio Installer. 

    2.Use the installer to modify Visual Studio, ensuring ASP.NET and web development and Azure development workloads are installed. 

    3.Create a new Azure Functions project and select .NET 8.0 Isolated (Long Term Support) as the runtime version. 

    4.Follow the exercise steps carefully to configure and test your function. 

    5.Screenshots have been provided for your reference:
    280125runtime280125_01280125_1280125_3

    6.Note: The exercise originally mentions .NET 6.0 (Long Term Support) but might be updated in the future to .NET 8.0 for enhanced clarity and user experience. 

    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.  


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.