AZURE VM connection issue

Amin Ghasemazar 1 Reputation point
2020-08-25T05:46:24.227+00:00

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/_computer_vision_client_operations.py", line 116, in analyze_image raise models.ComputerVisionErrorException(self._deserialize, response) azure.cognitiveservices.vision.computervision.models._models_py3.ComputerVisionErrorException: 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.
7,123 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Didier3001 971 Reputation points Microsoft Employee
    2020-08-25T09:58:55.09+00:00

    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:
    https://learn.microsoft.com/en-us/azure/virtual-network/security-overview#allowinternetoutbound

    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).
    https://learn.microsoft.com/en-us/azure/virtual-network/security-overview#inbound

    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:
    https://learn.microsoft.com/en-us/azure/network-watcher/diagnose-vm-network-traffic-filtering-problem

    --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

    Regards,
    Didier3001

    1 person found this answer helpful.