06 Aug 2025 10:03 AM
It seems impossible to pass credential vault content (e.g. user/password values) to a python extension so that it can be used in code.
I came across this post which describes how to add credential vault UI configuration, however this doesn't pass the actual content to the python extension, only the VAULT-ID is passed.
Does anyone know how I can e.g. get the username/password into my custom python extension?
Thanks
14 Aug 2025 03:49 PM
hey @r_weber I was just running into this for an api token I'm storing. the post by @Julius_Loman on this thread
https://community.dynatrace.com/t5/Extensions/Send-a-credential-from-credential-vault-to-extension/m...
did it for me. It all has to do with the activationSchema.json. Here's what he had configured:
it looks to me the key here is to have the credentialVaultId entry and then subsequent values have the property
{
"types": {
"dynatrace.datasource.python:credential_vault-endpoint": {
"type": "object",
"displayName": "Credential_vault Endpoint",
"summaryPattern": "Credential_vault",
"properties": {
"useCredentialVault": {
"displayName": "Use credential vault",
"type": "boolean",
"nullable": false,
"default": true,
"maxObjects": 1
},
"credentialVaultId": {
"displayName": "Select Vault credentials",
"nullable": true,
"type": "text",
"subType": "credential",
"referencedType": "USERNAME_PASSWORD",
"maxObjects": 1,
"precondition": {
"type": "EQUALS",
"property": "useCredentialVault",
"expectedValue": true
},
"constraints": [
{
"type": "NOT_BLANK"
}
]
},
"username": {
"displayName": "User Name",
"type": "text",
"nullable": false,
"default": "",
"precondition": {
"type": "EQUALS",
"property": "useCredentialVault",
"expectedValue": false
},
"constraints": [
{
"type": "LENGTH",
"minLength": 1,
"maxLength": 500
}
],
"maxItems": 1
},
"password": {
"displayName": "Password",
"type": "secret",
"nullable": false,
"default": "",
"precondition": {
"type": "EQUALS",
"property": "useCredentialVault",
"expectedValue": false
},
"constraints": [
{
"type": "LENGTH",
"minLength": 1,
"maxLength": 500
}
],
"maxItems": 1
}
}
},
"pythonRemote": {
"type": "object",
"properties": {
"endpoints": {
"displayName": "Credential_vault endpoint",
"type": "list",
"items": {
"type": {
"$ref": "#/types/dynatrace.datasource.python:credential_vault-endpoint"
}
},
"nullable": false,
"minItems": 1,
"maxItems": 100,
"metaData": {
"addItemButton": "Add endpoint"
}
}
}
},
"pythonLocal": {
"type": "object",
"properties": {
"endpoints": {
"displayName": "Credential_vault endpoint",
"type": "list",
"items": {
"type": {
"$ref": "#/types/dynatrace.datasource.python:credential_vault-endpoint"
}
},
"nullable": false,
"minItems": 1,
"maxItems": 100,
"metaData": {
"addItemButton": "Add endpoint"
}
}
}
}
},
"dynatrace": "1",
"description": "credential_vault configuration",
"schemaId": "python-extension.activation",
"displayName": "credential_vault configuration",
"ownerProductManagement": "dynatrace",
"ownerDevelopment": "dynatrace",
"maturity": "GENERAL_AVAILABILITY",
"allowedScopes": [
"tenant"
],
"multiObject": false,
"properties": {
"pythonLocal": {
"displayName": "Python Local Extension",
"type": {
"$ref": "#/types/pythonLocal"
}
},
"pythonRemote": {
"displayName": "Python Remote Extension",
"type": {
"$ref": "#/types/pythonRemote"
}
}
}
}