# How run t-sql commands on Azure SQL databases

**URL:** <https://forum.ansible.com/t/how-run-t-sql-commands-on-azure-sql-databases/35531>\
**Category:** Ansible Developer\
**Tags:** azure\
**Created:** [July 21, 2021, 7:34am UTC](https://forum.ansible.com/t/how-run-t-sql-commands-on-azure-sql-databases/35531 "2021-07-21T07:34:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grant\_Sutcliffe](https://avatars.discourse-cdn.com/v4/letter/g/858c86/32.png) [@Grant\_Sutcliffe](https://forum.ansible.com/u/Grant_Sutcliffe)\
**Post date:** [July 21, 2021, 7:34am UTC](https://forum.ansible.com/t/how-run-t-sql-commands-on-azure-sql-databases/35531/1 "2021-07-21T07:34:02Z")

</div>

We need to run a series of T-SQL statements (to create database objects and inert data) on an Azure SQL databases (not Managed Instance database flavour).

We successfully tested that we can and run the sql commands from the Linux VM having installed odbc drivers.

However, we get connection timeout errors when we try to run the sql scripts using Ansible, from the same Linux VM.

Ansible uses ssh (port 22) to connect to remote hosts. SQL server communicates on Port 1433.

Is what we are trying to do supported by Ansible?  
If supported, please could someone point us to how this can be achived.  
Thank you
