AZURE VM connection issue

Amin Ghasemazar 1 Reputation point

I have an script that calls AZURE's cv APIs and it's perfectly fine on all of my local machines, but when I ran it on the VM that I created from Data Science Virtual Machine- Ubuntu 18.04. it gives me this error:

File "/anaconda/envs/py37_default/lib/python3.7/site-packages/azure/cognitiveservices/vision/computervision/operations/", line 116, in analyze_image raise models.ComputerVisionErrorException(self._deserialize, response) Image URL is not accessible.

Seems like something is blocking the connection somehow?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,571 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Didier3001 891 Reputation points Microsoft Employee

    Hi @Amin Ghasemazar

    I would check your Network Security Group rules (builtin L3 / L4 firewall in Azure). Maybe the script tries to establish a connection outside of what is allowed by default.

    By default, all NSG allow outbound connectivity to the Internet:

    But, they don't allow any inbound connectivity outside these 3 default rules, which won't help you in this case since they are only there for internal communication (VNet, Load Balancer and Deny all).

    If you know the IP address the VM is trying to communicate with, you can use Network Watcher available in Azure that will help you identify the security rules that is preventing the connection:

    --I hope this helps. Please Accept it as an answer and "Up-Vote" the answer or message(s) that helped you so that it can help others in the community looking for help on similar topics