Skip to content

Commit

Permalink
Revert the formatting changes. (Azure#11888)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Oct 16, 2020
1 parent 48feb14 commit 3bae7c7
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 70 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Libraries which enable you to provision specific resources. They are responsible
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <secure@microsoft.com>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).

## Contributing

For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md).

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit
Expand Down
2 changes: 1 addition & 1 deletion common/smoke-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ npm i
node run.js
```

NOTE: `node run.js` must be run from within the same powershell session that Initialize-SmokeTests.ps1 was run,
NOTE: `node run.js` must be run from within the same powershell session that Initialize-SmokeTests.ps1 was run,
since that script sets the NODE_PATH variable to the current directory (so that module imports from the samples will be redirected).
To run `node run.js` from a separate session, set/export the NODE_PATH variable to the `<current directory>/node_modules`.
53 changes: 20 additions & 33 deletions sdk/billing/arm-billing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
This package contains an isomorphic SDK for BillingManagementClient.

For more information about Billing:

- [Azure documentation](https://docs.microsoft.com/azure/cost-management-billing/)
- [SDK reference documentation](https://docs.microsoft.com/javascript/api/overview/azure/billing?view=azure-node-latest)
* [Azure documentation](https://docs.microsoft.com/azure/cost-management-billing/)
* [SDK reference documentation](https://docs.microsoft.com/javascript/api/overview/azure/billing?view=azure-node-latest)

### Currently supported environments

Expand All @@ -25,7 +24,6 @@ npm install @azure/arm-billing
##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.

```bash
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```
Expand All @@ -36,26 +34,19 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import {
BillingManagementClient,
BillingManagementModels,
BillingManagementMappers,
} from "@azure/arm-billing";
import { BillingManagementClient, BillingManagementModels, BillingManagementMappers } from "@azure/arm-billing";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth
.interactiveLogin()
.then((creds) => {
const client = new BillingManagementClient(creds, subscriptionId);
const expand = "testexpand";
client.billingAccounts.list(expand).then((result) => {
console.log("The result is:");
console.log(result);
});
})
.catch((err) => {
console.error(err);
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new BillingManagementClient(creds, subscriptionId);
const expand = "testexpand";
client.billingAccounts.list(expand).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

#### browser - Authentication, client creation and list billingAccounts as an example written in JavaScript.
Expand All @@ -71,7 +62,6 @@ npm install @azure/ms-rest-browserauth
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html

```html
<!DOCTYPE html>
<html lang="en">
Expand All @@ -85,7 +75,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
Expand All @@ -94,16 +84,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
}
const client = new Azure.ArmBilling.BillingManagementClient(res.creds, subscriptionId);
const expand = "testexpand";
client.billingAccounts
.list(expand)
.then((result) => {
console.log("The result is:");
console.log(result);
})
.catch((err) => {
console.log("An error occurred:");
console.error(err);
});
client.billingAccounts.list(expand).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
Expand Down
18 changes: 9 additions & 9 deletions sdk/eventhub/event-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,17 @@ async function main() {
// In this sample, we use the position of earliest available event to start from
// Other common options to configure would be `maxBatchSize` and `maxWaitTimeInSeconds`
const subscriptionOptions = {
startPosition: earliestEventPosition,
startPosition: earliestEventPosition
};

const subscription = client.subscribe(
{
processEvents: async (events, context) => {
processEvents: async(events, context) => {
// event processing code goes here
},
processError: async (err, context) => {
processError: async(err, context) => {
// error reporting/handling code here
},
}
},
subscriptionOptions
);
Expand Down Expand Up @@ -347,7 +347,7 @@ async function main() {
// handle any errors that occur during the course of
// this subscription
console.log(`Errors in subscription to partition ${context.partitionId}: ${err}`);
},
}
});

