How to Fetch Azure Key Vault Secret Value Config Content and use it in ServiceNow Pattern Steps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2026 02:23 PM - edited 10-01-2026 02:24 PM
End Goal: Create a relationship between an application server and a database server.
Challenge: A configuration file is hiding the DB Connection String in an external Azure Key Vault Secret. The configuration file has reference to the Key Vault URI and Key Vault Secret Name for retrieval, but I don't know how to fetch the secret content containing the connection string, port number & database name for use in my custom pattern.
What configurations and/or integrations are required on the ServiceNow side to securely retrieve secrets from an external Azure Key Vault (AKV)? Specifically, we need to access an AKV secret that contains the database connection details, including the Connection String, Port Number, and Database Name, for use within a Service Mapping Discovery Pattern. The retrieved values will be used to identify the target database and establish the appropriate relationship between the application server and the database server in the CMDB
Note, this is not relating to username/password retrieval, instead it's more related to Configuration Data retrieval.
Thanks,
Louie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Luigi2 ,
For this you need to create a seperate connection section in the pattern. In that connection section , Create a step which will locate the Config file by using the Parse File Operation, Once the file is retrieved, you can use the parsing method in that same step, and verify whether your database name, port and secret key is present or not, if those values are not empty means ., you can proceed with creating a connection..
If you find this useful., Please mark this as Helpful and Accept my Solution..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi Tera,
The issue is not the parsing. The issue is how to retrieve the connect string that is hidden and stored in an Azure Key Vault Secret. Once I have that string, then I can parse it and create a connection operation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Luigi2 Read that Config file -Open Pattern in Debug Mode
Parse the file like This-
And then Create Connection. You can refer OOTB Connection Section for more inputs.
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi RP,
In your example, the values are visible, which is simple enough to parse. In my case, the values are not visible, therefore I have to fetch the values in the Azure Key Vault using a Secret Key defined in a JSON file.
Here is an example of how my config json file looks like...
"KeyVaultUri": "https://kv-ppr-xyz-app-cc-01.vault.azure.net/",
"AllowedCorsOrigins": [
"https://app-ppr.edc.ca"
],
"Database": {
"ConnectionString": "[***AKV-SECRET***]"I need to use KeyVaultUri": "https://kv-ppr-xyz-app-cc-01.vault.azure.net/" to access database connection string in Azure Key Vault and pass the Secret Key shown in the JSON file which in this case is "Database--ConnectionString". This should return connection string value from the Azure Key Vault and then I can parse it.
Example of what to pass to Azure Key Vault and what will be returned:
Pass <secret_name>:<key_vault_name>:
kv-ppr-xyz-app-cc-01:Database--ConnectionString
Return:
db0001,1433
Louie