kartikeykant18
kartikeykant18

Reputation: 1811

Blob Trigger : Storage account is not configured

I am trying to make a blob trigger azure function in Visual Studio. I gave the connection string value in the connection string and the container name in path. But when I run the boilerplate code that is generated I get the error that the storage account is not configured and a warning that

Warning: Cannot find value named *connection-string-here* in local.settings.json that matches 'connection' property set on 'blobTrigger'. You can run 'func azure functionapp fetch-app-settings <functionAppName>' or specify a connection string in local.settings.json.

Do I have to configure in the local.setting.json aswell?

This is my function currently

public static class Function1
    {
        [FunctionName("Function1")]
        public static void Run([BlobTrigger("*container-name*/{name}", Connection = "*connection-string*")]Stream myBlob, string name, ILogger log)
        {
            log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
        }
    }

Upvotes: 1

Views: 2535

Answers (1)

Joel Oughton
Joel Oughton

Reputation: 486

The value for Connection is the name of the app setting that contains the connection string. It is not the connection string itself.

If you specify 'MyStorage' as the value then you need to have the 'AzureWebJobsMyStorage' property set in local.setting.json for local development.

Upvotes: 4

Related Questions