Meraki API import with Python Azure Function app

LFull
Conversationalist

Meraki API import with Python Azure Function app

I've been trying to use Azure functions to run the Meraki API requests with my Python script, but receive a HTTP 500 error. I suspect that this is due to the Meraki SDK not being installed on the virtual machine. Does anyone have experience with using Meraki API's with Azure function apps? If so what was you approach, and if anyone has a solution or questions on this issue please fire away!

 

Thanks!

4 Replies 4
SoCalRacer
Kind of a big deal

I am assuming you are using Python. This might be a good place to start.

 

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python

 

Another place to check is the NSG rules and see if anything might be blocking.

 

Last test would be try another known more open basic API

LFull
Conversationalist

Thanks @SoCalRacer I've tried the following, the main problem is importing Meraki with 

from meraki.meraki import Meraki
SoCalRacer
Kind of a big deal

This will fail some times depending on where the python script file is in relation to the sdk directory.

 

The 2 options I can suggest:

 

1- Write the code on your desktop and get comfortable with the layout of the sdk and script files

2- Make sure the python script you are running is located in the root of the sdk directory

Davekingphx
New here

Did you try including the Meraki SDK in the “requirements.txt” file for the Azure Function?  these packages get installed when you published to Azure.  

https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=application-l...

Get notified when there are additional replies to this discussion.