1

I have function app which connect to blob , read file content and post content to API. The function works perfect on debug from Visual Studio . The problem I am having is does not work from Azure when deployed . The error I ma getting is:

Exception while executing function: MyFunctionManager

Problem Id:System.ArgumentNullException at MYFUNCTION.FA.FileManager.BlobContainerManager.GetCloudBlobContainer

It seems cannot connect and find the blob storage. In the code I am getting the container using connection string set in the local.settings.json:

     public static CloudBlobContainer GetCloudBlobContainer(string blobContainer)
    {
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            App.Settings.AzureFileStorageConnectionString);
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
        CloudBlobContainer container = blobClient.GetContainerReference(blobContainer);
        container.CreateIfNotExistsAsync();
        return container;
    }

Any help appreciated

Thanks

1
  • The error message said your blobContainer parameter is null. How do you get the container name ? Commented Mar 6, 2019 at 10:28

1 Answer 1

2

The local.settings.json file is just for local development.

When running on Azure, make sure you have an Application Setting with key AzureFileStorageConnectionString and value to your storage account's connection string.

And you would have to do the same for the container name too since you mentioned that you are getting it from Application Settings.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.