I am very new to Azure, so please go easy on me here.
I recently deployed a Python/Django app onto Azure. In the app, I use the Python library urllib
to retrieve a file on the internet via its URL. I know the code is correct because the app works locally, but when I deploy it on Azure, the request is met by a 403 error which crashes the app: urllib.error.HTTPError: HTTP Error 403: Forbidden
Reading around, such as here, it seems that Azure blocks urllib
requests. So, I created a custom Web App Firewall (WAF) policy where I disabled all firewall rules, and miraculously the app started working! This is obviously not a permanent solution, so I'm asking if someone can help with one of the following, any of which should solve my issue:
- Can someone tell me specifically which WAF rule, from this Pastebin list, is the one blocking urllib requests? I can't find any documentation or description, beyond the short label, that explain what they do?
- Is there a way I can create a WAF exclusion for
urllib
requests? - Is there an alternative to using
urllib
that doesn't run into Azure firewall issues?
Once again, I am very new to how Azure works, and I'm not too familiar with how urllib
works either, so if you do reply (and thank you if you do), please explain stuff to me simply :)