azureazure-functionsvisual-studio-2022azurite

Azure Functions: Blob Storage emulator stopped working after moving to VS2022


I have one old Azure Functions project (v3). It contains several timer triggered functions. They stopped working on VS2022. You can see the logs below. If I create a new Functions project via VS2022, it will work fine. Looks like Azurite also starts up fine. Setting "AzureWebJobsStorage" equals "UseDevelopmentStorage=true". What can I do?

[2022-01-06T10:17:15.675Z] Host lock lease acquired by instance ID '000000000000000000000000DC2A3C3E'.
[2022-01-06T10:17:35.554Z] The listener for function 'Function1' was unable to start.
[2022-01-06T10:17:35.556Z] The listener for function 'Function1' was unable to start. Azure.Storage.Blobs: Service request failed.
[2022-01-06T10:17:35.557Z] Status: 500 (Internal Server Error)
[2022-01-06T10:17:35.557Z]
[2022-01-06T10:17:35.558Z] Headers:
[2022-01-06T10:17:35.559Z] Server: Azurite-Blob/3.14.1
[2022-01-06T10:17:35.560Z] ETag: "0x234B8B049DD4280"
[2022-01-06T10:17:35.561Z] x-ms-blob-type: BlockBlob
[2022-01-06T10:17:35.562Z] x-ms-lease-state: available
[2022-01-06T10:17:35.562Z] x-ms-lease-status: unlocked
[2022-01-06T10:17:35.563Z] x-ms-client-request-id: a3bc0141-7bcb-420c-84a9-eadf86f8c685
[2022-01-06T10:17:35.564Z] x-ms-request-id: 88474d4b-bc15-4f45-95d5-0a01682d883d
[2022-01-06T10:17:35.565Z] x-ms-version: 2020-10-02
[2022-01-06T10:17:35.566Z] Accept-Ranges: bytes
[2022-01-06T10:17:35.566Z] Date: Thu, 06 Jan 2022 10:17:35 GMT
[2022-01-06T10:17:35.567Z] x-ms-server-encrypted: true
[2022-01-06T10:17:35.570Z] x-ms-blob-content-md5: jhxvLoUrRfc2dXn/gXokig==
[2022-01-06T10:17:35.570Z] Connection: keep-alive
[2022-01-06T10:17:35.571Z] Keep-Alive: REDACTED
[2022-01-06T10:17:35.572Z] Last-Modified: Tue, 28 Dec 2021 11:10:44 GMT
[2022-01-06T10:17:35.573Z] Content-Length: 115
[2022-01-06T10:17:35.574Z] Content-Type: application/octet-stream
[2022-01-06T10:17:35.574Z] Content-MD5: jhxvLoUrRfc2dXn/gXokig==

UPDATE
I have added few new functions to the same project. They work fine. I have changed function and method names and old functions also start working. Looks like it caches somewhere names. I tried clean rebuild but it didn't help. I have no idea why it doesn't work with old names.


Solution

  • I was able to solve this issue by using Azure Storage Explorer and deleting the related blob folder under azure-webjobs-hosts in the local storage blob container

    The root folders will be found at: Local & Attached > Storage Accounts > (Emulator - Default Ports) > Blob Containers -> azure-webjobs-hosts

    Make sure the project is open or Storage Explorer may not load the containers.

    Once deleted, the problem function began running as expected

    enter image description here