Azure Functions App

I'm having issues deploying a python script to Azure Function App. I've developed it to handle some simple repetitive tasks using the API but am running into issues. I have a ticket in to support but was wondering if anyone else had experience using an HTTP triggered by Smartsheet webhook deployed to Azure.

Best Answer

  • Dennis Knipfer
    Dennis Knipfer ✭✭✭
    Answer ✓

    For anyone looking to perform a similar task, I'm providing an update:

    The error I was receiving clearly showed Smartsheet wasn't validating my API with "smart = smartsheet.Smartsheet(key)". This really boggled my mind for several days. Specifically, I got an error stating "...\Desktop\Smartsheet Scripts\Azure\.venv\lib\site-packages\smartsheet\smartsheet.py", line 163, in __init__  stack = inspect.stack()"

    Asking a coworker who is a better debugger than me led us to review the SDK documentation for the smartsheet.py module. The attached shows the section that was causing the problems. Working back from line 163 (noted in the error above), we found the SDK wasn't validating because there was no known user_agent. Jumping up to 117 we can see the user_agent default =none. Line 130 states Smartsheet recommends using the format "Appame/Version". I updated my verification line to "smart = smartsheet.Smartsheet(key, user_agent="pdpUpdate/1.0")" and had no issues.

    The script is now fully automated hosted as a serverless Azure Function App. When a sheet changes, MS Power Automate pings the HTTP, which in turn triggers this script to run and automatically perform the additions I need.


Answers

  • Dennis Knipfer
    Dennis Knipfer ✭✭✭
    Answer ✓

    For anyone looking to perform a similar task, I'm providing an update:

    The error I was receiving clearly showed Smartsheet wasn't validating my API with "smart = smartsheet.Smartsheet(key)". This really boggled my mind for several days. Specifically, I got an error stating "...\Desktop\Smartsheet Scripts\Azure\.venv\lib\site-packages\smartsheet\smartsheet.py", line 163, in __init__  stack = inspect.stack()"

    Asking a coworker who is a better debugger than me led us to review the SDK documentation for the smartsheet.py module. The attached shows the section that was causing the problems. Working back from line 163 (noted in the error above), we found the SDK wasn't validating because there was no known user_agent. Jumping up to 117 we can see the user_agent default =none. Line 130 states Smartsheet recommends using the format "Appame/Version". I updated my verification line to "smart = smartsheet.Smartsheet(key, user_agent="pdpUpdate/1.0")" and had no issues.

    The script is now fully automated hosted as a serverless Azure Function App. When a sheet changes, MS Power Automate pings the HTTP, which in turn triggers this script to run and automatically perform the additions I need.


  • Hi @Dennis Knipfer

    Thank you for providing your solution!

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions