This explains how to use a different storage account (other than the one Azure Functions does) for consuming events in module 1 of Microsoft Azure Developer: Develop Event Based Solutions course.
- Create a new app settings key and for its value have the connection string value for the storage account that contains the images and grayscale containers.
- For this example, we'll call that key EventImageStorage
- In the
Grayscale.cs
file, update the function'sBlob
declaration attribute to read:[Blob("{data.url}", FileAccess.Read, Connection = "EventImageStorage")] Stream inputBlobStream,
- Then further down in the body of the function, when you new up the
BlobServiceClient
, change that to:var outputBlobServiceClient = new BlobServiceClient( Environment.GetEnvironmentVariable("EventImageStorage") );
What you're doing is making sure the blob handling points at the correct Azure Storage account. I was using the account as specified by AzureWebJobsStorage
. But we don't need to.