Net Web App with Angular UI to send docx to blob and receive email notification using Azure Function with SAS token
-
Clone the repository.
-
Open terminal/command prompt and navigate to the
reenbitFunctions
folder. -
Run the following command to restore dependencies and build the .NET project:
dotnet build
-
Navigate to the reenbitTask folder.
-
Copy the provided appsettings.json file into the root of the reenbitTask project.
-
Run the following command to restore dependencies and build the .NET project:
dotnet build
- Navigate to the reenbitTask.ClientApp folder. Run the following command to restore Node.js dependencies and build the Angular project:
npm install
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "YOUR_AZURE_STORAGE_CONNECTION_STRING",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"EmailSender": "YOUR_EMAIL_SENDER",
"SenderPassword": "YOUR_SENDER_PASSWORD"
}
}
{
"AzureBlobStorageConnectionString":"YOUR_BLOB_CONNECTION_STRING"
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
dotnet run
dotnet run
Open another terminal window, and navigate to the reenbitTask.Client folder, and run the following command:
ng serve
Open your browser and visit http://localhost:4200 to interact with the Angular app.
For Unit Tests in reenbitTask.Tests:
dotnet test
API has only 1 endpoint
/file/upload/{email}/{file}
Returns IActionResult with BadRequest or Ok and message
Invalid email address
No file provided
Invalid file format. Only .docx files are allowed.
File uploaded successfully.