Skip to content

Download Azure Identity And AKV Dependencies with Apache Maven

lilgreenbird edited this page Sep 15, 2020 · 1 revision

The Microsoft JDBC Driver for SQL Server has 2 compile time dependencies:

  • azure-security-keyvault : Azure Key Vault Secret client library for Java for Always Encrypted Azure Key Vault feature (optional).
  • azure-identity : Azure Identity client library for Java for Azure Active Directory Authentication feature and Azure Key Vault feature (optional).

Those 2 dependencies are not required at run time if users do not use Azure Key Vault or Azure Active Directory Authentication. However, if users want to use those features, they need to download the dependencies and include them into their classpath.

Steps to download dependencies with Apache Maven:

  1. Download and install Apache Maven
  2. Download the Microsoft JDBC Driver for SQL Server from GitHub, there is a file called pom.xml in the root directory. It contains all the dependency definitions
  3. In pom.xml file, all dependencies are listed in <dependencies>...</dependencies> block. Comment out all test dependencies and keep azure-security-keyvault and azure-identity intact. In this case, it will download both azure-security-keyvault and azure-identity and their dependencies as well.
  4. Open Terminal/CMD and cd to the directory that contains pom.xml, run command <maven_installation_path>/bin/mvn dependency:copy-dependencies. It will download all the dependencies into target/dependency folder. Now, you have all the dependencies you need to use Azure Key Vault and Azure Active Directory Authentication feature