mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-10 18:33:52 +01:00
Fix test
This commit is contained in:
parent
ace8aadbbd
commit
71799d7ec5
@ -1,13 +1,16 @@
|
|||||||
|
import crypto from "crypto";
|
||||||
|
|
||||||
import { CosmosDBManagementClient } from "@azure/arm-cosmosdb";
|
import { CosmosDBManagementClient } from "@azure/arm-cosmosdb";
|
||||||
import { BulkOperationType, Container, CosmosClient, Database, JSONObject } from "@azure/cosmos";
|
import { BulkOperationType, Container, CosmosClient, Database, JSONObject } from "@azure/cosmos";
|
||||||
import crypto from "crypto";
|
import { AzureIdentityCredentialAdapter } from "@azure/ms-rest-js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TestAccount,
|
|
||||||
generateUniqueName,
|
generateUniqueName,
|
||||||
getAccountName,
|
getAccountName,
|
||||||
getAzureCLICredentials,
|
getAzureCLICredentials,
|
||||||
resourceGroupName,
|
resourceGroupName,
|
||||||
subscriptionId,
|
subscriptionId,
|
||||||
|
TestAccount,
|
||||||
} from "./fx";
|
} from "./fx";
|
||||||
|
|
||||||
export interface TestItem {
|
export interface TestItem {
|
||||||
@ -75,7 +78,8 @@ export async function createTestSQLContainer(includeTestData?: boolean) {
|
|||||||
const databaseId = generateUniqueName("db");
|
const databaseId = generateUniqueName("db");
|
||||||
const containerId = "testcontainer"; // A unique container name isn't needed because the database is unique
|
const containerId = "testcontainer"; // A unique container name isn't needed because the database is unique
|
||||||
const credentials = getAzureCLICredentials();
|
const credentials = getAzureCLICredentials();
|
||||||
const armClient = new CosmosDBManagementClient(credentials, subscriptionId);
|
const adaptedCredentials = new AzureIdentityCredentialAdapter(credentials);
|
||||||
|
const armClient = new CosmosDBManagementClient(adaptedCredentials, subscriptionId);
|
||||||
const accountName = getAccountName(TestAccount.SQL);
|
const accountName = getAccountName(TestAccount.SQL);
|
||||||
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
|
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
|
||||||
const keys = await armClient.databaseAccounts.listKeys(resourceGroupName, accountName);
|
const keys = await armClient.databaseAccounts.listKeys(resourceGroupName, accountName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user