title: Error in Azure SQL Server Database connection using Azure Function for python with ActiveDirectoryMSI Authentication
body: <p>I am trying to connect the Azure SQL Database from Azure functions for python using ActiveDirectoryMSI Authentication.</p>
  
  <p>Please check the below code:-</p>
  
  <pre><code>import logging
  from . import hy_param
  import sys
  import pyodbc
  import azure.functions as func
  
  
  def main(req: func.HttpRequest) -&gt; func.HttpResponse:
      logging.info('Python HTTP trigger function processed a request.')
      try:
          connection = pyodbc.connect('driver={%s};server=%s;database=%s;Authentication=ActiveDirectoryMSI' % (hy_param.sql_driver, hy_param.server_name, hy_param.database_name))
          sql_db = connection.cursor()
          logging.info("MSSQL Database Connected")
      except Exception as e:
          return func.HttpResponse(f"Error in sql database connection : {e}", status_code=400)
          sys.exit()
      return func.HttpResponse(
              "Database Connected",
              status_code=200
      )
  </code></pre>
  
  <p>Please check the below Error :-</p>
  
  <pre><code>Error in sql database connection : ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate] (-1) (SQLDriverConnect)')
  </code></pre>
  
  <p>Is there any way to connect Azure, SQL Database from Azure functions using ActiveDirectoryMSI?</p>