Search code examples
azureazure-functionsazure-functions-core-tools

Mock the blob storage bindings in azure functions core tools


Azure functions core tools let me run my functions app locally. I want to use this as a test back end for a SPA, while the front end is served on a separate process on localhost.

If I have a blob storage input and output binding, how can I mock these when running azure functions core tools?

Eg I have a post HTTP triggered function updateBlob which takes the request body and just appends the string to the existing blob.

When I run this locally with azure functions can I mock out the blob input/output bindings so that it just reads and writes to a text file?


Solution

    • You can use Azurite which will emulate the entire Azure Storage Account and not just blob storage.
    • Azurite is directly available as vs code extension. Just search Azurite under the extension tab and click install. enter image description here
    • To start a blob service, press f1 and then select Azurite: Start blob Service in the popup window, this will emulate the blob storage at a particular address.

    Refer the following documentation on azurite.