# How can you use Credential Vault content in Python extensions?

**URL:** <https://community.dynatrace.com/t/how-can-you-use-credential-vault-content-in-python-extensions/52825>\
**Category:** Extensions\
**Tags:** extensions\
**Created:** [August 6, 2025, 9:03am UTC](https://community.dynatrace.com/t/how-can-you-use-credential-vault-content-in-python-extensions/52825 "2025-08-06T09:03:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [August 6, 2025, 9:03am UTC](https://community.dynatrace.com/t/how-can-you-use-credential-vault-content-in-python-extensions/52825/1 "2025-08-06T09:03:13Z")

</div>

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](https://community.dynatrace.com/post/242122)&nbsp;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

---

<div class="post-metadata">

**Author:** ![calfanonerey](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@calfanonerey](https://community.dynatrace.com/u/calfanonerey)\
**Post date:** [August 14, 2025, 2:49pm UTC](https://community.dynatrace.com/t/how-can-you-use-credential-vault-content-in-python-extensions/52825/2 "2025-08-14T14:49:56Z")

</div>

hey&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901)&nbsp;I was just running into this for an api token I’m storing. the post by&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp; on this thread  
[https://community.dynatrace.com/t5/Extensions/Send-a-credential-from-credential-vault-to-extension/m-p/242163](https://community.dynatrace.com/post/242163)  
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&nbsp;credentialVaultId entry and then subsequent values have the property

useCredentialVault

```javascript
{
  "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"
      }
    }
  }
}

```
