Skip to content

Commit ad1b88f

Browse files
minhanh-phanscottaddieCopilot
authored
[Identity] Remove samples (Azure#37242)
### Packages impacted by this PR @azure/identity ### Issues associated with this PR ### Describe the problem that is addressed by this PR - Simplify samples folder by removing other samples and keeping the main `DefaultAzureCredential` sample ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --------- Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 74844ae commit ad1b88f

File tree

9 files changed

+4
-273
lines changed

9 files changed

+4
-273
lines changed

sdk/identity/identity/samples-dev/azureDeveloperCliCredential.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

sdk/identity/identity/samples-dev/azurePipelinesCredential/azurePipelinesCredential.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

sdk/identity/identity/samples-dev/azurePipelinesCredential/sampleFile.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

sdk/identity/identity/samples-dev/clientSecretCredential.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

sdk/identity/identity/samples-dev/defaultAzureCredential.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,15 @@ import { KeyClient } from "@azure/keyvault-keys";
1212
import "dotenv/config";
1313

1414
/**
15-
* The `DefaultAzureCredential` is appropriate for most scenarios where the application is intended to ultimately be run in the Azure Cloud.
15+
* `DefaultAzureCredential` is appropriate for most scenarios where the application is intended to ultimately be run in the Azure Cloud.
1616
* This is because the `DefaultAzureCredential` combines credentials commonly used to authenticate when deployed,
1717
* with credentials used to authenticate in a development environment.
1818
*
19-
* For more information, you may go to our readme: [link](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
19+
* For more information, see [DefaultAzureCredential overview](https://aka.ms/azsdk/js/identity/credential-chains#defaultazurecredential-overview).
2020
*/
2121

2222
export async function main(): Promise<void> {
23-
// AZURE_TOKEN_CREDENTIALS can be set to `EnvironmentCredential` in the .env file in this example.
24-
// You can specify the list of required environment variables like this:
25-
const credential = new DefaultAzureCredential({
26-
requiredEnvVars: [
27-
"AZURE_CLIENT_ID",
28-
"AZURE_TENANT_ID",
29-
"AZURE_CLIENT_SECRET",
30-
"AZURE_TOKEN_CREDENTIALS",
31-
],
32-
});
33-
23+
const credential = new DefaultAzureCredential();
3424
const keyVaultUrl = `https://key-vault-name.vault.azure.net`;
3525
const client = new KeyClient(keyVaultUrl, credential);
3626

sdk/identity/identity/samples-dev/environmentCredential.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

sdk/identity/identity/samples-dev/interactiveBrowserCredential.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

sdk/identity/identity/samples-dev/tokenProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33

44
/**
5-
* @summary demonstrates how to get a bearer token.
5+
* @summary demonstrates how to get a bearer token and manually add it to a request.
66
*/
77

88
import { PipelineRequest, createPipelineRequest } from "@azure/core-rest-pipeline";

sdk/identity/identity/samples-dev/workloadIdentityCredential.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)