diff --git a/postgres/CHANGELOG.md b/postgres/CHANGELOG.md index e8102ecdb06e4..f45deaa35d8f2 100644 --- a/postgres/CHANGELOG.md +++ b/postgres/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +***Fixed***: + +* Return Azure AD auth token in correct format ([#15701](https://github.com/DataDog/integrations-core/pull/15701)) + ## 14.2.0 / 2023-08-18 ***Added***: diff --git a/postgres/datadog_checks/postgres/azure.py b/postgres/datadog_checks/postgres/azure.py index b4c68d6bc6e1d..409efef47e859 100644 --- a/postgres/datadog_checks/postgres/azure.py +++ b/postgres/datadog_checks/postgres/azure.py @@ -1,12 +1,10 @@ # (C) Datadog, Inc. 2023-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -import struct from azure.identity import ManagedIdentityCredential DEFAULT_PERMISSION_SCOPE = "https://ossrdbms-aad.database.windows.net/.default" -TOKEN_ENCODING = "UTF-16-LE" # Use the azure identity API to generate a token that will be used @@ -15,7 +13,4 @@ def generate_managed_identity_token(client_id: str, identity_scope: str = None): credential = ManagedIdentityCredential(client_id=client_id) if not identity_scope: identity_scope = DEFAULT_PERMISSION_SCOPE - token_bytes = credential.get_token(identity_scope).token.encode(TOKEN_ENCODING) - token_struct = struct.pack(f'