@@ -10,8 +10,7 @@ Use the client library for Azure Container Registry to:
1010- Delete images and artifacts, repositories and tags
1111
1212[ Source code] [ source ] |
13- [ Package (NPM)] <!-- [package]--> |
14- [ API reference documentation] <!-- [api_docs]--> |
13+ [ Package (NPM)] [ package ] | <!-- [API reference documentation][api_docs] |-->
1514[ REST API documentation] [ rest_docs ] |
1615[ Product documentation] [ product_docs ] |
1716[ Samples] [ samples ]
@@ -82,36 +81,23 @@ const { ContainerRegistryClient } = require("@azure/container-registry");
8281const { DefaultAzureCredential } = require (" @azure/identity" );
8382
8483async function main () {
85- // Get the service endpoint from the environment
84+ // endpoint should be in the form of "https://myregistryname.azurecr.io"
85+ // where "myregistryname" is the actual name of your registry
8686 const endpoint = process .env .REGISTRY_ENDPOINT ;
87- // Create a new ContainerRegistryClient
8887 const client = new ContainerRegistryClient (endpoint, new DefaultAzureCredential ());
8988
9089 console .log (" Listing repositories" );
9190 const iterator = client .listRepositories ();
9291 for await (const repository of iterator ) {
9392 console .log (` repository: ${ repository} ` );
9493 }
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- }
10694}
10795
10896main ().catch ((err ) => {
10997 console .error (" The sample encountered an error:" , err);
11098});
11199```
112100
113- Create several code examples for how someone would use your library to accomplish a common task with the service.
114-
115101## Troubleshooting
116102
117103### Logging
0 commit comments