Closed dariemcarlosdev closed 3 weeks ago
Install Azure SDKs and Required Packages:
Install the required packages for Azure Blob Storage, Event Grid, and API functionalities. dotnet add package Azure.Storage.Blobs dotnet add package Azure.Messaging.EventGrid dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson
Set Up Azure Blob Storage:
Deploy to Azure App Service (Optional):
-You can deploy the microservice to Azure App Service.
Alternatively, you can use Docker if containerization:
docker build -t filemanagementservice:latest . docker run -p 8080:80 filemanagementservice:latest
This service is responsible for file uploads and interaction with Azure Blob Storage. It triggers the event to start processing the file once it’s uploaded.
Controllers/FileUploadController.cs: This controller expose an API enpoint for file upload.The file should be restricted just to .csv. Once the file is uploaded, It stores the uploaded file into Azure Blob Storage and triggers an event to process it.
Services/AzureBlobStorageService.cs: Contains logic to upload files to Azure Blob Storage and generate a file URL.
Events: Once the file is uploaded, this microservice triggers an event using Azure Event Grid #14 to notify the ProcessingService to start processing.