Blob Storage Using Function App

Introduction

In this article I will explain about Blob storage and uploading files with it with the Azure functions app. Before getting into procedure let’s see an overview about function apps. Azure functions is a solution for running small lines of code or the functions in the Cloud & we can select the programming languages, as per our desire. We can build the codes that we need at a small level, so that we need not worry about the whole application for running it. Azure functions Applications let us develop Serverless Applications.

Prerequisites

  • An active Azure subscription
  • Microsoft Azure storage explorer.

Creating azure function application

Step 1

Login to Azure portal.

Step 2

Click New->Compute->Function app.

Azure Function App

Step 3

Now, we need to provide the requirements given below for Functions app.

  • We need to provide an app name for Function app with the unique name.
  • Create a resource group and provide a name for your resource group.
  • The hosting part consists of consumption plan & app Service plan.
  • The consumption plan is default plan, but when we choose the consumption plan; we need to choose the location.
  • In concept of app Service plan; we need to create an app plan +location. It defines the location and features with cost with the sources with the app.
  • The storage account has to be configured, so that we can either choose the existing storage or we can create a new storage account.

Step 4

Click Create to deploy Function app.

deploy Azure Function app

Step 5

Now for creating a blob function, we need to create a function in new function application.

Step 6

In the function app expand the function app and select + button in the functions, and select the scenario with the desired programming language, since I have selected javascript of my desire you can select the programming template of your own and click->custom functions for view of complete set of function templates of it.

Azure Function app

Azure Function app

Step 7

select->Blob trigger with the desired programming language template.

Blob trigger

Step 8

The name of the function with blob name and storage account connections will be set as default & click->create for creating the function.

Blob trigger

Step 9

select->integrate and click for expanding the documentation and make note down of both account name and the account key so that we can use them in the azure storage explorer.

Azure Storage Account

Step 10

Now run the Azure storage explorer and select-> use a storage account name &key and click->next

Azure storage explorer

Step 11

Now note down the details of both account names and the key that is copied from the function documentation and click->next.

Attach External Storage

Step 12

click->connect and now we need to create a new blob storage, for that expand the storage account and click->create blob rename the blob storage and press enter.

blog storage

create blog connector

Step 13

The blob storage is set and we can upload the file to the storage.

Step 14

Click-> upload in storage explorer and click->upload files and select the type of the file you want to upload and click->upload.

Azure storage explorer

Azure storage explorer

Azure storage explorer

Step 15

Now we have successfully uploaded a file to the blob storage using functions application.

Thanks for reading and have a nice day


Similar Articles