Skip to content

Commit adf852c

Browse files
authored
[ContainerRegistry] README and CHANGELOG for beta.1 (#14736)
* [ContainerRegistry] README and CHANGELOG for beta.1 * README feedback * Update release date in CHANGELOG
1 parent b8492c7 commit adf852c

File tree

2 files changed

+96
-16
lines changed

2 files changed

+96
-16
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.1 (Unreleased)
3+
## 1.0.0-beta.1 (2021-04-06)
44

5-
Initial version of Azure Container Registry client SDK library.
5+
- Initial version of Azure Container Registry client SDK library.
6+
- This release is a preview of our efforts to create a client library that is user friendly and
7+
idiomatic to the JavaScript ecosystem. The reasons for most of the changes in this update can be found in the
8+
[Azure SDK Design Guidelines for TypeScript](https://azure.github.io/azure-sdk/typescript_introduction.html).

sdk/containerregistry/container-registry/README.md

Lines changed: 91 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Azure Container Registry client library for JavaScript
22

3-
Azure [Container Registry](https://azure.microsoft.com/services/container-registry/) is a managed, private Docker registry service based on the open-source Docker Registry 2.0. Create and maintain Azure container registries to store and manage your private Docker container images and related artifacts.
3+
Azure Container Registry allows you to store and manage container images and artifacts in a private registry for all types of container deployments.
44

5-
Use Azure container registries with your existing container development and deployment pipelines, or use Azure Container Registry Tasks to build container images in Azure. Build on demand, or fully automate builds with triggers such as source code commits and base image updates.
5+
Use the client library for Azure Container Registry to:
6+
7+
- List images or artifacts in a registry
8+
- Obtain metadata for images and artifacts, repositories and tags
9+
- Set read/write/delete properties on registry items
10+
- Delete images and artifacts, repositories and tags
11+
12+
[Source code][source] |
13+
[Package (NPM)]<!--[package]--> |
14+
[API reference documentation]<!--[api_docs]--> |
15+
[REST API documentation][rest_docs] |
16+
[Product documentation][product_docs] |
17+
[Samples][samples]
618

719
## Getting started
820

@@ -12,10 +24,15 @@ Use Azure container registries with your existing container development and depl
1224

1325
### Prerequisites
1426

15-
- An [Azure subscription][azure_sub].
16-
- An [Azure Container Registry resource][acr_resource]
27+
You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.
1728

18-
Usually you'd put a shell command for provisioning the necessary Azure services here.
29+
To create a new Container Registry, you can use the [Azure Portal][container_registry_create_portal],
30+
[Azure PowerShell][container_registry_create_ps], or the [Azure CLI][container_registry_create_cli].
31+
Here's an example using the Azure CLI:
32+
33+
```Powershell
34+
az acr create --name MyContainerRegistry --resource-group MyResourceGroup --location westus --sku Basic
35+
```
1936

2037
### Install the `@azure/container-registry` package
2138

@@ -31,21 +48,67 @@ npm install @azure/container-registry
3148

3249
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).
3350

34-
### Further examples
51+
### Authenticate the client
52+
53+
The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication.
54+
55+
```javascript
56+
const { ContainerRegistryClient } = require("@azure/container-registry");
57+
const { DefaultAzureCredential } = require("@azure/identity");
58+
59+
const endpoint = process.env.REGISTRY_ENDPOINT;
60+
// Create a ContainerRegistryClient that will authenticate through Active Directory
61+
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
62+
```
63+
64+
Note that these samples assume you have a `REGISTRY_ENDPOINT` environment variable set, which is the URL including the name of the login server and the `https://` prefix.
3565

36-
Top-level examples usually include things like creating and authenticating the main Client. If your service supports multiple means of authenticating (e.g. key-based and Azure Active Directory) you can give a separate example of each.
66+
For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](https://docs.microsoft.com/azure/container-registry/container-registry-authentication).
3767

3868
## Key concepts
3969

40-
### ContainerRegistryClient
70+
A **registry** stores Docker images and [OCI Artifacts](https://opencontainers.org/). An image or artifact consists of a **manifest** and **layers**. An image's manifest describes the layers that make up the image, and is uniquely identified by its **digest**. An image can also be "tagged" to give it a human-readable alias. An image or artifact can have zero or more **tags** associated with it, and each tag uniquely identifies the image. A collection of images that share the same name but have different tags, is referred to as a **repository**.
4171

42-
`ContainerRegistryClient` provides operations to interact with an Azure Container Registry instance.
72+
For more information please see [Container Registry Concepts](https://docs.microsoft.com/azure/container-registry/container-registry-concepts).
4373

4474
## Examples
4575

46-
### First Example
76+
### Listing repositories
4777

48-
<!-- Examples should showcase the primary, or "champion" scenarios of the client SDK. -->
78+
Iterate through the collection of repositories in the registry.
79+
80+
```javascript
81+
const { ContainerRegistryClient } = require("@azure/container-registry");
82+
const { DefaultAzureCredential } = require("@azure/identity");
83+
84+
async function main() {
85+
// Get the service endpoint from the environment
86+
const endpoint = process.env.REGISTRY_ENDPOINT;
87+
// Create a new ContainerRegistryClient
88+
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
89+
90+
console.log("Listing repositories");
91+
const iterator = client.listRepositories();
92+
for await (const repository of iterator) {
93+
console.log(` repository: ${repository}`);
94+
}
95+
96+
console.log(" by pages");
97+
const pages = client.listRepositories().byPage({ maxPageSize: 2 });
98+
let result = await pages.next();
99+
while (!result.done) {
100+
console.log(" -- page -- ");
101+
for (const repository of result.value) {
102+
console.log(` repository: ${repository}`);
103+
}
104+
result = await pages.next();
105+
}
106+
}
107+
108+
main().catch((err) => {
109+
console.error("The sample encountered an error:", err);
110+
});
111+
```
49112

50113
Create several code examples for how someone would use your library to accomplish a common task with the service.
51114

@@ -63,18 +126,32 @@ setLogLevel("info");
63126

64127
## Next steps
65128

66-
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/containerregistry/container-registry/samples) directory for detailed examples that demonstrate how to use the client libraries.
129+
Please take a look at the [samples][samples] directory for detailed examples that demonstrate how to use the client libraries.
67130

68131
## Contributing
69132

70133
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
71134

72135
## Related projects
73136

74-
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
137+
- [Microsoft Azure SDK for Javascript][az_sdk_js]
75138

76139
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcontainerregistry%2Fcontainer-registry%2FREADME.png)
77140

78-
[azure_cli]: https://docs.microsoft.com/cli/azure
79141
[azure_sub]: https://azure.microsoft.com/free/
80142
[acr_resource]: https://ms.portal.azure.com/#create/Microsoft.ContainerRegistry
143+
[source]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/containerregistry/container-registry/
144+
[package]: https://www.npmjs.com/package/@azure/container-registry
145+
[api_docs]: https://docs.microsoft.com/javascript/api/@azure/container-registry
146+
[rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/
147+
[product_docs]: https://docs.microsoft.com/azure/container-registry/
148+
[samples]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/containerregistry/container-registry/samples
149+
[container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro
150+
[container_registry_create_ps]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-powershell
151+
[container_registry_create_cli]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli
152+
[container_registry_create_portal]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal
153+
[container_registry_concepts]: https://docs.microsoft.com/azure/container-registry/container-registry-concepts
154+
[azure_cli]: https://docs.microsoft.com/cli/azure
155+
[azure_sub]: https://azure.microsoft.com/free/
156+
[identity]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md
157+
[az_sdk_js]: https://github.com/Azure/azure-sdk-for-js

0 commit comments

Comments
 (0)