Skip to content

.Net Web App with Angular UI to send docx to blob and receive email notification using Azure Function with SAS token

Notifications You must be signed in to change notification settings

FGVN/reenbitTask

Repository files navigation

Reenbit Task

Net Web App with Angular UI to send docx to blob and receive email notification using Azure Function with SAS token

Prerequisites

Installation

  1. Clone the repository.

  2. Open terminal/command prompt and navigate to the reenbitFunctions folder.

  3. Run the following command to restore dependencies and build the .NET project:

    dotnet build
  4. Navigate to the reenbitTask folder.

  5. Copy the provided appsettings.json file into the root of the reenbitTask project.

  6. Run the following command to restore dependencies and build the .NET project:

dotnet build
  1. Navigate to the reenbitTask.ClientApp folder. Run the following command to restore Node.js dependencies and build the Angular project:
npm install

Configuration

reenbitFunctions/local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "YOUR_AZURE_STORAGE_CONNECTION_STRING",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "EmailSender": "YOUR_EMAIL_SENDER",
    "SenderPassword": "YOUR_SENDER_PASSWORD"
  }
}

reenbitTask/appsettings.json

{
  "AzureBlobStorageConnectionString":"YOUR_BLOB_CONNECTION_STRING"
   "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*"
  }

How to Run

Navigate to the reenbitFunctions folder and run the following command:

dotnet run

Open a new terminal window, navigate to the reenbitTask folder, and run the following command:

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.

Testing

Run the following command in the respective project:

For Unit Tests in reenbitTask.Tests:

dotnet test

API Documentation

API has only 1 endpoint

/file/upload/{email}/{file}

Returns IActionResult with BadRequest or Ok and message

BadRequest has the following messages:

Invalid email address

No file provided

Invalid file format. Only .docx files are allowed.

Ok returns the following:

File uploaded successfully.

About

.Net Web App with Angular UI to send docx to blob and receive email notification using Azure Function with SAS token

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published