Establishing a Connection
Creating a JDBC Data Source
You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Azure Analysis Services consists of three basic steps:
- Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
- Provide the driver class. For example:
- Provide the JDBC URL. For example:
jdbc:aas:URL=asazure://southcentralus.asazure.windows.net/server; or jdbc:cdata:aas:URL=asazure://southcentralus.asazure.windows.net/server;
The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:aas:" or "jdbc:cdata:aas:" and can include any of the connection properties in name-value pairs separated with semicolons.
Connecting to Azure Analysis Services
To connect, set the Url property to a valid Azure Analysis Services server, for instance, asazure://southcentralus.asazure.windows.net/server, in addition to authenticating.
Optionally, set Database to distinguish which Azure database on the server to connect to.
Authenticating to Azure Analysis Services
Authenticating using Azure AD
Azure AD is a connection type that goes through OAuth. Set your AuthScheme to AzureAD and see Using OAuth Authentication for an authentication guide.
Authenticating using Azure Service Principal
Azure Service Principal is a connection type that goes through OAuth. Set your AuthScheme to AzureServicePrincipal and see Using Azure Service Principal Authentication for an authentication guide.
Authenticating using MSI Authentication
If you are running Azure Analysis Services on an Azure VM, you can leverage Managed Service Identity (MSI) credentials to connect:
- AuthScheme: Set this to AzureMSI.
The MSI credentials will then be automatically obtained for authentication.
Authenticating using Azure Password
To connect using your Azure credentials directly, specify the following connection properties:
- AuthScheme: Set this to AzurePassword.
- User: Set this to your user account you use to connect to Azure.
- Password: Set this to the password you use to connect to Azure.