// Wait for a few seconds to receive events before closing
Expand Down Expand Up @@ -388,18 +388,18 @@ async function main() {
// In this sample, we use the position of earliest available event to start from
// Other common options to configure would be `maxBatchSize` and `maxWaitTimeInSeconds`
const subscriptionOptions = {
startPosition: earliestEventPosition,
startPosition: earliestEventPosition
};

const subscription = client.subscribe(
partitionIds[0],
{
processEvents: async (events, context) => {
processEvents: async(events, context) => {
// event processing code goes here
},
processError: async (err, context) => {
processError: async(err, context) => {
// error reporting/handling code here
},
}
},
subscriptionOptions
);
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To test this project, make sure to build it by following our [building instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#building), then follow the [testing instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#testing).

## Azure resources
## Azure resources

The Azure Event Hubs client does not have any recorded tests and so, all the tests require an Azure Event Hubs namespace to be set up beforehand with at least a single Event Hub instance in it. You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/eventhub/test-resources.json) that already has all of the the necessary configurations.

Expand Down
43 changes: 22 additions & 21 deletions sdk/identity/identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ to authenticate API requests. It supports token authentication using an Azure Ac

- Node.js 8 LTS or higher
- An Azure subscription.
- You can sign up for a [free account](https://azure.microsoft.com/free/).
- You can sign up for a [free account](https://azure.microsoft.com/free/).
- The [Azure CLI][azure_cli] can also be useful for authenticating in a development environment, creating accounts, and managing account roles.

#### Authenticating via Visual Studio Code
Expand Down Expand Up @@ -131,35 +131,36 @@ const client = new KeyClient(vaultUrl, credentialChain);

### Authenticating Azure Hosted Applications

| credential | usage |
| --------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `DefaultAzureCredential` | provides a simplified authentication experience to quickly start developing applications run in the Azure cloud |
| `ChainedTokenCredential` | allows users to define custom authentication flows composing multiple credentials |
| `EnvironmentCredential` | authenticates a service principal or user via credential information specified in environment variables |
| `ManagedIdentityCredential` | authenticates the managed identity of an azure resource |
|credential | usage
|-|-
|`DefaultAzureCredential`|provides a simplified authentication experience to quickly start developing applications run in the Azure cloud
|`ChainedTokenCredential`|allows users to define custom authentication flows composing multiple credentials
|`EnvironmentCredential`|authenticates a service principal or user via credential information specified in environment variables
|`ManagedIdentityCredential`|authenticates the managed identity of an azure resource

### Authenticating Service Principals

| credential | usage |
| ----------------------------- | ----------------------------------------------------- |
| `ClientSecretCredential` | authenticates a service principal using a secret |
| `ClientCertificateCredential` | authenticates a service principal using a certificate |
|credential | usage
|-|-
|`ClientSecretCredential`|authenticates a service principal using a secret
|`ClientCertificateCredential`|authenticates a service principal using a certificate

### Authenticating Users

| credential | usage |
| ------------------------------ | ------------------------------------------------------------------ |
| `InteractiveBrowserCredential` | interactively authenticates a user with the default system browser |
| `DeviceCodeCredential` | interactively authenticates a user on devices with limited UI |
| `UserPasswordCredential` | authenticates a user with a username and password |
| `AuthorizationCodeCredential` | authenticate a user with a previously obtained authorization code |
|credential | usage
|-|-
|`InteractiveBrowserCredential`|interactively authenticates a user with the default system browser
|`DeviceCodeCredential`|interactively authenticates a user on devices with limited UI
|`UserPasswordCredential`|authenticates a user with a username and password
|`AuthorizationCodeCredential`|authenticate a user with a previously obtained authorization code

### Authenticating via Development Tools

| credential | usage |
| ---------------------------- | ----------------------------------------------------------------- |
| `AzureCliCredential` | authenticate in a development environment with the Azure CLI |
| `VisualStudioCodeCredential` | authenticate in a development environment with Visual Studio Code |

|credential | usage
|-|-
|`AzureCliCredential`|authenticate in a development environment with the Azure CLI
|`VisualStudioCodeCredential`|authenticate in a development environment with Visual Studio Code

## Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-certificates/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can use existing Azure resources for the live tests, or generate new ones by

The Azure resource that is used by the tests in this project is:

- An [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/basic-concepts). Your Azure application needs to be assigned as the **owner** of this Azure Key Vault. The steps are provided [below](#aad-based-authentication).
- An [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/basic-concepts). Your Azure application needs to be assigned as the **owner** of this Azure Key Vault. The steps are provided [below](#aad-based-authentication).

To run the live tests, you will also need to set the below environment variables:

Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-secrets/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can use existing Azure resources for the live tests, or generate new ones by

The Azure resource that is used by the tests in this project is:

- An [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/basic-concepts). Your Azure application needs to be assigned as the **owner** of this Azure Key Vault. The steps are provided [below](#aad-based-authentication).
- An [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/basic-concepts). Your Azure application needs to be assigned as the **owner** of this Azure Key Vault. The steps are provided [below](#aad-based-authentication).

To run the live tests, you will also need to set the below environment variables:

Expand Down
4 changes: 2 additions & 2 deletions sdk/servicebus/service-bus/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

To test this project, make sure to build it by following our [building instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#building), then follow the [testing instructions](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md#testing).

## Azure resources
## Azure resources

The Azure Azure Service Bus client does not have any recorded tests and so, all the tests require an Azure Service Bus namespace to be set up beforehand. You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/test-resources.json) that already has all of the the necessary configurations.
The Azure Azure Service Bus client does not have any recorded tests and so, all the tests require an Azure Service Bus namespace to be set up beforehand. You can use existing Azure resources for the live tests, or generate new ones by using our [New-TestResources.ps1](https://github.com/Azure/azure-sdk-for-js/blob/master/eng/common/TestResources/New-TestResources.ps1) script, which will use an [ARM template](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/test-resources.json) that already has all of the the necessary configurations.

The Azure resource that is used by the tests in this project is:

Expand Down

0 comments on commit 3bae7c7

Please sign in to comment.