Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 5.86 KB

File metadata and controls

75 lines (50 loc) · 5.86 KB
title Application Development Overview
description Learn about available connectivity libraries and best practices for applications connecting to Azure SQL Database and Azure SQL Managed Instance.
titleSuffix Azure SQL Database & Azure SQL Managed Instance
author dzsquared
ms.author drskwier
ms.reviewer wiassaf, mathoma
ms.date 11/14/2019
ms.service sql-database
ms.subservice development
ms.topic conceptual
ms.custom sqldbrb=2
monikerRange = azuresql || = azuresql-db || = azuresql-mi

Application development overview - SQL Database & SQL Managed Instance

[!INCLUDE appliesto-sqldb]

This article walks through the basic considerations that a developer should be aware of when writing code to connect to your database in Azure. This article applies to Azure SQL Database, and Azure SQL Managed Instance.

Language and platform

You can use various programming languages and platforms to connect and query Azure SQL Database. You can find sample applications that you can use to connect to the database.

You can leverage open-source tools like cheetah, sql-cli, VS Code. Additionally, Azure SQL Database works with Microsoft tools like Visual Studio and SQL Server Management Studio. You can also use the Azure portal, PowerShell, and REST APIs help you gain additional productivity.

Authentication

Access to Azure SQL Database is protected with logins and firewalls. Azure SQL Database supports both SQL Server and Azure Active Directory authentication users and logins. Azure Active Directory logins are available only in SQL Managed Instance.

Learn more about managing database access and login.

Client connections

In your client connection logic, override the default timeout to be 30 seconds. The default of 15 seconds is too short for connections that depend on the internet.

If you are using a connection pool, be sure to close the connection the instant your program is not actively using it, and is not preparing to reuse it.

Avoid long-running transactions because any infrastructure or connection failure might roll back the transaction. If possible, split the transaction in the multiple smaller transactions and use batching to improve performance.

It's possible to connect your application to your Azure SQL resource by using the following languages:

It's possible to configure Azure AD authentication to your Azure SQL resource. Review the following articles for more information:

Resiliency

Azure SQL Database is a cloud service where you might expect transient errors that happen in the underlying infrastructure or in the communication between cloud entities. Although Azure SQL Database is resilient on the transitive infrastructure failures, these failures might affect your connectivity. When a transient error occurs while connecting to SQL Database, your code should retry the call. We recommend that retry logic use backoff logic, so that it does not overwhelm the service with multiple clients retrying simultaneously. Retry logic depends on the error messages for SQL Database client programs.

For more information about how to prepare for planned maintenance events on your Azure SQL Database, see planning for Azure maintenance events in Azure SQL Database.

Network considerations

Next steps

Explore all the capabilities of SQL Database and SQL Managed Instance.

To get started, see the guides for Azure SQL Database and Azure SQL Managed Instances.