# Connecting to AzureSQL using Microsoft Entra ID

**URL:** <https://forum.liquibase.org/t/connecting-to-azuresql-using-microsoft-entra-id/9752>\
**Category:** Liquibase Development\
**Created:** [September 12, 2024, 1:29pm UTC](https://forum.liquibase.org/t/connecting-to-azuresql-using-microsoft-entra-id/9752 "2024-09-12T13:29:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amoz](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@amoz](https://forum.liquibase.org/u/amoz)\
**Post date:** [September 12, 2024, 1:29pm UTC](https://forum.liquibase.org/t/connecting-to-azuresql-using-microsoft-entra-id/9752/1 "2024-09-12T13:29:21Z")

</div>

I’m a new user and my goal is to use Microsoft Entra ID to manage my AzureSQL database

I have setup my properties like this:  
changelogFile: changelog.xml  
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver  
url: jdbc:sqlserver://.database.windows.net:1433;database=;encrypt=true;trustServerCertificate=false;hostNameInCertificate=\*.database.windows.net;loginTimeout=30;Authentication=ActiveDirectoryDefault  
log-level: info

and copied liquibase-azure-deps-4.29.2.jar to C:\Program Files\liquibase\lib

If I run the command:  
liquibase generateChangeLog --changeLogFile=changelog.xml

It fails with:  
Starting Liquibase at 15:20:26 using Java 21.0.4 (version 4.29.2 #3683 built at 2024-08-29 16:45+0000)  
Liquibase Version: 4.29.2  
[2024-09-12 15:20:26] INFO [liquibase.ui] Liquibase Version: 4.29.2  
Liquibase Open Source 4.29.2 by Liquibase  
[2024-09-12 15:20:26] INFO [liquibase.ui] Liquibase Open Source 4.29.2 by Liquibase  
[2024-09-12 15:20:26] INFO [liquibase.integration] Starting command execution.  
[main] INFO com.azure.identity.ChainedTokenCredential - Azure Identity =\> Attempted credential EnvironmentCredential is unavailable.  
[main] INFO com.azure.identity.ChainedTokenCredential - Azure Identity =\> Attempted credential WorkloadIdentityCredential is unavailable.  
[main] WARN reactor.core.Exceptions - throwIfFatal detected a jvm fatal exception, which is thrown and logged below:  
java.lang.NoSuchMethodError: ‘com.microsoft.aad.msal4j.AbstractApplicationBase$Builder com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder.logPii(boolean)’

Changing the URL to ‘Authentication=ActiveDirectoryInteractive’ and running the same command again opens the browser window and successfully executes

If I set the environment variables AZURE\_TENANT\_ID, AZURE\_CLIENT\_ID, AZURE\_CLIENT\_SECRET and try again with ‘Authentication=ActiveDirectoryDefault’ it throws another exception

[main] INFO com.azure.identity.EnvironmentCredential - Azure Identity =\> EnvironmentCredential invoking ClientSecretCredential  
[main] WARN reactor.core.Exceptions - throwIfFatal detected a jvm fatal exception, which is thrown and logged below:  
java.lang.NoSuchMethodError: ‘boolean com.azure.core.credential.TokenRequestContext.isCaeEnabled()’

Since this is intended to be used in CI/CD I cannot use Interactive authentication, and since this is the only one that works, I am not sure on how to proceed.

I have also tried it using Docker, and results are the same. Dockerfile below

FROM liquibase/liquibase:latest

COPY ./liquibase.properties /liquibase/liquibase.properties  
COPY ./liquibase-azure-deps-4.29.2.jar /liquibase/lib/liquibase-azure-deps-4.29.2.jar

ENTRYPOINT [“liquibase”]  
CMD [“generateChangeLog”, “–changeLogFile=changelog.xml”]

Any input is appreciated
