Hi,
I have an azure sql database in a one subscription. Iam using my AML compute for development (which is in other subscription). A user managed identity is attached to my compute.

A user name with exactly the same name as the identity is added to the SQL:
In firewall setting, a rule is added with my computer public Ip Address:

The user managed identity is in AAD:

NOTE: The azure SQL database and servers are in a VNET.
I am using the following code to access the database:
connstr = f"Driver={{ODBC Driver 18 for SQL Server}};Server={server};Database={database};Authentication=ActiveDirectoryMsi;UID=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx63;"
conn = pyodbc.connect(connstr)
But in odbc.logs I see following errors:

The error basically says that It fails to authenticate the user UID (which is basically the object ID of the managed identity) in Active Directory. Because couldn't get the access token.
Can someone please help?