Skip to content

Commit

Permalink
Merge branch 'master' into blob-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
ljian3377 authored Mar 20, 2020
2 parents 67f1723 + badc847 commit d4dba25
Show file tree
Hide file tree
Showing 208 changed files with 16,509 additions and 12,020 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/sdk/eventhub/ @ramya-rao-a @chradek @richardpark-msft
/sdk/servicebus/ @ramya-rao-a @chradek @richardpark-msft

/sdk/identity/ @daviwil @jonathandturner
/sdk/identity/ @schaabs @daviwil @jonathandturner
/sdk/keyvault/ @jonathandturner @sadasant
/sdk/storage/ @XiaoningLiu @jeremymeng @HarshaNalluru @vinjiang @jiacfan @ljian3377

Expand Down
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,33 @@ Projects may optionally have the following scripts:

- `extract-api`: Run API Extractor to show API issues and generate API reports

### Integration Testing with live services

Integration tests assume a live resource has been created and appropriate
environment variables have been set for the test process. To automate setting up
live resources we use created a script called `New-TestResources.ps1` that
deploys resources for a given service.

To see what resources will be deployed for a live service, check the
`test-resources.json` ARM template files in the service you wish to deploy for
testing, for example `sdk\keyvault\test-resources.json`.

To deploy live resources for testing use the steps documented in [`Example 1 of New-TestResources.ps1`](eng/common/TestResources/New-TestResources.ps1.md#example-1)
to set up a service principal and deploy live testing resources.

The script will provide instructions for setting environment variables before
running live tests.

To run live tests after deploying live resources for Node:

```
rush integration-test:node -t @azure/keyvault-secrets -verbose -pmax
```

Some live tests may have additional steps for setting up live testing resources.
See the CONTRIBUTING.md file for the service you wish to test for additional
information or instructions.

### Getting back to a clean state

If you're having problems and want to restore your repo to a clean state without any packages installed, run `rush uninstall`. Downloaded packages will be deleted from the cache and all node_modules directories will be removed. Now you can start clean by re-downloading and installing dependencies from scratch with `rush update`. This will not make any changes to any other files in your working directory.
Expand Down
54 changes: 41 additions & 13 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 8 additions & 13 deletions common/smoke-test/BlobStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
// Copyright(c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------
import {
StorageSharedKeyCredential,
BlobServiceClient,
ContainerClient
} from "@azure/storage-blob";
import { BlobServiceClient, ContainerClient } from "@azure/storage-blob";

const uuidv1 = require("uuid/v1");

Expand All @@ -23,18 +19,17 @@ export class BlobStorage {
2) Delete Blob (Clean up the resource)
`);

const account =
process.env["STORAGE_ACCOUNT_NAME"] || "<YourStorageAccountNAME>";
const accountKey =
process.env["STORAGE_ACCOUNT_KEY"] || "<YourStorageAccountKEY>";
const storageConnectionString =
process.env["AZURE_STORAGE_CONNECTION_STRING"] ||
"<YourStorageAccountCONNECTIONSTRING>";

const containerName = "mycontainer";
BlobStorage.blobName = `JSNewBlob-${uuidv1()}.txt`;

const credential = new StorageSharedKeyCredential(account, accountKey);
const serviceClient = new BlobServiceClient(
`https://${account}.blob.core.windows.net`,
credential
const serviceClient = BlobServiceClient.fromConnectionString(
storageConnectionString
);

BlobStorage.ContainerClient = serviceClient.getContainerClient(
containerName
);
Expand Down
12 changes: 9 additions & 3 deletions common/smoke-test/KeyVault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright(c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------
import { EnvironmentCredential } from "@azure/identity";
import { DefaultAzureCredential } from "@azure/identity";
import { SecretClient } from "@azure/keyvault-secrets";

const uuidv1 = require("uuid/v1");
Expand All @@ -23,11 +23,17 @@ export class KeyVaultSecrets {
3) Delete that secret (Clean up the resource)
`);

// EnvironmentCredential expects the following three environment variables:
const authorityHost =
process.env["AZURE_AUTHORITY_HOST"] ||
"https://login.microsoftonline.com";

// DefaultAzureCredential expects the following three environment variables:
// * AZURE_TENANT_ID: The tenant ID in Azure Active Directory
// * AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant
// * AZURE_CLIENT_SECRET: The client secret for the registered application
const credential = new EnvironmentCredential();
const credential = new DefaultAzureCredential({
authorityHost: authorityHost
});
const url = process.env["AZURE_PROJECT_URL"] || "<YourProjectURL>";

KeyVaultSecrets.client = new SecretClient(url, credential);
Expand Down
1 change: 1 addition & 0 deletions common/smoke-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@azure/identity": "dev",
"@azure/cosmos": "dev",
"@azure/event-hubs": "dev",
"@azure/keyvault-secrets": "dev",
Expand Down
Loading

0 comments on commit d4dba25

Please sign in to comment.