Skip to main content

MSSQL

This check will try to connect to a specified SQL Server database, run a query against it and verify the results.

apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: mssql-check
spec:
interval: 30
mssql:
- name: mssql pass
url: "server=mssql.default.svc;user id=$(username);password=$(password);port=1433;database=master"
username:
valueFrom:
secretKeyRef:
name: mssql-credentials
key: USERNAME
password:
valueFrom:
secretKeyRef:
name: mssql-credentials
key: PASSWORD
query: SELECT 1
results: 1
FieldDescriptionSchemeRequired
urlConnection string to connect to the SQL Server serverstringYes
queryquery that needs to be executed on the serverstringYes
resultsNumber rows to check forintYes
*All other common fieldsCommon
Connection
connectionPath of existing connection e.g. connection://mssql/instance/ Mutually exclusive with username, passwordConnection
usernameMutually exclusive with connectionEnvVar
passwordMutually exclusive with connectionEnvVar
urlIf the url is specifed in both the connection and in the url field, the field takes precedence