I was working on a scenario in which I need to create a node.js application having a Azure Function App function which will trigger when ever a particular container of a particular storage app get file/s or any change in uploaded files.
Let create all these from scratch
Extensions
- first you need to install some Azure extensions
These extensions will help you later in application
Create Storage & Function app
- now got to the Azure icon on left sidebar and create a function using plus icon
- Select language
- Select Azure Blob Storage Trigger
- Set name for function
- Select storage from where you will upload file. if you hasn't create a storage let create first.
- Creating Storage on Azure dashboard
- Set name for storage and you will get this output
- We need to create function app also in Azure dashboard so let create it that one first
- Now let continue with creating function, after creating function in VS code you will get this file structure
- Now lets upload the function to our Azure dashboard Function App. 12.Right click on the local function folder and click on deploy to function app
- You can check/verify that the local workplace function is up on Azure dashboard
- In local.setting.json file you will find object having some key values, to add the value of key **AzureWebJobStorage **you need the connection string.
- Go to storage app account you created earlier and go to access key option in left menu. Copy connection string and past in local.setting.json file object
Their will be a file name function.json in folder which you created for function app that file will have config about from which container the function will connect and trigger whenever the file upload/update.
- Let create a container in our storage app while creating a container name will be same as we define in function app funcion.json file path key
lastly open the VS code terminal and run the command func host start. After start the server go to the container in Azure dashboard and try to upload a file in it. After upload successful you will get the output on function terminal which you can check on VS code terminal
Follow for more https://linktr.ee/zaahmed
Top comments (0)