Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
452 changes: 22 additions & 430 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

20 changes: 4 additions & 16 deletions sdk/commerce/arm-commerce/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
# Release History

## 4.0.0-beta.4 (Unreleased)


## 4.0.0-beta.4 (2026-03-12)
### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Opted in to cross-origin redirects to ensure RateCard API requests continue to work when the service redirects to an API gateway. [#37384](https://github.com/Azure/azure-sdk-for-js/pull/37384)
- Updated minimum dependency on `@azure/core-rest-pipeline` to `^1.23.0`.

## 4.0.0-beta.3 (2022-11-17)

The package of @azure/arm-commerce is using our next generation design principles since version 4.0.0-beta.3, which contains breaking changes.
The package of @azure/arm-commerce is using our next generation design principles since version 4.0.0-beta.4, which contains breaking changes.

To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).

To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).

To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
2 changes: 1 addition & 1 deletion sdk/commerce/arm-commerce/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
25 changes: 12 additions & 13 deletions sdk/commerce/arm-commerce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure UsageManagement client.

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-commerce) |
[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-commerce?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)


Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce)
- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-commerce)
- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-commerce?view=azure-node-preview)
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce/samples)

## Getting started

Expand Down Expand Up @@ -33,7 +37,7 @@ npm install @azure/arm-commerce
To create a client object to access the Azure UsageManagement API, you will need the `endpoint` of your Azure UsageManagement resource and a `credential`. The Azure UsageManagement client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure UsageManagement resource in the [Azure Portal][azure_portal].

You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).

To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:

Expand All @@ -42,7 +46,6 @@ npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure UsageManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

Expand All @@ -62,16 +65,16 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
import { InteractiveBrowserCredential } from "@azure/identity";
import { UsageManagementClient } from "@azure/arm-commerce";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new InteractiveBrowserCredential({
tenantId: "<YOUR_TENANT_ID>",
clientId: "<YOUR_CLIENT_ID>",
});
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new UsageManagementClient(credential, subscriptionId);
```

### JavaScript Bundle

### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts
Expand All @@ -96,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur

## Next steps

Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce/samples) directory for detailed examples on how to use this library.

## Contributing

Expand All @@ -106,10 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide

- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)



[azure_cli]: https://learn.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
Expand Down
8 changes: 0 additions & 8 deletions sdk/commerce/arm-commerce/_meta.json

This file was deleted.

4 changes: 1 addition & 3 deletions sdk/commerce/arm-commerce/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"extends": "../../../api-extractor-base.json"
}
{ "extends": "../../../api-extractor-base.json" }
14 changes: 14 additions & 0 deletions sdk/commerce/arm-commerce/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";

export default azsdkEslint.config([
{
rules: {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn",
},
},
]);
27 changes: 27 additions & 0 deletions sdk/commerce/arm-commerce/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"apiVersions": {
"Microsoft.Commerce": "2015-06-01-preview"
},
"emitterVersion": "0.50.3",
"crossLanguageDefinitions": {
"CrossLanguagePackageId": "Microsoft.Commerce",
"CrossLanguageDefinitionId": {
"@azure/arm-commerce!UsageAggregationListResult:interface": "Azure.ResourceManager.ResourceListResult",
"@azure/arm-commerce!UsageAggregation:interface": "Microsoft.Commerce.UsageAggregation",
"@azure/arm-commerce!UsageSample:interface": "Microsoft.Commerce.UsageSample",
"@azure/arm-commerce!ErrorObjectResponse:interface": "Microsoft.Commerce.ErrorObjectResponse",
"@azure/arm-commerce!ErrorResponse:interface": "Microsoft.Commerce.ErrorResponse",
"@azure/arm-commerce!ResourceRateCardInfo:interface": "Microsoft.Commerce.ResourceRateCardInfo",
"@azure/arm-commerce!OfferTermInfo:interface": "Microsoft.Commerce.OfferTermInfo",
"@azure/arm-commerce!MonetaryCredit:interface": "Microsoft.Commerce.MonetaryCredit",
"@azure/arm-commerce!MonetaryCommitment:interface": "Microsoft.Commerce.MonetaryCommitment",
"@azure/arm-commerce!RecurringCharge:interface": "Microsoft.Commerce.RecurringCharge",
"@azure/arm-commerce!MeterInfo:interface": "Microsoft.Commerce.MeterInfo",
"@azure/arm-commerce!KnownAggregationGranularity:enum": "Microsoft.Commerce.AggregationGranularity",
"@azure/arm-commerce!KnownOfferTermInfoName:enum": "Microsoft.Commerce.OfferTermInfoName",
"@azure/arm-commerce!KnownVersions:enum": "Microsoft.Commerce.Versions",
"@azure/arm-commerce!RateCardOperations#get:member": "Microsoft.Commerce.RateCardOperationGroup.get",
"@azure/arm-commerce!UsageAggregatesOperations#list:member": "Microsoft.Commerce.UsageAggregatesOperationGroup.list"
}
}
}
Loading
Loading