To use Artifactory with an MSSQL database, adding a GO connection URL is required in order to connect to the metadata service.
Note:
Applying these changes can be done by using the below helm upgrade command (depending on the helm chart you are using – artifactory, artifactory-ha or JFrog platform):
Artifactory:
helm upgrade –install artifactory jfrog/artifactory –namespace artifactory -f values.yaml
Artifactory HA:
helm upgrade –install artifactory-ha jfrog/artifactory-ha –namespace artifactory-ha -f values.yaml
Jfrog-platform:
helm upgrade --install jfrog-platform --namespace jfrog-platform jfrog/jfrog-platform -f values.yaml
Note:
- Pre-start command downloads the driver and places it in /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib/ so it can be used by the Artifactory.
- We also use extraEnvironmentVariables to override the metadata.URL in the system.yaml to connect to the database using GO because common error is when the database password inside of the Go connection string's metadata.database.url is not encrypted after startup.
postgresql: enabled: false waitForDatabase: false database: type: mssql driver: com.microsoft.sqlserver.jdbc.SQLServerDriver url: 'jdbc:sqlserver://<db-hostname>:1433;databaseName=artifactory;authentication=NotSpecified;encrypt=false;sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository;' user: 'artifactory' password: 'password' artifactory: extraEnvironmentVariables: - name: JF_METADATA_DATABASE_URL value: "go:sqlserver://artifactoryuser:password@IP-ADDRESS:1433/MSSQLSERVER?database=artifactory" preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib; cd /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib && curl -L https://github.com/microsoft/mssql-jdbc/releases/download/v11.2.0/mssql-jdbc-11.2.0.jre17.jar -o /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib/mssql-jdbc-11.2.0.jre17.jar"
Applying these changes can be done by using the below helm upgrade command (depending on the helm chart you are using – artifactory, artifactory-ha or JFrog platform):
Artifactory:
helm upgrade –install artifactory jfrog/artifactory –namespace artifactory -f values.yaml
Artifactory HA:
helm upgrade –install artifactory-ha jfrog/artifactory-ha –namespace artifactory-ha -f values.yaml
Jfrog-platform:
helm upgrade --install jfrog-platform --namespace jfrog-platform jfrog/jfrog-platform -f values.yaml