Skip to content

Commit

Permalink
[AzureClient] Remove AzureFunctionTokenProvider from e2e tests (#15232)
Browse files Browse the repository at this point in the history
## Description

This PR updates AzureClient e2e tests to no longer use
`AzureFunctionTokenProvider` and removes the default endpoint value.
  • Loading branch information
scottn12 authored Apr 21, 2023
1 parent 309fe98 commit 118900c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export function createAzureClient(
name: userName ?? uuid(),
};
const endPoint = process.env.azure__fluid__relay__service__endpoint as string;
if (endPoint === undefined) {
throw new Error("Azure FRS endpoint is missing");
}

// use AzureClient remote mode will run against live Azure Fluid Relay.
// Default to running Tinylicious for PR validation
Expand All @@ -41,7 +44,7 @@ export function createAzureClient(
? {
tenantId,
tokenProvider: createAzureTokenProvider(userID ?? "foo", userName ?? "bar"),
endpoint: endPoint ?? "https://us.fluidrelay.azure.com",
endpoint: endPoint,
type: "remote",
}
: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { AzureFunctionTokenProvider, ITokenProvider } from "@fluidframework/azure-client";
import { ITokenProvider } from "@fluidframework/azure-client";
import { InsecureTokenProvider } from "@fluidframework/test-client-utils";

export function createAzureTokenProvider(userId: string, userName: string): ITokenProvider {
const fnUrl = process.env.azure__fluid__relay__service__function__url as string;
const key = process.env.azure__fluid__relay__service__key as string;

if (fnUrl) {
return new AzureFunctionTokenProvider(`${fnUrl}/api/GetFrsToken`, {
userId,
userName,
});
} else if (key) {
if (key) {
const userConfig = {
id: userId,
name: userName,
Expand Down

0 comments on commit 118900c

Please sign in to comment.