From 6dca33ba168b7eb06734e0645692ec3b4f65e3a0 Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Thu, 13 Aug 2026 09:42:57 -0400 Subject: [PATCH] Add wrong account key test for SQL connection string login --- test/sql/connectionStringLogin.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sql/connectionStringLogin.spec.ts b/test/sql/connectionStringLogin.spec.ts index ac474cb20..c24fc239e 100644 --- a/test/sql/connectionStringLogin.spec.ts +++ b/test/sql/connectionStringLogin.spec.ts @@ -71,9 +71,9 @@ test.describe("SQL account using connection string login", () => { const accountName = getAccountName(TestAccount.SQL); const account = await context.armClient.databaseAccounts.get(resourceGroupName, accountName); - // A well-formed but incorrect base64 account key: the endpoint is valid, so the Cosmos client reaches - // the account but the data-plane request is rejected with 401 Unauthorized. - const wrongKey = Buffer.alloc(64).toString("base64"); + // A well-formed but incorrect base64 account key (88-char, 64-byte): the endpoint is valid, so the + // Cosmos client reaches the account but the data-plane request is rejected with 401 Unauthorized. + const wrongKey = "A".repeat(86) + "=="; const connectionString = `AccountEndpoint=${account.documentEndpoint};AccountKey=${wrongKey};`; await page.goto("https://localhost:1234/hostedExplorer.html");