Not able to access the Api hosted in Azure ubuntu VM from different server

Rishabh 0 Reputation points
2024-06-14T07:00:33.7366667+00:00

Hi,
My API Code :

from flask import Flask, jsonify, request


app = Flask(__name__)


@app.route('/', methods=['GET'])
def test():
    return (jsonify({"path":"hello"}))


if __name__ == '__main__':
    # app.run(debug=True)
    app.run(debug=True, host='0.0.0.0' port=9200)

I am running this api code from a virtual environment created from terminal.
Problem I am facing : I am able to access this api endpoint from the postman, browser but when i am accessing the api from different server from a laravel ui hosted in cpanel. It is thowing an error i.e.

cURL error 7: Failed to connect to xx.xxx.xx.xxx port 9200: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://xx.xxx.xx.xxx:9200

User's image

User's image

Also, I have allowed few inbound rules, i.e.
User's image

Can someone please let me know what i am missing

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,586 questions
0 comments No comments
{count} votes