{"title":"Analyze app key vault secret trace telemetry","url":"https://jonas-paprotka.de/docs/dev-itpro/administration/telemetry-extension-key-vault-trace/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-extension-key-vault-trace, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-extension-key-vault-trace","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Analyze app key vault telemetry in Business Central to troubleshoot extension initialization failures and secret retrieval errors in Azure Key Vault.","date":"2026-11-17","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Analyze app key vault secret trace telemetry","slug":"analyze-app-key-vault-secret-trace-telemetry","at":0,"chars":12891},{"level":2,"title":"Initialize the app key vault provider","slug":"initialize-the-app-key-vault-provider","at":793,"chars":693},{"level":2,"title":"Retrieve an app key vault secret","slug":"retrieve-an-app-key-vault-secret","at":1486,"chars":588},{"level":2,"title":"App key vault secret initialization succeeded","slug":"app-key-vault-secret-initialization-succeeded","at":2074,"chars":2540},{"level":3,"title":"General dimensions","slug":"general-dimensions","at":2185,"chars":135},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions","at":2320,"chars":1533},{"level":3,"title":"Sample KQL code (successful Azure Key Vault initializations)","slug":"sample-kql-code-successful-azure-key-vault-initializations","at":3853,"chars":761},{"level":2,"title":"App key vault initialization failed","slug":"app-key-vault-initialization-failed","at":4614,"chars":2476},{"level":3,"title":"General dimensions","slug":"general-dimensions-1","at":4703,"chars":115},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-1","at":4818,"chars":1391},{"level":3,"title":"Sample KQL code (Azure Key Vault initialization errors)","slug":"sample-kql-code-azure-key-vault-initialization-errors","at":6209,"chars":881},{"level":2,"title":"App key vault secret retrieval succeeded","slug":"app-key-vault-secret-retrieval-succeeded","at":7090,"chars":2650},{"level":3,"title":"General dimensions","slug":"general-dimensions-2","at":7227,"chars":151},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-2","at":7378,"chars":1570},{"level":3,"title":"Sample KQL code (successful Azure Key Vault retrievals)","slug":"sample-kql-code-successful-azure-key-vault-retrievals","at":8948,"chars":792},{"level":2,"title":"App key vault secret retrieval failed","slug":"app-key-vault-secret-retrieval-failed","at":9740,"chars":2882},{"level":3,"title":"General dimensions","slug":"general-dimensions-3","at":9868,"chars":148},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-3","at":10016,"chars":1647},{"level":3,"title":"Sample KQL code (Azure Key Vault retrieval errors)","slug":"sample-kql-code-azure-key-vault-retrieval-errors","at":11663,"chars":959},{"level":2,"title":"Related information","slug":"related-information","at":12622,"chars":269}],"text":"# Analyze app key vault secret trace telemetry\n> APPLIES TO: Business Central 2020 release wave 2 and later\nApp key vault telemetry gathers information about the acquisition of secrets in Azure Key Vaults by extensions at runtime. These events are sent to the extension's Application Insights resource, not the environment's resource. See Use app key vaults with Business Central extensions<../developer/devenv-app-key-vault-overview>.\nThe app key vault secret process has two operations: initialization and retrieval. The telemetry data provides information about the success or failure for each of these operations. There are various conditions that cause a failure. The failure messages provide insight into the cause of the failure, helping you identify, troubleshoot, and resolve issues.\n## Initialize the app key vault provider\nInitialization is the first stage. It verifies the configuration of the app key vault provider in the extension and on the service. This stage is initiated by the TryInitializeFromCurrentApp method call in the extension code. Some conditions that cause failures in this stage include:\n The extension doesn't specify a key vault in its app.json file.\n The Azure Key Vault Client Identity settings are incorrect. For example, it could be that the application (client) ID that you specified for the key vault reader application in Azure is wrong.\n The Business Central Server lacks permission to the private key of the Azure Key Vault client certificate.\n## Retrieve an app key vault secret\nRetrieval is the second stage, and occurs after a successful initialization. In this stage, the service tries to get a secret from a specified key vault. This stage is initiated by the GetSecret method call in the extension code. Some conditions that cause failures include:\n The secret name requested by the extension doesn't exist or isn't valid.\n The key vault doesn't exist.\n The application ID doesn't have permission to read from the key vault.\nSee Use app key vaults with Business Central extensions<../developer/devenv-app-key-vault-overview>.\n## App key vault secret initialization succeeded\nOccurs when an extension secret was successfully initialized.\n### General dimensions\nDimension|Description or value\nmessage|App Key Vault initialization succeeded: '{keyVaultUri}'.\nseverityLevel|1\n### Custom dimensions\nDimension|Description or value\nalObjectId|Specifies the ID of the AL object that was run by request.\nalObjectName|Specifies the name of the AL object that was run by request.\nalObjectType|Specifies the type of AL object that was run by request.\nalStackTrace|The stack trace in AL.\nclientType|Specifies the type of client that executed the request, such as Background or WebClient. See ClientType option type<../developer/methods-auto/clienttype/clienttype-option>.\ncomponent|Dynamics 365 Business Central Server.\ncomponentVersion|Specifies the version number of the component that emits telemetry (see the component dimension.)\ndeprecatedKeys|A comma-separated list of all the keys that have been deprecated. The keys in this list are still supported but will eventually be removed in the next major release. We recommend that you update any queries that use these keys to use the new key name.\neventId|RT0014\nextensionId|Specifies the AppID of the extension that requested the secret.\nextensionName|Specifies the name of the extension that requested the secret.\nextensionPublisher|Specifies the publisher of the extension that requested the secret.\nextensionVersion|Specifies the version of the extension that requested the secret.\nkeyVaultUrls|Specifies the DNS name of the Azure key vault that was used in the request. The keyVaultUris are specified in the app.json<../developer/devenv-json-files> file of the extension.\ntelemetrySchemaVersion|Specifies the version of the Business Central telemetry schema.\n### Sample KQL code (successful Azure Key Vault initializations)\nThis KQL code can help you get started analyzing Azure Key Vault initializations.\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'RT0014'\n| project timestamp\n, alObjectId = customDimensions.alObjectId\n, alObjectName = customDimensions.alObjectName\n, alObjectType = customDimensions.alObjectType\n, alStackTrace = customDimensions.alStackTrace\n, clientType = customDimensions.clientType\n, extensionName = customDimensions.extensionName\n, extensionId = customDimensions.extensionId\n, extensionPublisher = customDimensions.extensionPublisher\n, extensionVersion = customDimensions.extensionVersion\n, keyVaultUrls = customDimensions.keyVaultUrls\n```\n## App key vault initialization failed\nOccurs when a key vault failed to be initialized.\n### General dimensions\nDimension|Description or value\nmessage|App Key Vault initialization failed.\nseverityLevel|3\n### Custom dimensions\nDimension|Description or value\nalObjectId|Specifies the ID of the AL object that was run by request.\nalObjectName|Specifies the name of the AL object that was run by request.\nalObjectType|Specifies the type of AL object that was run by request.\nalStackTrace|The stack trace in AL.\nclientType|Specifies the type of client that executed the request, such as Background or WebClient. See ClientType option type<../developer/methods-auto/clienttype/clienttype-option>.\ncomponent|Dynamics 365 Business Central Server.\ncomponentVersion|Specifies the version number of the component that emits telemetry (see the component dimension.)\ndeprecatedKeys|A comma-separated list of all the keys that have been deprecated. The keys in this list are still supported but will eventually be removed in the next major release. We recommend that you update any queries that use these keys to use the new key name.\neventId|RT0015\nextensionId|Specifies the AppID of the extension that requested the secret.\nextensionName|Specifies the name of the extension that requested the secret.\nextensionPublisher|Specifies the publisher of the extension that requested the secret.\nextensionVersion|Specifies the version of the extension that requested the secret.\nfailureReason|Specifies the error that occurred.\ntelemetrySchemaVersion|Specifies the version of the Business Central telemetry schema.\n### Sample KQL code (Azure Key Vault initialization errors)\nThis KQL code can help you get started troubleshooting and alerting on Azure Key Vault initialization errors.\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'RT0015'\n| project timestamp\n, alObjectId = customDimensions.alObjectId\n, alObjectName = customDimensions.alObjectName\n, alObjectType = customDimensions.alObjectType\n, alStackTrace = customDimensions.alStackTrace\n, clientType = customDimensions.clientType\n, extensionName = customDimensions.extensionName\n, extensionId = customDimensions.extensionId\n, extensionPublisher = customDimensions.extensionPublisher\n, extensionVersion = customDimensions.extensionVersion\n, failureReason = customDimensions.failureReason\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## App key vault secret retrieval succeeded\nOccurs when a secret used by an extension is successfully retrieved from an Azure Key Vault.\n### General dimensions\nDimension|Description or value\nmessage|App Key Vault secret retrieval succeeded from key vault '{keyVaultUri}'.\nseverityLevel|1\n### Custom dimensions\nDimension|Description or value\nalObjectId|Specifies the ID of the AL object that was run by request.\nalObjectName|Specifies the name of the AL object that was run by request.\nalObjectType|Specifies the type of AL object that was run by request.\nalStackTrace|The stack trace in AL.\nclientType|Specifies the type of client that requested the secret, such as Background or WebClient. See ClientType option type<../developer/methods-auto/clienttype/clienttype-option>.\ncomponent|Dynamics 365 Business Central Server.\ncomponentVersion|Specifies the version number of the component that emits telemetry (see the component dimension.)\ndeprecatedKeys|A comma-separated list of all the keys that have been deprecated. The keys in this list are still supported but will eventually be removed in the next major release. We recommend that you update any queries that use these keys to use the new key name.\neventId|RT0016\nextensionId|Specifies the AppID of the extension that requested the secret.\nextensionName|Specifies the name of the extension that requested the secret.\nextensionPublisher|Specifies the publisher of the extension that requested the secret.\nextensionVersion|Specifies the version of the extension that requested the secret.\nkeyVaultUrl|Specifies the DNS name of the Azure key vault that was used in the request. The keyVaultUris are specified in the app.json<../developer/devenv-json-files> file of the extension.\nsecretName|Specifies the secret name.\ntelemetrySchemaVersion|Specifies the version of the Business Central telemetry schema.\n### Sample KQL code (successful Azure Key Vault retrievals)\nThis KQL code can help you get started analyzing Azure Key Vault retrievals.\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'RT0016'\n| project timestamp\n, alObjectId = customDimensions.alObjectId\n, alObjectName = customDimensions.alObjectName\n, alObjectType = customDimensions.alObjectType\n, alStackTrace = customDimensions.alStackTrace\n, clientType = customDimensions.clientType\n, extensionName = customDimensions.extensionName\n, extensionId = customDimensions.extensionId\n, extensionPublisher = customDimensions.extensionPublisher\n, extensionVersion = customDimensions.extensionVersion\n, keyVaultUrl = customDimensions.keyVaultUrl\n, secretName = customDimensions.secretName\n```\n## App key vault secret retrieval failed\nOccurs when an extension failed to retrieve a secret from a specified Azure key vault.\n### General dimensions\nDimension|Description or value\nmessage|App Key Vault secret retrieval failed from key vault '{keyVaultUri}'.\nseverityLevel|3\n### Custom dimensions\nDimension|Description or value\nalObjectId|Specifies the ID of the AL object that was run by request.\nalObjectName|Specifies the name of the AL object that was run by request.\nalObjectType|Specifies the type of AL object that was run by request.\nalStackTrace|The stack trace in AL.\nclientType|Specifies the type of client that requested the secret, such as Background or WebClient. See ClientType option type<../developer/methods-auto/clienttype/clienttype-option>.\ncomponent|Dynamics 365 Business Central Server.\ncomponentVersion|Specifies the version number of the component that emits telemetry (see the component dimension.)\ndeprecatedKeys|A comma-separated list of all the keys that have been deprecated. The keys in this list are still supported but will eventually be removed in the next major release. We recommend that you update any queries that use these keys to use the new key name.\neventId|RT0017\nextensionId|Specifies the AppID of the extension that requested the secret.\nextensionName|Specifies the name of the extension that requested the secret.\nextensionPublisher|Specifies the publisher of the extension that requested the secret.\nextensionVersion|Specifies the version of the extension that requested the secret.\nfailureReason|Specifies the error that occurred while retrieving the secret.\nkeyVaultUrl|Specifies the DNS name of the Azure key vault that was used in the request. The keyVaultUris are specified in the app.json<../developer/devenv-json-files> file of the extension.\nsecretName|Specifies the secret name.\ntelemetrySchemaVersion|Specifies the version of the Business Central telemetry schema.\n### Sample KQL code (Azure Key Vault retrieval errors)\nThis KQL code can help you get started troubleshooting and alerting on Azure Key Vault retrieval errors.\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'RT0017'\n| project timestamp\n, alObjectId = customDimensions.alObjectId\n, alObjectName = customDimensions.alObjectName\n, alObjectType = customDimensions.alObjectType\n, alStackTrace = customDimensions.alStackTrace\n, clientType = customDimensions.clientType\n, extensionName = customDimensions.extensionName\n, extensionId = customDimensions.extensionId\n, extensionPublisher = customDimensions.extensionPublisher\n, extensionVersion = customDimensions.extensionVersion\n, failureReason = customDimensions.failureReason\n, keyVaultUrl = customDimensions.keyVaultUrl\n, secretName = customDimensions.secretName\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## Related information\nUse key vault secrets in Business Central extensions<../developer/devenv-app-key-vault>\nMonitoring and Analyzing Telemetry<telemetry-overview>\nEnable Sending Telemetry to Application Insights<telemetry-enable-application-insights>\ntelemetry-alert"}