Files
4201b08be2 [AutoPR @azure-arm-containerinstance]-generated-from-SDK Generation - JS-6410514 (#38853)
Configurations:
'specification/containerinstance/resource-manager/Microsoft.ContainerInstance/ContainerInstance/tspconfig.yaml',
API Version: 2026-06-01-preview, SDK Release Type: beta, and CommitSHA:
'1b4778de3e8c7709823e0f95bbd8c29bedeb5bdb' in SpecRepo:
'https://github.com/Azure/azure-rest-api-specs' Pipeline run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6410514
Refer to
https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites
to prepare for SDK release.

### Packages impacted by this PR

`@azure/arm-containerinstance`

### Issues associated with this PR


### Describe the problem that is addressed by this PR

Auto-generated SDK update for `@azure/arm-containerinstance` from
TypeSpec/emitter, targeting API version `2026-06-01-preview` (beta
release). The branch has been updated with the latest changes from the
`main` branch.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?

Auto-generated via SDK generation pipeline (build ID: 6410514).

### Are there test cases added in this PR? _(If not, why?)_

No. This is an auto-generated SDK PR.

### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

Pipeline run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6410514

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)

---------

Co-authored-by: Jiao Di (MSFT) <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jeremymeng <[email protected]>
Co-authored-by: Jeremy Meng <[email protected]>
2026-06-24 13:55:12 +08:00

33 KiB

@azure/arm-containerinstance client library samples for JavaScript (Beta)

These sample programs show how to use the JavaScript client libraries for @azure/arm-containerinstance in some common scenarios.

