Azure Function Blob Trigger [Python] V2

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 81

  • @user-tl2oc2hl7e
    @user-tl2oc2hl7e 10 місяців тому +4

    Great Video. Azure Function Python V2 Programming model has very limited videos other than just basic. I will greatly appreciate more videos' for advanced use cases.

    • @pytalista
      @pytalista  10 місяців тому

      Thanks, will do!

  • @jasonluna5893
    @jasonluna5893 Місяць тому +1

    Great Video! I was stuck on the how to get the Path variable and you demonstrated it perfectly. The documentation still doesn't have it.

  • @zahraelhaddi6980
    @zahraelhaddi6980 24 дні тому +1

    if the function doesnt work and it keeps getting nothing, the solution might be going to your funtionApp on Azure, and go to environment variables , and then try to add the connection name as a key and the connection string of your storage account as a value , and it will work.

  • @japarradog
    @japarradog 6 місяців тому +1

    🎯 Key Takeaways for quick navigation:
    00:00 🤖 *Introducción a Azure Function Blob Trigger*
    - Pedro presenta el tema de Azure Function Blob Trigger, destacando su utilidad y la importancia de los disparadores (triggers) en las funciones de Azure.
    - Los disparadores son esenciales para el funcionamiento de las funciones de Azure, marcando el inicio de estas.
    - Ejemplos de escenarios de uso para el blob storage trigger, como el procesamiento de imágenes en aplicaciones web.
    02:02 💻 *Configuración inicial y requisitos*
    - Descripción del entorno de desarrollo utilizado, incluyendo Visual Studio Code en WSL Ubuntu y la instalación de herramientas necesarias.
    - Proceso para crear una cuenta de almacenamiento en Azure y la importancia de la extensión de Azure en VS Code.
    - Preparativos previos al desarrollo, como la instalación de Python y la configuración de una cuenta de almacenamiento en Azure.
    05:37 🛠️ *Creación y configuración de la función Blob Trigger*
    - Paso a paso para crear la función Blob Trigger, incluyendo la configuración del string de conexión y la especificación del path del contenido.
    - Estrategias para hacer dinámico el path de los archivos a procesar, usando comodines para filtrar por tipo de archivo.
    - Demostración de la creación de un contenedor y una carpeta dentro de la cuenta de almacenamiento de Azure para almacenar los archivos a procesar.
    09:29 🚀 *Ejecución y prueba de la función*
    - Demostración de la ejecución local de la función, incluyendo la carga de archivos CSV y la observación de la activación automática de la función.
    - Implementación de un programa de prueba para generar y cargar múltiples registros de ventas a Azure Storage, demostrando la funcionalidad de la función Blob Trigger en tiempo real.
    - Conclusiones finales, invitación a suscribirse al canal y sugerencias para futuros temas relacionados con Azure Functions y storage triggers.
    Made with HARPA AI

    • @pytalista
      @pytalista  5 місяців тому

      Thanks for this ! Gracias

  • @vladimirshapran7286
    @vladimirshapran7286 2 місяці тому +1

    Great video, the only problem I have, after I have deployed my app it doesn't respond to new file uploaded to the blob

    • @pytalista
      @pytalista  2 місяці тому

      Have tested locally ? Did it work?

  • @roxanedebruyker2591
    @roxanedebruyker2591 3 місяці тому

    Thanks for the video, very nicely done!
    It did not work at first for me because I had to specify in my local.settings.json the connection string to AzureWebJobsStorage.
    Also, the path in function_app did not require the storage account name but only the blob container name. Which ended up to be "blob_container_name/{name}" (I wanted my function to get triggered no matter if I would receive a csv or not; otherwise it would have been "blob_container_name/{name}.csv"

    • @pytalista
      @pytalista  3 місяці тому +1

      Well done Roxane. Great it worked in the end. Life of a programmer 🧑‍💻😀

  • @dailycrypto123
    @dailycrypto123 5 місяців тому +1

    You saved my life! thank you

  • @srikrishnabhargavgollapudi5340
    @srikrishnabhargavgollapudi5340 Місяць тому +1

    I have encountered an error called "No job function found". Can I get some help in this regard please?

    • @pytalista
      @pytalista  Місяць тому

      Make sure you follow all pre requisites. Installations and etc.

  • @rudrasingh2850
    @rudrasingh2850 2 місяці тому +1

    hey, its really great video. can we achieve blob trigger using service principle?? if data get loaded in blob storage our blob trigger will run..

    • @pytalista
      @pytalista  2 місяці тому

      A blob trigger is an event driven action. So whenever a blob arrive at a particular location a function will be triggered. Service principle are to grant access to resources. So a blob trigger is independent of service principle. Seu you have a service principal that you want access to your storage account you can do that for sure. 👍🏻

  • @antonietapintorebelo5020
    @antonietapintorebelo5020 5 місяців тому +1

    Hi Pedro, I have a question, are you a Data Engineer? Also, thank you so much for the video. There isn't alot of Azure videos out there, but Azure for a Data Engineer perspective can be one of the best cloud platforms to use. Keep it up!

    • @pytalista
      @pytalista  5 місяців тому +1

      Hi. Yes I am a Data Engineer

    • @antonietapintorebelo5020
      @antonietapintorebelo5020 5 місяців тому +1

      @@pytalista same here! I'm building a data pipeline that scraps pdf files from an email using logic app and function app. I am using HTTP trigger for function app, but its not the best one for it. The blob trigger is best so that when the pdf file lands in the container, it gets triggered

    • @pytalista
      @pytalista  5 місяців тому

      @@antonietapintorebelo5020 Good job !

  • @respect-shorts9
    @respect-shorts9 8 місяців тому +1

    Sir your video is helpful and informative but please don't put background music 🙏

    • @pytalista
      @pytalista  8 місяців тому

      Only the intro. My best video has loud music all the way. Go figure.

  • @paulmartin8856
    @paulmartin8856 7 місяців тому

    Really helpful video, thanks!

  • @user-kv9si5qj9x
    @user-kv9si5qj9x 9 місяців тому +1

    Very informative video can you also make a same Blob trigger video using Azurite. It will be very helpful.

    • @pytalista
      @pytalista  9 місяців тому

      Sure. If you watch the durable function one it uses azurite

    • @pytalista
      @pytalista  9 місяців тому +1

      Actually it does not. Ok I will do a video.

  • @fitchmultz
    @fitchmultz 2 місяці тому +1

    The music is too loud in the background

    • @pytalista
      @pytalista  2 місяці тому +1

      Thanks for the feedback. Please like and subscribe

  • @HT-ic1bu
    @HT-ic1bu 7 місяців тому +2

    Could you please show in detail how you were able to create those records as new file in the blob storage and share your code, so I could try to imitate the process and take it from there. Thanks

    • @pytalista
      @pytalista  6 місяців тому

      This is great idea. I will do a quick video about it and publish the code in github

    • @HT-ic1bu
      @HT-ic1bu 6 місяців тому +1

      @@pytalistaThank you. I'd really appreciate that.
      In my use case, I need Azure Function to fetch a file from blob storage, perform operations, save pdf pages as jpg, and then either rename the original file or save the renamed file in another folder on blob storage. I'm struggling with connecting to and writing back onto the blob storage, and the documentation hasn't been helpful.

    • @pytalista
      @pytalista  6 місяців тому

      Here is the video ua-cam.com/video/LxEh2g6q92o/v-deo.htmlsi=RKin42UY0Mxe_QeE 😀

    • @HT-ic1bu
      @HT-ic1bu 6 місяців тому +1

      @@pytalista that was quick. Really appreciate it. Thanks !!!!!!!

    • @pytalista
      @pytalista  6 місяців тому

      👍🏻

  • @SAHITHTHATIPALLI
    @SAHITHTHATIPALLI 3 місяці тому +1

    Hi, I am facing a small issue. I do want to explicitly mention the container name in the code. could you please help me with that..?

    • @pytalista
      @pytalista  3 місяці тому

      Hi, if you want explicitly is easy. Just put the full blob name. I uploaded the code in the repository github.com/pedrojunqueira/PytalistaYT/blob/master/Python/storage_trigger/function_app.py

    • @SAHITHTHATIPALLI
      @SAHITHTHATIPALLI 3 місяці тому +1

      @@pytalista i do not want to explicitly memtion it. Currently I am using environmental variables.

    • @pytalista
      @pytalista  3 місяці тому

      @@SAHITHTHATIPALLI Ok good.

  • @diyakhajuria2478
    @diyakhajuria2478 Місяць тому +1

    Is there any specific reason why the blob size comes out as None everytime? I have a use case which extends blob trigger to call a search service on newly added/modified files, and I'm getting blob not found 404 error 😑 despite the blob being there in my container. Thank you for the video though, it confirmed I'm not doing something astronomically wrong 😂!

    • @pytalista
      @pytalista  Місяць тому

      No worries Thanks. Hard to tell without more context. 404 is a not found error. If you follow the tutorial should work exact the same.

    • @diyakhajuria2478
      @diyakhajuria2478 Місяць тому +1

      @@pytalista Oh yes, I had to implement custom logic for my use case, so the code was quite different. The storage account I was trying to access did not allow anonymous access and an incorrect request URL was being generated. All in all, Blob was not found. I was able to debug it. Your video set a great precedent, thank you for replying.

    • @pytalista
      @pytalista  Місяць тому

      @diyakhajuria2478 great work. Happy it helped.

  • @gcunha
    @gcunha 2 місяці тому +1

    thanks!

  • @manavkumar1071
    @manavkumar1071 Місяць тому

    When pressing F5 button it is giving error in launch json with exit code 1" The terminal process "/bin/bash '-c', '. . venv/bin/activate && func host start' " terminated with exit code 1

    • @pytalista
      @pytalista  Місяць тому

      make sure you all the requisite covered. All the installations and your environment is set correctly.

    • @manavkumar1071
      @manavkumar1071 Місяць тому

      @@pytalista I am working on codespace is that making difference??

    • @pytalista
      @pytalista  Місяць тому

      @manavkumar1071 i don’t know what is code space. Probably it is. They to configure on your local computer.

  • @mateuszwojcik8512
    @mateuszwojcik8512 7 днів тому +1

    It is a very greate video. I was looking for very long time for a video like that. Thank you! My code works perfectly when i run it on Visual Studio. But it is not triggered on Azure. Is there any special thing I need to do more? Code is deployed on Azure. I can see the updated code on Azure. Connection strings in Environment Variables are correct. When I run code in Azure I get 202 response. But I get no logs. There are no invocations on Azure.

    • @mateuszwojcik8512
      @mateuszwojcik8512 7 днів тому +1

      There is no question :). I have figured it out. My connection was connection="BlobStorageConnectionString" and i did not add it to Environments variables. Stupid error.

    • @pytalista
      @pytalista  4 дні тому

      Awesome. Great it worked

    • @pytalista
      @pytalista  4 дні тому

      Great to hear! Below you sorted out. Cheers

  • @cadencechen7081
    @cadencechen7081 10 місяців тому +1

    this video is great. Can you also do a video talk about the output? I am using a blob trigger templet and process the blob in openai , but I have a problem to store the openai response into blob storage. I am appreciated if you do a video about handling the output. The Azure documentation is unclear.

    • @pytalista
      @pytalista  10 місяців тому

      Hi @cadencechen7081 I think this is a great idea. I will consider.

    • @HT-ic1bu
      @HT-ic1bu 7 місяців тому +1

      I'd really like to see this as well

  • @quinsterggroenewoud.3459
    @quinsterggroenewoud.3459 7 місяців тому

    so helpful, thanks!

  • @SAHITHTHATIPALLI
    @SAHITHTHATIPALLI 4 місяці тому +1

    Hi, the video was very helpful for my POC. Thanks for that. can I know how to give multiple file patterns for example pdf and csv for the blob trigger to happend. I am trying this one but its not working. Moreover are there any restrictions on the file name patters as one of my blob name contains a space between the words and a curl brackets. I would really appreciate if you can provide the solution. Thanks in advance

    • @pytalista
      @pytalista  4 місяці тому

      Hi check the blob name patterns documentation. learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-python#blob-name-patterns

    • @pytalista
      @pytalista  4 місяці тому

      What you can do is get the file name and then apply different actions depending on the extension. like if it is .csv do this if it is such and such do that... cheers

    • @SAHITHTHATIPALLI
      @SAHITHTHATIPALLI 4 місяці тому

      Thanks for the response. Is it possible to give multiple blob names to trigger the function.?!

    • @pytalista
      @pytalista  4 місяці тому +1

      @@SAHITHTHATIPALLI You can give one name that is going to get the blob name or a pattern. As I said. If you want to manage multiple use cases. Get the name of the incoming blob and handle it separately in a function.

    • @SAHITHTHATIPALLI
      @SAHITHTHATIPALLI 4 місяці тому +1

      @@pytalista Thank you

  • @rosscortb
    @rosscortb 5 місяців тому

    Please would you consider extending this video to include the CSV file being converted to xlsx saved to an output container?

    • @pytalista
      @pytalista  5 місяців тому

      Hi @rosscortb
      you just need to change you small thing if the code
      instead of df.to_csv(f, index=False)
      you do a df.to_excel(f, index=False)
      Here is the code github.com/pedrojunqueira/load_table_data_lake/blob/master/load_data_to_folder.py
      look at line 89.
      Cheers

    • @rosscortb
      @rosscortb 5 місяців тому +1

      @@pytalista I've managed to get a function app that works for me. I have deployed and added it to a pipeline. It starts by copying an oracle query to csv and then the function app coverts it. When adding the function app to the pipeline, it asks for a method - Select API Method. I assume its Post but then it requires a body? Any ideas what to put here? thanks

    • @pytalista
      @pytalista  5 місяців тому

      @@rosscortb I need a bit more context. A POST request is usually when you want to change an object in your API. in the body you pass a "payload" in JSON format. I need to see the code to understand better. If you are using a blog trigger you do not need to put in a pipeline (you mean data factory?) it triggers when a new blob arrives in the folder you specify.

  • @TechDaddyM
    @TechDaddyM 7 місяців тому +1

    this music my dude LOL

    • @pytalista
      @pytalista  6 місяців тому

      Liked ?

    • @benkay157
      @benkay157 6 місяців тому

      @@pytalista nope, please remove the music on your videos

    • @pytalista
      @pytalista  6 місяців тому

      There is no music just intro

    • @benkay157
      @benkay157 6 місяців тому

      That intro is too loud and irritating

    • @pytalista
      @pytalista  6 місяців тому

      Irritating like you ?

  • @chetanmeena4555
    @chetanmeena4555 6 місяців тому +1

    Can you help me with one azure function in python?
    i am not able to deploy it . @pytalista

    • @pytalista
      @pytalista  6 місяців тому

      Where are you stuck ?