I want to develop an application in which data is in azure blob storage and after data processing i want to read that data in my application.
I want to develop an application in which data is in azure blob storage and after data processing i want to read that data in my application.
You can do it. There are many ways to do this, so knowing your information better will give you the right advice. Are you already hosting blob storage and applications on Azure?
Yes,i have client whose sensors data are already stored on azure blob storage,now i want to know how to use this blob storage has a database and develop and deploy application on azure only.That application must get data from azure blob storage in real time. This whole project in on a fitness band which has sensors and that sensors are sending data to azure blob storage.Now i want to develop an application in which i am getting data from blob storage in real time and let band user know how much calories they burns or other things which i will calculate from data send by sensors.
@TestDeveloper12345-7081 If your application has to react to events much quicker than this, consider using Blob Storage events . Blob Storage Events provides real-time one-time events which enable your Azure Functions or applications to quickly react to changes that occur to a blob.
You can rely on the Blob Storage events and read the sensor data using function app. More Info here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp
If you wants to use the Logic App then they can leverage this: https://techcommunity.microsoft.com/t5/azure-paas-blog/add-file-watcher-on-containers-in-azure-storage-account-using/ba-p/1301993
Please let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
Hi @TestDeveloper12345-7081 ,
Here is a C# method to list all files in a blob container:
public async Task ListAsync()
{
// Get a connection string to our Azure Storage account.
string connectionString = ConnectionString;
// Get a reference to a container named "sample-container" and then create it
BlobContainerClient container = new BlobContainerClient(connectionString, Randomize("sample-container"));
await container.CreateAsync();
try
{
// List all the blobs
List<string> names = new List<string>();
await foreach (BlobItem blob in container.GetBlobsAsync())
{
names.Add(blob.Name);
}
}
catch(Exception ex)
{
// Log the exception
}
}
If you know the path of the file you want to download, then you can make use of the following method:
public async Task DownloadImageAsync(string downloadPath)
{
// Download the public blob at https://aka.ms/bloburl
await new BlobClient(new Uri("https://yourbloburl")).DownloadToAsync(downloadPath);
byte[] fileBinary = File.ReadAllBytes(downloadPath)//you have the binary of the file so you can decide what to do with the file.
}
12 people are following this question.