File Name Description
cgProfileCreateOrUpdateSample.js create a CGProfile if it doesn't exist or update an existing CGProfile. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfileCreateOrUpdate_CreateConfidential.json
cgProfileDeleteSample.js deletes a container group profile. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfilesDelete.json
cgProfileGetByRevisionNumberSample.js gets the properties of the specified revision of the container group profile in the given subscription and resource group. The operation returns the properties of container group profile including containers, image registry credentials, restart policy, IP address type, OS type, volumes, current revision number, etc. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfileGetByRevisionNumber.json
cgProfileGetSample.js get the properties of the specified container group profile. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfilesGet.json
cgProfileListAllRevisionsSample.js get a list of all the revisions of the specified container group profile in the given subscription and resource group. This operation returns properties of each revision of the specified container group profile including containers, image registry credentials, restart policy, IP address type, OS type volumes, revision number, etc. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfileListAllRevisions.json
cgProfileUpdateSample.js update a specified container group profile. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfilesPatch.json
cgProfilesListByResourceGroupSample.js gets a list of all container group profiles under a resource group. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfilesListByResourceGroup.json
cgProfilesListBySubscriptionSample.js gets a list of all container group profiles under a subscription. x-ms-original-file: 2026-06-01-preview/ContainerGroupProfilesList.json
containerGroupsCreateOrUpdateSample.js create or update container groups with specified configurations. x-ms-original-file: 2026-06-01-preview/ContainerGroupCreateConfidential.json
containerGroupsDeleteSample.js delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. x-ms-original-file: 2026-06-01-preview/ContainerGroupsDelete.json
containerGroupsGetOutboundNetworkDependenciesEndpointsSample.js gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list. x-ms-original-file: 2026-06-01-preview/ContainerGroupsGetOutboundNetworkDependenciesEndpoints.json
containerGroupsGetSample.js gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. x-ms-original-file: 2026-06-01-preview/ContainerGroupsGetPriority.json
containerGroupsListByResourceGroupSample.js get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. x-ms-original-file: 2026-06-01-preview/ContainerGroupsListByResourceGroup.json
containerGroupsListSample.js get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. x-ms-original-file: 2026-06-01-preview/ContainerGroupsList.json
containerGroupsRestartSample.js restarts all containers in a container group in place. If container image has updates, new image will be downloaded. x-ms-original-file: 2026-06-01-preview/ContainerGroupsRestart.json
containerGroupsStartSample.js starts all containers in a container group. Compute resources will be allocated and billing will start. x-ms-original-file: 2026-06-01-preview/ContainerGroupsStart.json
containerGroupsStopSample.js stops all containers in a container group. Compute resources will be deallocated and billing will stop. x-ms-original-file: 2026-06-01-preview/ContainerGroupsStop.json
containerGroupsUpdateSample.js updates container group tags with specified values. x-ms-original-file: 2026-06-01-preview/ContainerGroupsUpdate.json
containersAttachSample.js attach to the output stream of a specific container instance in a specified resource group and container group. x-ms-original-file: 2026-06-01-preview/ContainerAttach.json
containersExecuteCommandSample.js executes a command for a specific container instance in a specified resource group and container group. x-ms-original-file: 2026-06-01-preview/ContainerExec.json
containersListLogsSample.js get the logs for a specified container instance in a specified resource group and container group. x-ms-original-file: 2026-06-01-preview/ContainerListLogs.json
locationListCachedImagesSample.js get the list of cached images on specific OS type for a subscription in a region. x-ms-original-file: 2026-06-01-preview/CachedImagesList.json
locationListCapabilitiesSample.js get the list of CPU/memory/GPU capabilities of a region. x-ms-original-file: 2026-06-01-preview/CapabilitiesList.json
locationListUsageSample.js get the usage for a subscription x-ms-original-file: 2026-06-01-preview/ContainerGroupUsage.json
nGroupsCreateOrUpdateSample.js create or update a NGroups resource. x-ms-original-file: 2026-06-01-preview/NGroupsCreateOrUpdate.json
nGroupsDeleteSample.js deletes the NGroups resource. x-ms-original-file: 2026-06-01-preview/NGroupsDelete.json
nGroupsGetSample.js get the properties of the specified NGroups resource. x-ms-original-file: 2026-06-01-preview/NGroupsGet.json
nGroupsListByResourceGroupSample.js gets a list of all NGroups resources under a resource group. x-ms-original-file: 2026-06-01-preview/NGroupsListByResourceGroup.json
nGroupsListSample.js gets a list of all NGroups resources under a subscription. x-ms-original-file: 2026-06-01-preview/NGroupsList.json
nGroupsRestartSample.js restarts all container groups in the specified NGroups resource in place. If container image has updates, new image will be downloaded. x-ms-original-file: 2026-06-01-preview/NGroupsRestart.json
nGroupsStartSample.js starts all container groups in the specified NGroups resource. Compute resources will be allocated and billing will start. x-ms-original-file: 2026-06-01-preview/NGroupsStart.json
nGroupsStopSample.js stops all container groups in the specified NGroups resource. Compute resources will be deallocated and billing will stop. x-ms-original-file: 2026-06-01-preview/NGroupsStop.json
nGroupsUpdateSample.js update a specified NGroups resource. x-ms-original-file: 2026-06-01-preview/NGroupsUpdate.json
operationsListSample.js list the operations for the provider x-ms-original-file: 2026-06-01-preview/OperationsList.json
sandboxGroupsConnectSample.js get an access token and endpoint for connecting to the SandboxGroup. x-ms-original-file: 2026-06-01-preview/SandboxGroupsConnect.json
sandboxGroupsCreateOrUpdateSample.js create a SandboxGroup x-ms-original-file: 2026-06-01-preview/SandboxGroupsCreateOrUpdate.json
sandboxGroupsDeleteSample.js delete a SandboxGroup x-ms-original-file: 2026-06-01-preview/SandboxGroupsDelete.json
sandboxGroupsGetSample.js get a SandboxGroup x-ms-original-file: 2026-06-01-preview/SandboxGroupsGet.json
sandboxGroupsListByResourceGroupSample.js list SandboxGroup resources by resource group x-ms-original-file: 2026-06-01-preview/SandboxGroupsListByResourceGroup.json
sandboxGroupsListBySubscriptionSample.js list SandboxGroup resources by subscription ID x-ms-original-file: 2026-06-01-preview/SandboxGroupsListBySubscription.json
sandboxGroupsUpdateSample.js update a SandboxGroup x-ms-original-file: 2026-06-01-preview/SandboxGroupsUpdate.json
subnetServiceAssociationLinkDeleteSample.js delete container group virtual network association links. The operation does not delete other resources provided by the user. x-ms-original-file: 2026-06-01-preview/SubnetServiceAssociationLinkDelete.json

Prerequisites

The sample programs are compatible with LTS versions of Node.js.

You need an Azure subscription to run these sample programs.

Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.

Adapting the samples to run in the browser may require some additional consideration. For details, please see the package README.

Setup

To run the samples using the published version of the package:

  1. Install the dependencies using npm:
npm install
  1. Edit the file sample.env, adding the correct credentials to access the Azure service and run the samples. Then rename the file from sample.env to just .env. The sample programs will read this file automatically.

  2. Run whichever samples you like (note that some samples may require additional setup, see the table above):

node cgProfileCreateOrUpdateSample.js

Alternatively, run a single sample with the required environment variables set (setting up the .env file is not required if you do this), for example (cross-platform):

node cgProfileCreateOrUpdateSample.js

Next Steps

Take a look at our API Documentation for more information about the APIs that are available in the clients.