diff --git a/sdk/appcontainers/arm-appcontainers/CHANGELOG.md b/sdk/appcontainers/arm-appcontainers/CHANGELOG.md deleted file mode 100644 index 541c2c9a6fbe..000000000000 --- a/sdk/appcontainers/arm-appcontainers/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release History - -## 1.0.0 (2022-05-20) - -The package of @azure/arm-appcontainers is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/appcontainers/arm-appcontainers/_meta.json b/sdk/appcontainers/arm-appcontainers/_meta.json index da4da9210524..c94dda8857d9 100644 --- a/sdk/appcontainers/arm-appcontainers/_meta.json +++ b/sdk/appcontainers/arm-appcontainers/_meta.json @@ -1,8 +1,8 @@ { - "commit": "af0952425f0a9addae574dcc3103df7e50e152f5", + "commit": "cfe4dc8393d283e59cc6af4fceaf2c70eaee31a9", "readme": "specification/app/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\app\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/app/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.1", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/appcontainers/arm-appcontainers/package.json b/sdk/appcontainers/arm-appcontainers/package.json index 35d513756a5a..a511599c5589 100644 --- a/sdk/appcontainers/arm-appcontainers/package.json +++ b/sdk/appcontainers/arm-appcontainers/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerAppsAPIClient.", - "version": "1.0.0", + "version": "1.0.1", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/appcontainers/arm-appcontainers/recordings/node/my_test/recording_sample_test.js b/sdk/appcontainers/arm-appcontainers/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/appcontainers/arm-appcontainers/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/appcontainers/arm-appcontainers/sample.env b/sdk/appcontainers/arm-appcontainers/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesCreateOrUpdateSample.ts deleted file mode 100644 index 0e5d91f4230e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Certificate, - CertificatesCreateOrUpdateOptionalParams, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or Update a Certificate. - * - * @summary Create or Update a Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_CreateOrUpdate.json - */ -async function createOrUpdateCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope: Certificate = { - location: "East US", - properties: { - password: "private key password" - } - }; - const options: CertificatesCreateOrUpdateOptionalParams = { - certificateEnvelope - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.createOrUpdate( - resourceGroupName, - environmentName, - certificateName, - options - ); - console.log(result); -} - -createOrUpdateCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesDeleteSample.ts deleted file mode 100644 index 26138b00ab38..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes the specified Certificate. - * - * @summary Deletes the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Delete.json - */ -async function deleteCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.delete( - resourceGroupName, - environmentName, - certificateName - ); - console.log(result); -} - -deleteCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesGetSample.ts deleted file mode 100644 index 6a6cf8cd5d67..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the specified Certificate. - * - * @summary Get the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Get.json - */ -async function getCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.get( - resourceGroupName, - environmentName, - certificateName - ); - console.log(result); -} - -getCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesListSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesListSample.ts deleted file mode 100644 index c1df14a0467a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Certificates in a given managed environment. - * - * @summary Get the Certificates in a given managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_ListByManagedEnvironment.json - */ -async function listCertificatesByManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.list( - resourceGroupName, - environmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listCertificatesByManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesUpdateSample.ts deleted file mode 100644 index 8ee68aee5eac..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/certificatesUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CertificatePatch, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a certificate. Currently only patching of tags is supported - * - * @summary Patches a certificate. Currently only patching of tags is supported - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_Patch.json - */ -async function patchCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope: CertificatePatch = { - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.update( - resourceGroupName, - environmentName, - certificateName, - certificateEnvelope - ); - console.log(result); -} - -patchCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsCreateOrUpdateSample.ts deleted file mode 100644 index eed4db83c8bb..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthConfig, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update the AuthConfig for a Container App. - * - * @summary Create or update the AuthConfig for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const authConfigEnvelope: AuthConfig = { - globalValidation: { unauthenticatedClientAction: "AllowAnonymous" }, - identityProviders: { - facebook: { - registration: { appId: "123", appSecretSettingName: "facebook-secret" } - } - }, - platform: { enabled: true } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.createOrUpdate( - resourceGroupName, - containerAppName, - authConfigName, - authConfigEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsDeleteSample.ts deleted file mode 100644 index b8a418fb8848..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App AuthConfig. - * - * @summary Delete a Container App AuthConfig. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Delete.json - */ -async function deleteContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.delete( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -deleteContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsGetSample.ts deleted file mode 100644 index 5dadb882a757..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a AuthConfig of a Container App. - * - * @summary Get a AuthConfig of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Get.json - */ -async function getContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.get( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -getContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsListByContainerAppSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsListByContainerAppSample.ts deleted file mode 100644 index 8f01b3631bc0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsAuthConfigsListByContainerAppSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container App AuthConfigs in a given resource group. - * - * @summary Get the Container App AuthConfigs in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_ListByContainer.json - */ -async function listAuthConfigsByContainerApps() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsAuthConfigs.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAuthConfigsByContainerApps().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsCreateOrUpdateSample.ts deleted file mode 100644 index 7865bd9656af..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsCreateOrUpdateSample.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerApp, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update a Container App. - * - * @summary Create or update a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CreateOrUpdate.json - */ -async function createOrUpdateContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope: ContainerApp = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" - } - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100 - } - ] - } - }, - location: "East US", - managedEnvironmentId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080 - }, - initialDelaySeconds: 3, - periodSeconds: 3 - } - ] - } - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } } - } - ] - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -createOrUpdateContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsDeleteSample.ts deleted file mode 100644 index 4babaab2596f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App. - * - * @summary Delete a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Delete.json - */ -async function deleteContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testWorkerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginDeleteAndWait( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -deleteContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsGetSample.ts deleted file mode 100644 index c12b9b8ea3af..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the properties of a Container App. - * - * @summary Get the properties of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Get.json - */ -async function getContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.get( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -getContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListByResourceGroupSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListByResourceGroupSample.ts deleted file mode 100644 index 5b4f07a34b8e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container Apps in a given resource group. - * - * @summary Get the Container Apps in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListByResourceGroup.json - */ -async function listContainerAppsByResourceGroup() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListBySubscriptionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListBySubscriptionSample.ts deleted file mode 100644 index 083de99fa8f7..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container Apps in a given subscription. - * - * @summary Get the Container Apps in a given subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListBySubscription.json - */ -async function listContainerAppsBySubscription() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListCustomHostNameAnalysisSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListCustomHostNameAnalysisSample.ts deleted file mode 100644 index 0eaf4a1b2ca4..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListCustomHostNameAnalysisSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ContainerAppsListCustomHostNameAnalysisOptionalParams, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Analyzes a custom hostname for a Container App - * - * @summary Analyzes a custom hostname for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json - */ -async function analyzeCustomHostname() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const customHostname = "my.name.corp"; - const options: ContainerAppsListCustomHostNameAnalysisOptionalParams = { - customHostname - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listCustomHostNameAnalysis( - resourceGroupName, - containerAppName, - options - ); - console.log(result); -} - -analyzeCustomHostname().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListSecretsSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListSecretsSample.ts deleted file mode 100644 index 5099327d3e1a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsListSecretsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List secrets for a container app - * - * @summary List secrets for a container app - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listSecrets( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasGetReplicaSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasGetReplicaSample.ts deleted file mode 100644 index 6581e7ce8f54..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasGetReplicaSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a replica for a Container App Revision. - * - * @summary Get a replica for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_Get.json - */ -async function getContainerAppRevisionReplica() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const replicaName = "myapp--0wlqy09-5d9774cff-5wnd8"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.getReplica( - resourceGroupName, - containerAppName, - revisionName, - replicaName - ); - console.log(result); -} - -getContainerAppRevisionReplica().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasListReplicasSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasListReplicasSample.ts deleted file mode 100644 index 2ad7914f417e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionReplicasListReplicasSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List replicas for a Container App Revision. - * - * @summary List replicas for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_List.json - */ -async function listContainerAppReplicas() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.listReplicas( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -listContainerAppReplicas().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsActivateRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsActivateRevisionSample.ts deleted file mode 100644 index f479ab618d9c..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsActivateRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Activates a revision for a Container App - * - * @summary Activates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Activate.json - */ -async function activateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.activateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -activateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsDeactivateRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsDeactivateRevisionSample.ts deleted file mode 100644 index 7e4de8a401df..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsDeactivateRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deactivates a revision for a Container App - * - * @summary Deactivates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Deactivate.json - */ -async function deactivateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.deactivateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -deactivateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsGetRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsGetRevisionSample.ts deleted file mode 100644 index 8602f6543c76..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsGetRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a revision of a Container App. - * - * @summary Get a revision of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Get.json - */ -async function getContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.getRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -getContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsListRevisionsSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsListRevisionsSample.ts deleted file mode 100644 index 98dc8a984250..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsListRevisionsSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Revisions for a given Container App. - * - * @summary Get the Revisions for a given Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_List.json - */ -async function listContainerAppRevisions() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsRevisions.listRevisions( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppRevisions().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsRestartRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsRestartRevisionSample.ts deleted file mode 100644 index ca5b9c238052..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsRevisionsRestartRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Restarts a revision for a Container App - * - * @summary Restarts a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Restart.json - */ -async function restartContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testStaticSite0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.restartRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -restartContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsCreateOrUpdateSample.ts deleted file mode 100644 index 7ad01837feda..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsCreateOrUpdateSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SourceControl, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update the SourceControl for a Container App. - * - * @summary Create or update the SourceControl for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const sourceControlEnvelope: SourceControl = { - branch: "master", - githubActionConfiguration: { - azureCredentials: { - clientId: "", - clientSecret: "", - tenantId: "" - }, - contextPath: "./", - image: "image/tag", - registryInfo: { - registryPassword: "", - registryUrl: "xwang971reg.azurecr.io", - registryUserName: "xwang971reg" - } - }, - repoUrl: "https://github.com/xwang971/ghatest" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - sourceControlName, - sourceControlEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsDeleteSample.ts deleted file mode 100644 index d87e139105be..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App SourceControl. - * - * @summary Delete a Container App SourceControl. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Delete.json - */ -async function deleteContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginDeleteAndWait( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -deleteContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsGetSample.ts deleted file mode 100644 index 2ad344455f98..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a SourceControl of a Container App. - * - * @summary Get a SourceControl of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Get.json - */ -async function getContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.get( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -getContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsListByContainerAppSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsListByContainerAppSample.ts deleted file mode 100644 index 4bde4d923044..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsSourceControlsListByContainerAppSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container App SourceControls in a given resource group. - * - * @summary Get the Container App SourceControls in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_ListByContainer.json - */ -async function listAppSourceControls() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsSourceControls.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAppSourceControls().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsUpdateSample.ts deleted file mode 100644 index 9a82da9e801f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/containerAppsUpdateSample.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerApp, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a Container App using JSON Merge Patch - * - * @summary Patches a Container App using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Patch.json - */ -async function patchContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope: ContainerApp = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" - } - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100 - } - ] - } - }, - location: "East US", - tags: { tag1: "value1", tag2: "value2" }, - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080 - }, - initialDelaySeconds: 3, - periodSeconds: 3 - } - ] - } - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } } - } - ] - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -patchContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsCreateOrUpdateSample.ts deleted file mode 100644 index 497bb397cad4..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DaprComponent, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a Dapr Component in a Managed Environment. - * - * @summary Creates or updates a Dapr Component in a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_CreateOrUpdate.json - */ -async function createOrUpdateDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const daprComponentEnvelope: DaprComponent = { - componentType: "state.azure.cosmosdb", - ignoreErrors: false, - initTimeout: "50s", - metadata: [ - { name: "url", value: "" }, - { name: "database", value: "itemsDB" }, - { name: "collection", value: "items" }, - { name: "masterkey", secretRef: "masterkey" } - ], - scopes: ["container-app-1", "container-app-2"], - secrets: [{ name: "masterkey", value: "keyvalue" }], - version: "v1" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.createOrUpdate( - resourceGroupName, - environmentName, - componentName, - daprComponentEnvelope - ); - console.log(result); -} - -createOrUpdateDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsDeleteSample.ts deleted file mode 100644 index e95941713bc2..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Dapr Component from a Managed Environment. - * - * @summary Delete a Dapr Component from a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Delete.json - */ -async function deleteDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.delete( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -deleteDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsGetSample.ts deleted file mode 100644 index 5f011d873aa5..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a dapr component. - * - * @summary Get a dapr component. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Get.json - */ -async function getDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.get( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -getDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSample.ts deleted file mode 100644 index 505eb2ace62b..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Dapr Components for a managed environment. - * - * @summary Get the Dapr Components for a managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_List.json - */ -async function listDaprComponents() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.daprComponents.list( - resourceGroupName, - environmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDaprComponents().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSecretsSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSecretsSample.ts deleted file mode 100644 index 534895b9acca..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/daprComponentsListSecretsSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List secrets for a dapr component - * - * @summary List secrets for a dapr component - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.listSecrets( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsCreateOrUpdateSample.ts deleted file mode 100644 index 6aea6e454ea0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironment, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a Managed Environment used to host container apps. - * - * @summary Creates or updates a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_CreateOrUpdate.json - */ -async function createEnvironments() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope: ManagedEnvironment = { - appLogsConfiguration: { - logAnalyticsConfiguration: { customerId: "string", sharedKey: "string" } - }, - daprAIConnectionString: - "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", - location: "East US", - zoneRedundant: true - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginCreateOrUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -createEnvironments().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsDeleteSample.ts deleted file mode 100644 index b7359c4b8228..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Managed Environment if it does not have any container apps. - * - * @summary Delete a Managed Environment if it does not have any container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Delete.json - */ -async function deleteEnvironmentByName() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "examplekenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginDeleteAndWait( - resourceGroupName, - environmentName - ); - console.log(result); -} - -deleteEnvironmentByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsGetSample.ts deleted file mode 100644 index 025177e41a75..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the properties of a Managed Environment used to host container apps. - * - * @summary Get the properties of a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Get.json - */ -async function getEnvironmentsByName() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.get( - resourceGroupName, - environmentName - ); - console.log(result); -} - -getEnvironmentsByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListByResourceGroupSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListByResourceGroupSample.ts deleted file mode 100644 index 7fbbf3dde8b1..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all the Managed Environments in a resource group. - * - * @summary Get all the Managed Environments in a resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListByResourceGroup.json - */ -async function listEnvironmentsByResourceGroup() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListBySubscriptionSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListBySubscriptionSample.ts deleted file mode 100644 index 5f2338939282..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all Managed Environments for a subscription. - * - * @summary Get all Managed Environments for a subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListBySubscription.json - */ -async function listEnvironmentsBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesCreateOrUpdateSample.ts deleted file mode 100644 index 9134c71e5932..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironmentStorage, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update storage for a managedEnvironment. - * - * @summary Create or update storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json - */ -async function createOrUpdateEnvironmentsStorage() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const storageEnvelope: ManagedEnvironmentStorage = { - properties: { - azureFile: { - accessMode: "ReadOnly", - accountKey: "key", - accountName: "account1", - shareName: "share1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.createOrUpdate( - resourceGroupName, - environmentName, - storageName, - storageEnvelope - ); - console.log(result); -} - -createOrUpdateEnvironmentsStorage().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesDeleteSample.ts deleted file mode 100644 index aacb37ea0832..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete storage for a managedEnvironment. - * - * @summary Delete storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Delete.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.delete( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesGetSample.ts deleted file mode 100644 index 204faff5dc5e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get storage for a managedEnvironment. - * - * @summary Get storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Get.json - */ -async function getAEnvironmentsStoragePropertiesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.get( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -getAEnvironmentsStoragePropertiesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesListSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesListSample.ts deleted file mode 100644 index 6f4742373ae6..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsStoragesListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all storages for a managedEnvironment. - * - * @summary Get all storages for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_List.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.list( - resourceGroupName, - environmentName - ); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsUpdateSample.ts deleted file mode 100644 index 9213af785b0d..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/managedEnvironmentsUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironment, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a Managed Environment using JSON Merge Patch - * - * @summary Patches a Managed Environment using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Patch.json - */ -async function patchManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope: ManagedEnvironment = { - location: "East US", - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -patchManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/namespacesCheckNameAvailabilitySample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/namespacesCheckNameAvailabilitySample.ts deleted file mode 100644 index bd9a06d62f5f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/namespacesCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json - */ -async function certificatesCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "testcertificatename", - type: "Microsoft.App/managedEnvironments/certificates" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -certificatesCheckNameAvailability().catch(console.error); - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json - */ -async function containerAppsCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "testcappname", - type: "Microsoft.App/containerApps" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -containerAppsCheckNameAvailability().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples-dev/operationsListSample.ts b/sdk/appcontainers/arm-appcontainers/samples-dev/operationsListSample.ts deleted file mode 100644 index 550f15fed140..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all of the available RP operations. - * - * @summary Lists all of the available RP operations. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Operations_List.json - */ -async function listAllOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -listAllOperations().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/README.md b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/README.md deleted file mode 100644 index 98eb06ffed0b..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [certificatesCreateOrUpdateSample.js][certificatescreateorupdatesample] | Create or Update a Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_CreateOrUpdate.json | -| [certificatesDeleteSample.js][certificatesdeletesample] | Deletes the specified Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Delete.json | -| [certificatesGetSample.js][certificatesgetsample] | Get the specified Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Get.json | -| [certificatesListSample.js][certificateslistsample] | Get the Certificates in a given managed environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_ListByManagedEnvironment.json | -| [certificatesUpdateSample.js][certificatesupdatesample] | Patches a certificate. Currently only patching of tags is supported x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_Patch.json | -| [containerAppsAuthConfigsCreateOrUpdateSample.js][containerappsauthconfigscreateorupdatesample] | Create or update the AuthConfig for a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_CreateOrUpdate.json | -| [containerAppsAuthConfigsDeleteSample.js][containerappsauthconfigsdeletesample] | Delete a Container App AuthConfig. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Delete.json | -| [containerAppsAuthConfigsGetSample.js][containerappsauthconfigsgetsample] | Get a AuthConfig of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Get.json | -| [containerAppsAuthConfigsListByContainerAppSample.js][containerappsauthconfigslistbycontainerappsample] | Get the Container App AuthConfigs in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_ListByContainer.json | -| [containerAppsCreateOrUpdateSample.js][containerappscreateorupdatesample] | Create or update a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CreateOrUpdate.json | -| [containerAppsDeleteSample.js][containerappsdeletesample] | Delete a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Delete.json | -| [containerAppsGetSample.js][containerappsgetsample] | Get the properties of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Get.json | -| [containerAppsListByResourceGroupSample.js][containerappslistbyresourcegroupsample] | Get the Container Apps in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListByResourceGroup.json | -| [containerAppsListBySubscriptionSample.js][containerappslistbysubscriptionsample] | Get the Container Apps in a given subscription. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListBySubscription.json | -| [containerAppsListCustomHostNameAnalysisSample.js][containerappslistcustomhostnameanalysissample] | Analyzes a custom hostname for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json | -| [containerAppsListSecretsSample.js][containerappslistsecretssample] | List secrets for a container app x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListSecrets.json | -| [containerAppsRevisionReplicasGetReplicaSample.js][containerappsrevisionreplicasgetreplicasample] | Get a replica for a Container App Revision. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_Get.json | -| [containerAppsRevisionReplicasListReplicasSample.js][containerappsrevisionreplicaslistreplicassample] | List replicas for a Container App Revision. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_List.json | -| [containerAppsRevisionsActivateRevisionSample.js][containerappsrevisionsactivaterevisionsample] | Activates a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Activate.json | -| [containerAppsRevisionsDeactivateRevisionSample.js][containerappsrevisionsdeactivaterevisionsample] | Deactivates a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Deactivate.json | -| [containerAppsRevisionsGetRevisionSample.js][containerappsrevisionsgetrevisionsample] | Get a revision of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Get.json | -| [containerAppsRevisionsListRevisionsSample.js][containerappsrevisionslistrevisionssample] | Get the Revisions for a given Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_List.json | -| [containerAppsRevisionsRestartRevisionSample.js][containerappsrevisionsrestartrevisionsample] | Restarts a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Restart.json | -| [containerAppsSourceControlsCreateOrUpdateSample.js][containerappssourcecontrolscreateorupdatesample] | Create or update the SourceControl for a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_CreateOrUpdate.json | -| [containerAppsSourceControlsDeleteSample.js][containerappssourcecontrolsdeletesample] | Delete a Container App SourceControl. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Delete.json | -| [containerAppsSourceControlsGetSample.js][containerappssourcecontrolsgetsample] | Get a SourceControl of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Get.json | -| [containerAppsSourceControlsListByContainerAppSample.js][containerappssourcecontrolslistbycontainerappsample] | Get the Container App SourceControls in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_ListByContainer.json | -| [containerAppsUpdateSample.js][containerappsupdatesample] | Patches a Container App using JSON Merge Patch x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Patch.json | -| [daprComponentsCreateOrUpdateSample.js][daprcomponentscreateorupdatesample] | Creates or updates a Dapr Component in a Managed Environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_CreateOrUpdate.json | -| [daprComponentsDeleteSample.js][daprcomponentsdeletesample] | Delete a Dapr Component from a Managed Environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Delete.json | -| [daprComponentsGetSample.js][daprcomponentsgetsample] | Get a dapr component. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Get.json | -| [daprComponentsListSample.js][daprcomponentslistsample] | Get the Dapr Components for a managed environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_List.json | -| [daprComponentsListSecretsSample.js][daprcomponentslistsecretssample] | List secrets for a dapr component x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json | -| [managedEnvironmentsCreateOrUpdateSample.js][managedenvironmentscreateorupdatesample] | Creates or updates a Managed Environment used to host container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_CreateOrUpdate.json | -| [managedEnvironmentsDeleteSample.js][managedenvironmentsdeletesample] | Delete a Managed Environment if it does not have any container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Delete.json | -| [managedEnvironmentsGetSample.js][managedenvironmentsgetsample] | Get the properties of a Managed Environment used to host container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Get.json | -| [managedEnvironmentsListByResourceGroupSample.js][managedenvironmentslistbyresourcegroupsample] | Get all the Managed Environments in a resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListByResourceGroup.json | -| [managedEnvironmentsListBySubscriptionSample.js][managedenvironmentslistbysubscriptionsample] | Get all Managed Environments for a subscription. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListBySubscription.json | -| [managedEnvironmentsStoragesCreateOrUpdateSample.js][managedenvironmentsstoragescreateorupdatesample] | Create or update storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json | -| [managedEnvironmentsStoragesDeleteSample.js][managedenvironmentsstoragesdeletesample] | Delete storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Delete.json | -| [managedEnvironmentsStoragesGetSample.js][managedenvironmentsstoragesgetsample] | Get storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Get.json | -| [managedEnvironmentsStoragesListSample.js][managedenvironmentsstorageslistsample] | Get all storages for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_List.json | -| [managedEnvironmentsUpdateSample.js][managedenvironmentsupdatesample] | Patches a Managed Environment using JSON Merge Patch x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Patch.json | -| [namespacesCheckNameAvailabilitySample.js][namespaceschecknameavailabilitysample] | Checks if resource name is available. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available RP operations. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Operations_List.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -You need [an Azure subscription][freesub] 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][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. 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. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node certificatesCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node certificatesCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesCreateOrUpdateSample.js -[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesDeleteSample.js -[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesGetSample.js -[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesListSample.js -[certificatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesUpdateSample.js -[containerappsauthconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsCreateOrUpdateSample.js -[containerappsauthconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsDeleteSample.js -[containerappsauthconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsGetSample.js -[containerappsauthconfigslistbycontainerappsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsListByContainerAppSample.js -[containerappscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsCreateOrUpdateSample.js -[containerappsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsDeleteSample.js -[containerappsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsGetSample.js -[containerappslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListByResourceGroupSample.js -[containerappslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListBySubscriptionSample.js -[containerappslistcustomhostnameanalysissample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListCustomHostNameAnalysisSample.js -[containerappslistsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListSecretsSample.js -[containerappsrevisionreplicasgetreplicasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasGetReplicaSample.js -[containerappsrevisionreplicaslistreplicassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasListReplicasSample.js -[containerappsrevisionsactivaterevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsActivateRevisionSample.js -[containerappsrevisionsdeactivaterevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsDeactivateRevisionSample.js -[containerappsrevisionsgetrevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsGetRevisionSample.js -[containerappsrevisionslistrevisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsListRevisionsSample.js -[containerappsrevisionsrestartrevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsRestartRevisionSample.js -[containerappssourcecontrolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsCreateOrUpdateSample.js -[containerappssourcecontrolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsDeleteSample.js -[containerappssourcecontrolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsGetSample.js -[containerappssourcecontrolslistbycontainerappsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsListByContainerAppSample.js -[containerappsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsUpdateSample.js -[daprcomponentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsCreateOrUpdateSample.js -[daprcomponentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsDeleteSample.js -[daprcomponentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsGetSample.js -[daprcomponentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSample.js -[daprcomponentslistsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSecretsSample.js -[managedenvironmentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsCreateOrUpdateSample.js -[managedenvironmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsDeleteSample.js -[managedenvironmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsGetSample.js -[managedenvironmentslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListByResourceGroupSample.js -[managedenvironmentslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListBySubscriptionSample.js -[managedenvironmentsstoragescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesCreateOrUpdateSample.js -[managedenvironmentsstoragesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesDeleteSample.js -[managedenvironmentsstoragesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesGetSample.js -[managedenvironmentsstorageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesListSample.js -[managedenvironmentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsUpdateSample.js -[namespaceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/namespacesCheckNameAvailabilitySample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/operationsListSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers/README.md diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesCreateOrUpdateSample.js deleted file mode 100644 index 610c9d4c1ced..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or Update a Certificate. - * - * @summary Create or Update a Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_CreateOrUpdate.json - */ -async function createOrUpdateCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope = { - location: "East US", - properties: { - password: "private key password", - }, - }; - const options = { - certificateEnvelope, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.createOrUpdate( - resourceGroupName, - environmentName, - certificateName, - options - ); - console.log(result); -} - -createOrUpdateCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesDeleteSample.js deleted file mode 100644 index 26960a6b3e11..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes the specified Certificate. - * - * @summary Deletes the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Delete.json - */ -async function deleteCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.delete( - resourceGroupName, - environmentName, - certificateName - ); - console.log(result); -} - -deleteCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesGetSample.js deleted file mode 100644 index caa878f9cd5e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the specified Certificate. - * - * @summary Get the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Get.json - */ -async function getCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.get(resourceGroupName, environmentName, certificateName); - console.log(result); -} - -getCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesListSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesListSample.js deleted file mode 100644 index 6883691a24fe..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesListSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Certificates in a given managed environment. - * - * @summary Get the Certificates in a given managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_ListByManagedEnvironment.json - */ -async function listCertificatesByManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.list(resourceGroupName, environmentName)) { - resArray.push(item); - } - console.log(resArray); -} - -listCertificatesByManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesUpdateSample.js deleted file mode 100644 index abf04a76fb9b..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/certificatesUpdateSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Patches a certificate. Currently only patching of tags is supported - * - * @summary Patches a certificate. Currently only patching of tags is supported - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_Patch.json - */ -async function patchCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope = { - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.update( - resourceGroupName, - environmentName, - certificateName, - certificateEnvelope - ); - console.log(result); -} - -patchCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsCreateOrUpdateSample.js deleted file mode 100644 index ff8190820dff..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or update the AuthConfig for a Container App. - * - * @summary Create or update the AuthConfig for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const authConfigEnvelope = { - globalValidation: { unauthenticatedClientAction: "AllowAnonymous" }, - identityProviders: { - facebook: { - registration: { appId: "123", appSecretSettingName: "facebook-secret" }, - }, - }, - platform: { enabled: true }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.createOrUpdate( - resourceGroupName, - containerAppName, - authConfigName, - authConfigEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsDeleteSample.js deleted file mode 100644 index e57f0ff84ef9..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete a Container App AuthConfig. - * - * @summary Delete a Container App AuthConfig. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Delete.json - */ -async function deleteContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.delete( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -deleteContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsGetSample.js deleted file mode 100644 index 2cc703300983..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a AuthConfig of a Container App. - * - * @summary Get a AuthConfig of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Get.json - */ -async function getContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.get( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -getContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsListByContainerAppSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsListByContainerAppSample.js deleted file mode 100644 index ec0e495db116..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsAuthConfigsListByContainerAppSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Container App AuthConfigs in a given resource group. - * - * @summary Get the Container App AuthConfigs in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_ListByContainer.json - */ -async function listAuthConfigsByContainerApps() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsAuthConfigs.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAuthConfigsByContainerApps().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsCreateOrUpdateSample.js deleted file mode 100644 index 5cc9594c8da7..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsCreateOrUpdateSample.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or update a Container App. - * - * @summary Create or update a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CreateOrUpdate.json - */ -async function createOrUpdateContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", - }, - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100, - }, - ], - }, - }, - location: "East US", - managedEnvironmentId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080, - }, - initialDelaySeconds: 3, - periodSeconds: 3, - }, - ], - }, - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } }, - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -createOrUpdateContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsDeleteSample.js deleted file mode 100644 index 531fe32a5131..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete a Container App. - * - * @summary Delete a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Delete.json - */ -async function deleteContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testWorkerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginDeleteAndWait(resourceGroupName, containerAppName); - console.log(result); -} - -deleteContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsGetSample.js deleted file mode 100644 index 7a30bce65b8a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the properties of a Container App. - * - * @summary Get the properties of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Get.json - */ -async function getContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.get(resourceGroupName, containerAppName); - console.log(result); -} - -getContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListByResourceGroupSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListByResourceGroupSample.js deleted file mode 100644 index 81db87e5d829..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Container Apps in a given resource group. - * - * @summary Get the Container Apps in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListByResourceGroup.json - */ -async function listContainerAppsByResourceGroup() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListBySubscriptionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListBySubscriptionSample.js deleted file mode 100644 index 763a89dca89e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Container Apps in a given subscription. - * - * @summary Get the Container Apps in a given subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListBySubscription.json - */ -async function listContainerAppsBySubscription() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListCustomHostNameAnalysisSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListCustomHostNameAnalysisSample.js deleted file mode 100644 index 3e8456c7bb91..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListCustomHostNameAnalysisSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Analyzes a custom hostname for a Container App - * - * @summary Analyzes a custom hostname for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json - */ -async function analyzeCustomHostname() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const customHostname = "my.name.corp"; - const options = { - customHostname, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listCustomHostNameAnalysis( - resourceGroupName, - containerAppName, - options - ); - console.log(result); -} - -analyzeCustomHostname().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListSecretsSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListSecretsSample.js deleted file mode 100644 index 9e005cdd9749..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsListSecretsSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List secrets for a container app - * - * @summary List secrets for a container app - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listSecrets(resourceGroupName, containerAppName); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasGetReplicaSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasGetReplicaSample.js deleted file mode 100644 index 127c0b693a4f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasGetReplicaSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a replica for a Container App Revision. - * - * @summary Get a replica for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_Get.json - */ -async function getContainerAppRevisionReplica() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const replicaName = "myapp--0wlqy09-5d9774cff-5wnd8"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.getReplica( - resourceGroupName, - containerAppName, - revisionName, - replicaName - ); - console.log(result); -} - -getContainerAppRevisionReplica().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasListReplicasSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasListReplicasSample.js deleted file mode 100644 index cb073b31ca5b..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionReplicasListReplicasSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List replicas for a Container App Revision. - * - * @summary List replicas for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_List.json - */ -async function listContainerAppReplicas() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.listReplicas( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -listContainerAppReplicas().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsActivateRevisionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsActivateRevisionSample.js deleted file mode 100644 index b29d5ce8ebc1..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsActivateRevisionSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Activates a revision for a Container App - * - * @summary Activates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Activate.json - */ -async function activateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.activateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -activateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsDeactivateRevisionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsDeactivateRevisionSample.js deleted file mode 100644 index 7b70019c1e14..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsDeactivateRevisionSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deactivates a revision for a Container App - * - * @summary Deactivates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Deactivate.json - */ -async function deactivateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.deactivateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -deactivateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsGetRevisionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsGetRevisionSample.js deleted file mode 100644 index 45591bc0c272..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsGetRevisionSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a revision of a Container App. - * - * @summary Get a revision of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Get.json - */ -async function getContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.getRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -getContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsListRevisionsSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsListRevisionsSample.js deleted file mode 100644 index 03ddcf44d3ee..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsListRevisionsSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Revisions for a given Container App. - * - * @summary Get the Revisions for a given Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_List.json - */ -async function listContainerAppRevisions() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsRevisions.listRevisions( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppRevisions().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsRestartRevisionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsRestartRevisionSample.js deleted file mode 100644 index da0e7b6afe44..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsRevisionsRestartRevisionSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Restarts a revision for a Container App - * - * @summary Restarts a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Restart.json - */ -async function restartContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testStaticSite0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.restartRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -restartContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsCreateOrUpdateSample.js deleted file mode 100644 index af48f7d1c47a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsCreateOrUpdateSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or update the SourceControl for a Container App. - * - * @summary Create or update the SourceControl for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const sourceControlEnvelope = { - branch: "master", - githubActionConfiguration: { - azureCredentials: { - clientId: "", - clientSecret: "", - tenantId: "", - }, - contextPath: "./", - image: "image/tag", - registryInfo: { - registryPassword: "", - registryUrl: "xwang971reg.azurecr.io", - registryUserName: "xwang971reg", - }, - }, - repoUrl: "https://github.com/xwang971/ghatest", - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - sourceControlName, - sourceControlEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsDeleteSample.js deleted file mode 100644 index c78f7b0ba888..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete a Container App SourceControl. - * - * @summary Delete a Container App SourceControl. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Delete.json - */ -async function deleteContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginDeleteAndWait( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -deleteContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsGetSample.js deleted file mode 100644 index 4c2ed4788bba..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a SourceControl of a Container App. - * - * @summary Get a SourceControl of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Get.json - */ -async function getContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.get( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -getContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsListByContainerAppSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsListByContainerAppSample.js deleted file mode 100644 index cad8f83554a7..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsSourceControlsListByContainerAppSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Container App SourceControls in a given resource group. - * - * @summary Get the Container App SourceControls in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_ListByContainer.json - */ -async function listAppSourceControls() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsSourceControls.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAppSourceControls().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsUpdateSample.js deleted file mode 100644 index 5a3486e82481..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/containerAppsUpdateSample.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Patches a Container App using JSON Merge Patch - * - * @summary Patches a Container App using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Patch.json - */ -async function patchContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", - }, - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100, - }, - ], - }, - }, - location: "East US", - tags: { tag1: "value1", tag2: "value2" }, - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080, - }, - initialDelaySeconds: 3, - periodSeconds: 3, - }, - ], - }, - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } }, - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -patchContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsCreateOrUpdateSample.js deleted file mode 100644 index 420e94238a9a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsCreateOrUpdateSample.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a Dapr Component in a Managed Environment. - * - * @summary Creates or updates a Dapr Component in a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_CreateOrUpdate.json - */ -async function createOrUpdateDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const daprComponentEnvelope = { - componentType: "state.azure.cosmosdb", - ignoreErrors: false, - initTimeout: "50s", - metadata: [ - { name: "url", value: "" }, - { name: "database", value: "itemsDB" }, - { name: "collection", value: "items" }, - { name: "masterkey", secretRef: "masterkey" }, - ], - scopes: ["container-app-1", "container-app-2"], - secrets: [{ name: "masterkey", value: "keyvalue" }], - version: "v1", - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.createOrUpdate( - resourceGroupName, - environmentName, - componentName, - daprComponentEnvelope - ); - console.log(result); -} - -createOrUpdateDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsDeleteSample.js deleted file mode 100644 index 9df37d2677ae..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete a Dapr Component from a Managed Environment. - * - * @summary Delete a Dapr Component from a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Delete.json - */ -async function deleteDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.delete( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -deleteDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsGetSample.js deleted file mode 100644 index c8e64db30d9e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a dapr component. - * - * @summary Get a dapr component. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Get.json - */ -async function getDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.get(resourceGroupName, environmentName, componentName); - console.log(result); -} - -getDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSample.js deleted file mode 100644 index ca0d8eb409bb..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the Dapr Components for a managed environment. - * - * @summary Get the Dapr Components for a managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_List.json - */ -async function listDaprComponents() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.daprComponents.list(resourceGroupName, environmentName)) { - resArray.push(item); - } - console.log(resArray); -} - -listDaprComponents().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSecretsSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSecretsSample.js deleted file mode 100644 index 2ae85dd027ef..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/daprComponentsListSecretsSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List secrets for a dapr component - * - * @summary List secrets for a dapr component - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.listSecrets( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsCreateOrUpdateSample.js deleted file mode 100644 index f894cf729dec..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsCreateOrUpdateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a Managed Environment used to host container apps. - * - * @summary Creates or updates a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_CreateOrUpdate.json - */ -async function createEnvironments() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope = { - appLogsConfiguration: { - logAnalyticsConfiguration: { customerId: "string", sharedKey: "string" }, - }, - daprAIConnectionString: - "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", - location: "East US", - zoneRedundant: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginCreateOrUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -createEnvironments().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsDeleteSample.js deleted file mode 100644 index 92d4a01e6217..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete a Managed Environment if it does not have any container apps. - * - * @summary Delete a Managed Environment if it does not have any container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Delete.json - */ -async function deleteEnvironmentByName() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "examplekenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginDeleteAndWait( - resourceGroupName, - environmentName - ); - console.log(result); -} - -deleteEnvironmentByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsGetSample.js deleted file mode 100644 index 7f0ba021c03f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the properties of a Managed Environment used to host container apps. - * - * @summary Get the properties of a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Get.json - */ -async function getEnvironmentsByName() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.get(resourceGroupName, environmentName); - console.log(result); -} - -getEnvironmentsByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListByResourceGroupSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListByResourceGroupSample.js deleted file mode 100644 index 04206e51ab7a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get all the Managed Environments in a resource group. - * - * @summary Get all the Managed Environments in a resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListByResourceGroup.json - */ -async function listEnvironmentsByResourceGroup() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListBySubscriptionSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListBySubscriptionSample.js deleted file mode 100644 index b9fa96ff0b13..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get all Managed Environments for a subscription. - * - * @summary Get all Managed Environments for a subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListBySubscription.json - */ -async function listEnvironmentsBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesCreateOrUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesCreateOrUpdateSample.js deleted file mode 100644 index de1e74eddc42..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesCreateOrUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or update storage for a managedEnvironment. - * - * @summary Create or update storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json - */ -async function createOrUpdateEnvironmentsStorage() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const storageEnvelope = { - properties: { - azureFile: { - accessMode: "ReadOnly", - accountKey: "key", - accountName: "account1", - shareName: "share1", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.createOrUpdate( - resourceGroupName, - environmentName, - storageName, - storageEnvelope - ); - console.log(result); -} - -createOrUpdateEnvironmentsStorage().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesDeleteSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesDeleteSample.js deleted file mode 100644 index 1392683b6d47..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete storage for a managedEnvironment. - * - * @summary Delete storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Delete.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.delete( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesGetSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesGetSample.js deleted file mode 100644 index de795b73b6c3..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get storage for a managedEnvironment. - * - * @summary Get storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Get.json - */ -async function getAEnvironmentsStoragePropertiesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.get( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -getAEnvironmentsStoragePropertiesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesListSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesListSample.js deleted file mode 100644 index 9b1f16390370..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsStoragesListSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get all storages for a managedEnvironment. - * - * @summary Get all storages for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_List.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.list(resourceGroupName, environmentName); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsUpdateSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsUpdateSample.js deleted file mode 100644 index 29ba19235066..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/managedEnvironmentsUpdateSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Patches a Managed Environment using JSON Merge Patch - * - * @summary Patches a Managed Environment using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Patch.json - */ -async function patchManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope = { - location: "East US", - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -patchManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/namespacesCheckNameAvailabilitySample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/namespacesCheckNameAvailabilitySample.js deleted file mode 100644 index 4d1dea327781..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/namespacesCheckNameAvailabilitySample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json - */ -async function certificatesCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest = { - name: "testcertificatename", - type: "Microsoft.App/managedEnvironments/certificates", - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -certificatesCheckNameAvailability().catch(console.error); - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json - */ -async function containerAppsCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest = { - name: "testcappname", - type: "Microsoft.App/containerApps", - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -containerAppsCheckNameAvailability().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/operationsListSample.js b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 125edc9131a3..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all of the available RP operations. - * - * @summary Lists all of the available RP operations. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Operations_List.json - */ -async function listAllOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -listAllOperations().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/package.json b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/package.json deleted file mode 100644 index a0423da95963..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-appcontainers-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=12.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/appcontainers/arm-appcontainers" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers", - "dependencies": { - "@azure/arm-appcontainers": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/sample.env b/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/README.md b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/README.md deleted file mode 100644 index ad2bf2ffc8c2..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/README.md +++ /dev/null @@ -1,151 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [certificatesCreateOrUpdateSample.ts][certificatescreateorupdatesample] | Create or Update a Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_CreateOrUpdate.json | -| [certificatesDeleteSample.ts][certificatesdeletesample] | Deletes the specified Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Delete.json | -| [certificatesGetSample.ts][certificatesgetsample] | Get the specified Certificate. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Get.json | -| [certificatesListSample.ts][certificateslistsample] | Get the Certificates in a given managed environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_ListByManagedEnvironment.json | -| [certificatesUpdateSample.ts][certificatesupdatesample] | Patches a certificate. Currently only patching of tags is supported x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_Patch.json | -| [containerAppsAuthConfigsCreateOrUpdateSample.ts][containerappsauthconfigscreateorupdatesample] | Create or update the AuthConfig for a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_CreateOrUpdate.json | -| [containerAppsAuthConfigsDeleteSample.ts][containerappsauthconfigsdeletesample] | Delete a Container App AuthConfig. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Delete.json | -| [containerAppsAuthConfigsGetSample.ts][containerappsauthconfigsgetsample] | Get a AuthConfig of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Get.json | -| [containerAppsAuthConfigsListByContainerAppSample.ts][containerappsauthconfigslistbycontainerappsample] | Get the Container App AuthConfigs in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_ListByContainer.json | -| [containerAppsCreateOrUpdateSample.ts][containerappscreateorupdatesample] | Create or update a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CreateOrUpdate.json | -| [containerAppsDeleteSample.ts][containerappsdeletesample] | Delete a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Delete.json | -| [containerAppsGetSample.ts][containerappsgetsample] | Get the properties of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Get.json | -| [containerAppsListByResourceGroupSample.ts][containerappslistbyresourcegroupsample] | Get the Container Apps in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListByResourceGroup.json | -| [containerAppsListBySubscriptionSample.ts][containerappslistbysubscriptionsample] | Get the Container Apps in a given subscription. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListBySubscription.json | -| [containerAppsListCustomHostNameAnalysisSample.ts][containerappslistcustomhostnameanalysissample] | Analyzes a custom hostname for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json | -| [containerAppsListSecretsSample.ts][containerappslistsecretssample] | List secrets for a container app x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListSecrets.json | -| [containerAppsRevisionReplicasGetReplicaSample.ts][containerappsrevisionreplicasgetreplicasample] | Get a replica for a Container App Revision. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_Get.json | -| [containerAppsRevisionReplicasListReplicasSample.ts][containerappsrevisionreplicaslistreplicassample] | List replicas for a Container App Revision. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_List.json | -| [containerAppsRevisionsActivateRevisionSample.ts][containerappsrevisionsactivaterevisionsample] | Activates a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Activate.json | -| [containerAppsRevisionsDeactivateRevisionSample.ts][containerappsrevisionsdeactivaterevisionsample] | Deactivates a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Deactivate.json | -| [containerAppsRevisionsGetRevisionSample.ts][containerappsrevisionsgetrevisionsample] | Get a revision of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Get.json | -| [containerAppsRevisionsListRevisionsSample.ts][containerappsrevisionslistrevisionssample] | Get the Revisions for a given Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_List.json | -| [containerAppsRevisionsRestartRevisionSample.ts][containerappsrevisionsrestartrevisionsample] | Restarts a revision for a Container App x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Restart.json | -| [containerAppsSourceControlsCreateOrUpdateSample.ts][containerappssourcecontrolscreateorupdatesample] | Create or update the SourceControl for a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_CreateOrUpdate.json | -| [containerAppsSourceControlsDeleteSample.ts][containerappssourcecontrolsdeletesample] | Delete a Container App SourceControl. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Delete.json | -| [containerAppsSourceControlsGetSample.ts][containerappssourcecontrolsgetsample] | Get a SourceControl of a Container App. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Get.json | -| [containerAppsSourceControlsListByContainerAppSample.ts][containerappssourcecontrolslistbycontainerappsample] | Get the Container App SourceControls in a given resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_ListByContainer.json | -| [containerAppsUpdateSample.ts][containerappsupdatesample] | Patches a Container App using JSON Merge Patch x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Patch.json | -| [daprComponentsCreateOrUpdateSample.ts][daprcomponentscreateorupdatesample] | Creates or updates a Dapr Component in a Managed Environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_CreateOrUpdate.json | -| [daprComponentsDeleteSample.ts][daprcomponentsdeletesample] | Delete a Dapr Component from a Managed Environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Delete.json | -| [daprComponentsGetSample.ts][daprcomponentsgetsample] | Get a dapr component. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Get.json | -| [daprComponentsListSample.ts][daprcomponentslistsample] | Get the Dapr Components for a managed environment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_List.json | -| [daprComponentsListSecretsSample.ts][daprcomponentslistsecretssample] | List secrets for a dapr component x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json | -| [managedEnvironmentsCreateOrUpdateSample.ts][managedenvironmentscreateorupdatesample] | Creates or updates a Managed Environment used to host container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_CreateOrUpdate.json | -| [managedEnvironmentsDeleteSample.ts][managedenvironmentsdeletesample] | Delete a Managed Environment if it does not have any container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Delete.json | -| [managedEnvironmentsGetSample.ts][managedenvironmentsgetsample] | Get the properties of a Managed Environment used to host container apps. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Get.json | -| [managedEnvironmentsListByResourceGroupSample.ts][managedenvironmentslistbyresourcegroupsample] | Get all the Managed Environments in a resource group. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListByResourceGroup.json | -| [managedEnvironmentsListBySubscriptionSample.ts][managedenvironmentslistbysubscriptionsample] | Get all Managed Environments for a subscription. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListBySubscription.json | -| [managedEnvironmentsStoragesCreateOrUpdateSample.ts][managedenvironmentsstoragescreateorupdatesample] | Create or update storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json | -| [managedEnvironmentsStoragesDeleteSample.ts][managedenvironmentsstoragesdeletesample] | Delete storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Delete.json | -| [managedEnvironmentsStoragesGetSample.ts][managedenvironmentsstoragesgetsample] | Get storage for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Get.json | -| [managedEnvironmentsStoragesListSample.ts][managedenvironmentsstorageslistsample] | Get all storages for a managedEnvironment. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_List.json | -| [managedEnvironmentsUpdateSample.ts][managedenvironmentsupdatesample] | Patches a Managed Environment using JSON Merge Patch x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Patch.json | -| [namespacesCheckNameAvailabilitySample.ts][namespaceschecknameavailabilitysample] | Checks if resource name is available. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available RP operations. x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Operations_List.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] 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][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. 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. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/certificatesCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/certificatesCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesCreateOrUpdateSample.ts -[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesDeleteSample.ts -[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesGetSample.ts -[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesListSample.ts -[certificatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesUpdateSample.ts -[containerappsauthconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsCreateOrUpdateSample.ts -[containerappsauthconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsDeleteSample.ts -[containerappsauthconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsGetSample.ts -[containerappsauthconfigslistbycontainerappsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsListByContainerAppSample.ts -[containerappscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsCreateOrUpdateSample.ts -[containerappsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsDeleteSample.ts -[containerappsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsGetSample.ts -[containerappslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListByResourceGroupSample.ts -[containerappslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListBySubscriptionSample.ts -[containerappslistcustomhostnameanalysissample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListCustomHostNameAnalysisSample.ts -[containerappslistsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListSecretsSample.ts -[containerappsrevisionreplicasgetreplicasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasGetReplicaSample.ts -[containerappsrevisionreplicaslistreplicassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasListReplicasSample.ts -[containerappsrevisionsactivaterevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsActivateRevisionSample.ts -[containerappsrevisionsdeactivaterevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsDeactivateRevisionSample.ts -[containerappsrevisionsgetrevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsGetRevisionSample.ts -[containerappsrevisionslistrevisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsListRevisionsSample.ts -[containerappsrevisionsrestartrevisionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsRestartRevisionSample.ts -[containerappssourcecontrolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsCreateOrUpdateSample.ts -[containerappssourcecontrolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsDeleteSample.ts -[containerappssourcecontrolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsGetSample.ts -[containerappssourcecontrolslistbycontainerappsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsListByContainerAppSample.ts -[containerappsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsUpdateSample.ts -[daprcomponentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsCreateOrUpdateSample.ts -[daprcomponentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsDeleteSample.ts -[daprcomponentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsGetSample.ts -[daprcomponentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSample.ts -[daprcomponentslistsecretssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSecretsSample.ts -[managedenvironmentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsCreateOrUpdateSample.ts -[managedenvironmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsDeleteSample.ts -[managedenvironmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsGetSample.ts -[managedenvironmentslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListByResourceGroupSample.ts -[managedenvironmentslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListBySubscriptionSample.ts -[managedenvironmentsstoragescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesCreateOrUpdateSample.ts -[managedenvironmentsstoragesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesDeleteSample.ts -[managedenvironmentsstoragesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesGetSample.ts -[managedenvironmentsstorageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesListSample.ts -[managedenvironmentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsUpdateSample.ts -[namespaceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/namespacesCheckNameAvailabilitySample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/operationsListSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/package.json b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/package.json deleted file mode 100644 index 386b9ee0f8b9..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-appcontainers-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=12.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/appcontainers/arm-appcontainers" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers", - "dependencies": { - "@azure/arm-appcontainers": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^12.0.0", - "typescript": "~4.4.0", - "rimraf": "latest" - } -} diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/sample.env b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesCreateOrUpdateSample.ts deleted file mode 100644 index 0e5d91f4230e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Certificate, - CertificatesCreateOrUpdateOptionalParams, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or Update a Certificate. - * - * @summary Create or Update a Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_CreateOrUpdate.json - */ -async function createOrUpdateCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope: Certificate = { - location: "East US", - properties: { - password: "private key password" - } - }; - const options: CertificatesCreateOrUpdateOptionalParams = { - certificateEnvelope - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.createOrUpdate( - resourceGroupName, - environmentName, - certificateName, - options - ); - console.log(result); -} - -createOrUpdateCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesDeleteSample.ts deleted file mode 100644 index 26138b00ab38..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes the specified Certificate. - * - * @summary Deletes the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Delete.json - */ -async function deleteCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.delete( - resourceGroupName, - environmentName, - certificateName - ); - console.log(result); -} - -deleteCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesGetSample.ts deleted file mode 100644 index 6a6cf8cd5d67..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the specified Certificate. - * - * @summary Get the specified Certificate. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificate_Get.json - */ -async function getCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.get( - resourceGroupName, - environmentName, - certificateName - ); - console.log(result); -} - -getCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesListSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesListSample.ts deleted file mode 100644 index c1df14a0467a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Certificates in a given managed environment. - * - * @summary Get the Certificates in a given managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_ListByManagedEnvironment.json - */ -async function listCertificatesByManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.list( - resourceGroupName, - environmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listCertificatesByManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesUpdateSample.ts deleted file mode 100644 index 8ee68aee5eac..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/certificatesUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CertificatePatch, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a certificate. Currently only patching of tags is supported - * - * @summary Patches a certificate. Currently only patching of tags is supported - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_Patch.json - */ -async function patchCertificate() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const certificateName = "certificate-firendly-name"; - const certificateEnvelope: CertificatePatch = { - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.certificates.update( - resourceGroupName, - environmentName, - certificateName, - certificateEnvelope - ); - console.log(result); -} - -patchCertificate().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsCreateOrUpdateSample.ts deleted file mode 100644 index eed4db83c8bb..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthConfig, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update the AuthConfig for a Container App. - * - * @summary Create or update the AuthConfig for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const authConfigEnvelope: AuthConfig = { - globalValidation: { unauthenticatedClientAction: "AllowAnonymous" }, - identityProviders: { - facebook: { - registration: { appId: "123", appSecretSettingName: "facebook-secret" } - } - }, - platform: { enabled: true } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.createOrUpdate( - resourceGroupName, - containerAppName, - authConfigName, - authConfigEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsDeleteSample.ts deleted file mode 100644 index b8a418fb8848..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App AuthConfig. - * - * @summary Delete a Container App AuthConfig. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Delete.json - */ -async function deleteContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.delete( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -deleteContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsGetSample.ts deleted file mode 100644 index 5dadb882a757..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a AuthConfig of a Container App. - * - * @summary Get a AuthConfig of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_Get.json - */ -async function getContainerAppAuthConfig() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const authConfigName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsAuthConfigs.get( - resourceGroupName, - containerAppName, - authConfigName - ); - console.log(result); -} - -getContainerAppAuthConfig().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsListByContainerAppSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsListByContainerAppSample.ts deleted file mode 100644 index 8f01b3631bc0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsAuthConfigsListByContainerAppSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container App AuthConfigs in a given resource group. - * - * @summary Get the Container App AuthConfigs in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/AuthConfigs_ListByContainer.json - */ -async function listAuthConfigsByContainerApps() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsAuthConfigs.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAuthConfigsByContainerApps().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsCreateOrUpdateSample.ts deleted file mode 100644 index 7865bd9656af..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsCreateOrUpdateSample.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerApp, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update a Container App. - * - * @summary Create or update a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CreateOrUpdate.json - */ -async function createOrUpdateContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope: ContainerApp = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" - } - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100 - } - ] - } - }, - location: "East US", - managedEnvironmentId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080 - }, - initialDelaySeconds: 3, - periodSeconds: 3 - } - ] - } - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } } - } - ] - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -createOrUpdateContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsDeleteSample.ts deleted file mode 100644 index 4babaab2596f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App. - * - * @summary Delete a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Delete.json - */ -async function deleteContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testWorkerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginDeleteAndWait( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -deleteContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsGetSample.ts deleted file mode 100644 index c12b9b8ea3af..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the properties of a Container App. - * - * @summary Get the properties of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Get.json - */ -async function getContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.get( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -getContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListByResourceGroupSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListByResourceGroupSample.ts deleted file mode 100644 index 5b4f07a34b8e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container Apps in a given resource group. - * - * @summary Get the Container Apps in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListByResourceGroup.json - */ -async function listContainerAppsByResourceGroup() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListBySubscriptionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListBySubscriptionSample.ts deleted file mode 100644 index 083de99fa8f7..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container Apps in a given subscription. - * - * @summary Get the Container Apps in a given subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListBySubscription.json - */ -async function listContainerAppsBySubscription() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerApps.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListCustomHostNameAnalysisSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListCustomHostNameAnalysisSample.ts deleted file mode 100644 index 0eaf4a1b2ca4..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListCustomHostNameAnalysisSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ContainerAppsListCustomHostNameAnalysisOptionalParams, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Analyzes a custom hostname for a Container App - * - * @summary Analyzes a custom hostname for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json - */ -async function analyzeCustomHostname() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const customHostname = "my.name.corp"; - const options: ContainerAppsListCustomHostNameAnalysisOptionalParams = { - customHostname - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listCustomHostNameAnalysis( - resourceGroupName, - containerAppName, - options - ); - console.log(result); -} - -analyzeCustomHostname().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListSecretsSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListSecretsSample.ts deleted file mode 100644 index 5099327d3e1a..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsListSecretsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List secrets for a container app - * - * @summary List secrets for a container app - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.listSecrets( - resourceGroupName, - containerAppName - ); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasGetReplicaSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasGetReplicaSample.ts deleted file mode 100644 index 6581e7ce8f54..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasGetReplicaSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a replica for a Container App Revision. - * - * @summary Get a replica for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_Get.json - */ -async function getContainerAppRevisionReplica() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const replicaName = "myapp--0wlqy09-5d9774cff-5wnd8"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.getReplica( - resourceGroupName, - containerAppName, - revisionName, - replicaName - ); - console.log(result); -} - -getContainerAppRevisionReplica().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasListReplicasSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasListReplicasSample.ts deleted file mode 100644 index 2ad7914f417e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionReplicasListReplicasSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List replicas for a Container App Revision. - * - * @summary List replicas for a Container App Revision. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Replicas_List.json - */ -async function listContainerAppReplicas() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "myapp"; - const revisionName = "myapp--0wlqy09"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisionReplicas.listReplicas( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -listContainerAppReplicas().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsActivateRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsActivateRevisionSample.ts deleted file mode 100644 index f479ab618d9c..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsActivateRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Activates a revision for a Container App - * - * @summary Activates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Activate.json - */ -async function activateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.activateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -activateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsDeactivateRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsDeactivateRevisionSample.ts deleted file mode 100644 index 7e4de8a401df..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsDeactivateRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deactivates a revision for a Container App - * - * @summary Deactivates a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Deactivate.json - */ -async function deactivateContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.deactivateRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -deactivateContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsGetRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsGetRevisionSample.ts deleted file mode 100644 index 8602f6543c76..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsGetRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a revision of a Container App. - * - * @summary Get a revision of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Get.json - */ -async function getContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.getRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -getContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsListRevisionsSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsListRevisionsSample.ts deleted file mode 100644 index 98dc8a984250..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsListRevisionsSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Revisions for a given Container App. - * - * @summary Get the Revisions for a given Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_List.json - */ -async function listContainerAppRevisions() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsRevisions.listRevisions( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listContainerAppRevisions().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsRestartRevisionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsRestartRevisionSample.ts deleted file mode 100644 index ca5b9c238052..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsRevisionsRestartRevisionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Restarts a revision for a Container App - * - * @summary Restarts a revision for a Container App - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Revisions_Restart.json - */ -async function restartContainerAppRevision() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testStaticSite0"; - const revisionName = "testcontainerApp0-pjxhsye"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsRevisions.restartRevision( - resourceGroupName, - containerAppName, - revisionName - ); - console.log(result); -} - -restartContainerAppRevision().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsCreateOrUpdateSample.ts deleted file mode 100644 index 7ad01837feda..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsCreateOrUpdateSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SourceControl, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update the SourceControl for a Container App. - * - * @summary Create or update the SourceControl for a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_CreateOrUpdate.json - */ -async function createOrUpdateContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const sourceControlEnvelope: SourceControl = { - branch: "master", - githubActionConfiguration: { - azureCredentials: { - clientId: "", - clientSecret: "", - tenantId: "" - }, - contextPath: "./", - image: "image/tag", - registryInfo: { - registryPassword: "", - registryUrl: "xwang971reg.azurecr.io", - registryUserName: "xwang971reg" - } - }, - repoUrl: "https://github.com/xwang971/ghatest" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginCreateOrUpdateAndWait( - resourceGroupName, - containerAppName, - sourceControlName, - sourceControlEnvelope - ); - console.log(result); -} - -createOrUpdateContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsDeleteSample.ts deleted file mode 100644 index d87e139105be..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Container App SourceControl. - * - * @summary Delete a Container App SourceControl. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Delete.json - */ -async function deleteContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.beginDeleteAndWait( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -deleteContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsGetSample.ts deleted file mode 100644 index 2ad344455f98..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a SourceControl of a Container App. - * - * @summary Get a SourceControl of a Container App. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_Get.json - */ -async function getContainerAppSourceControl() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const sourceControlName = "current"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerAppsSourceControls.get( - resourceGroupName, - containerAppName, - sourceControlName - ); - console.log(result); -} - -getContainerAppSourceControl().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsListByContainerAppSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsListByContainerAppSample.ts deleted file mode 100644 index 4bde4d923044..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsSourceControlsListByContainerAppSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Container App SourceControls in a given resource group. - * - * @summary Get the Container App SourceControls in a given resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/SourceControls_ListByContainer.json - */ -async function listAppSourceControls() { - const subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; - const resourceGroupName = "workerapps-rg-xj"; - const containerAppName = "testcanadacentral"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.containerAppsSourceControls.listByContainerApp( - resourceGroupName, - containerAppName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAppSourceControls().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsUpdateSample.ts deleted file mode 100644 index 9a82da9e801f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/containerAppsUpdateSample.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerApp, ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a Container App using JSON Merge Patch - * - * @summary Patches a Container App using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_Patch.json - */ -async function patchContainerApp() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "rg"; - const containerAppName = "testcontainerApp0"; - const containerAppEnvelope: ContainerApp = { - configuration: { - dapr: { appPort: 3000, appProtocol: "http", enabled: true }, - ingress: { - customDomains: [ - { - name: "www.my-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" - }, - { - name: "www.my-other-name.com", - bindingType: "SniEnabled", - certificateId: - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" - } - ], - external: true, - targetPort: 3000, - traffic: [ - { - label: "production", - revisionName: "testcontainerApp0-ab1234", - weight: 100 - } - ] - } - }, - location: "East US", - tags: { tag1: "value1", tag2: "value2" }, - template: { - containers: [ - { - name: "testcontainerApp0", - image: "repo/testcontainerApp0:v1", - probes: [ - { - type: "Liveness", - httpGet: { - path: "/health", - httpHeaders: [{ name: "Custom-Header", value: "Awesome" }], - port: 8080 - }, - initialDelaySeconds: 3, - periodSeconds: 3 - } - ] - } - ], - scale: { - maxReplicas: 5, - minReplicas: 1, - rules: [ - { - name: "httpscalingrule", - custom: { type: "http", metadata: { concurrentRequests: "50" } } - } - ] - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.containerApps.beginUpdateAndWait( - resourceGroupName, - containerAppName, - containerAppEnvelope - ); - console.log(result); -} - -patchContainerApp().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsCreateOrUpdateSample.ts deleted file mode 100644 index 497bb397cad4..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DaprComponent, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a Dapr Component in a Managed Environment. - * - * @summary Creates or updates a Dapr Component in a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_CreateOrUpdate.json - */ -async function createOrUpdateDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const daprComponentEnvelope: DaprComponent = { - componentType: "state.azure.cosmosdb", - ignoreErrors: false, - initTimeout: "50s", - metadata: [ - { name: "url", value: "" }, - { name: "database", value: "itemsDB" }, - { name: "collection", value: "items" }, - { name: "masterkey", secretRef: "masterkey" } - ], - scopes: ["container-app-1", "container-app-2"], - secrets: [{ name: "masterkey", value: "keyvalue" }], - version: "v1" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.createOrUpdate( - resourceGroupName, - environmentName, - componentName, - daprComponentEnvelope - ); - console.log(result); -} - -createOrUpdateDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsDeleteSample.ts deleted file mode 100644 index e95941713bc2..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Dapr Component from a Managed Environment. - * - * @summary Delete a Dapr Component from a Managed Environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Delete.json - */ -async function deleteDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.delete( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -deleteDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsGetSample.ts deleted file mode 100644 index 5f011d873aa5..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a dapr component. - * - * @summary Get a dapr component. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_Get.json - */ -async function getDaprComponent() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.get( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -getDaprComponent().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSample.ts deleted file mode 100644 index 505eb2ace62b..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the Dapr Components for a managed environment. - * - * @summary Get the Dapr Components for a managed environment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_List.json - */ -async function listDaprComponents() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.daprComponents.list( - resourceGroupName, - environmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDaprComponents().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSecretsSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSecretsSample.ts deleted file mode 100644 index 534895b9acca..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/daprComponentsListSecretsSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List secrets for a dapr component - * - * @summary List secrets for a dapr component - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json - */ -async function listContainerAppsSecrets() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "myenvironment"; - const componentName = "reddog"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.daprComponents.listSecrets( - resourceGroupName, - environmentName, - componentName - ); - console.log(result); -} - -listContainerAppsSecrets().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsCreateOrUpdateSample.ts deleted file mode 100644 index 6aea6e454ea0..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironment, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a Managed Environment used to host container apps. - * - * @summary Creates or updates a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_CreateOrUpdate.json - */ -async function createEnvironments() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope: ManagedEnvironment = { - appLogsConfiguration: { - logAnalyticsConfiguration: { customerId: "string", sharedKey: "string" } - }, - daprAIConnectionString: - "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", - location: "East US", - zoneRedundant: true - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginCreateOrUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -createEnvironments().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsDeleteSample.ts deleted file mode 100644 index b7359c4b8228..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete a Managed Environment if it does not have any container apps. - * - * @summary Delete a Managed Environment if it does not have any container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Delete.json - */ -async function deleteEnvironmentByName() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "examplekenv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginDeleteAndWait( - resourceGroupName, - environmentName - ); - console.log(result); -} - -deleteEnvironmentByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsGetSample.ts deleted file mode 100644 index 025177e41a75..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the properties of a Managed Environment used to host container apps. - * - * @summary Get the properties of a Managed Environment used to host container apps. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Get.json - */ -async function getEnvironmentsByName() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.get( - resourceGroupName, - environmentName - ); - console.log(result); -} - -getEnvironmentsByName().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListByResourceGroupSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListByResourceGroupSample.ts deleted file mode 100644 index 7fbbf3dde8b1..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all the Managed Environments in a resource group. - * - * @summary Get all the Managed Environments in a resource group. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListByResourceGroup.json - */ -async function listEnvironmentsByResourceGroup() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsByResourceGroup().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListBySubscriptionSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListBySubscriptionSample.ts deleted file mode 100644 index 5f2338939282..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all Managed Environments for a subscription. - * - * @summary Get all Managed Environments for a subscription. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_ListBySubscription.json - */ -async function listEnvironmentsBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.managedEnvironments.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listEnvironmentsBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesCreateOrUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesCreateOrUpdateSample.ts deleted file mode 100644 index 9134c71e5932..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironmentStorage, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or update storage for a managedEnvironment. - * - * @summary Create or update storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json - */ -async function createOrUpdateEnvironmentsStorage() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const storageEnvelope: ManagedEnvironmentStorage = { - properties: { - azureFile: { - accessMode: "ReadOnly", - accountKey: "key", - accountName: "account1", - shareName: "share1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.createOrUpdate( - resourceGroupName, - environmentName, - storageName, - storageEnvelope - ); - console.log(result); -} - -createOrUpdateEnvironmentsStorage().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesDeleteSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesDeleteSample.ts deleted file mode 100644 index aacb37ea0832..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete storage for a managedEnvironment. - * - * @summary Delete storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Delete.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.delete( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesGetSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesGetSample.ts deleted file mode 100644 index 204faff5dc5e..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get storage for a managedEnvironment. - * - * @summary Get storage for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_Get.json - */ -async function getAEnvironmentsStoragePropertiesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const storageName = "jlaw-demo1"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.get( - resourceGroupName, - environmentName, - storageName - ); - console.log(result); -} - -getAEnvironmentsStoragePropertiesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesListSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesListSample.ts deleted file mode 100644 index 6f4742373ae6..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsStoragesListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get all storages for a managedEnvironment. - * - * @summary Get all storages for a managedEnvironment. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironmentsStorages_List.json - */ -async function listEnvironmentsStoragesBySubscription() { - const subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; - const resourceGroupName = "examplerg"; - const environmentName = "managedEnv"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironmentsStorages.list( - resourceGroupName, - environmentName - ); - console.log(result); -} - -listEnvironmentsStoragesBySubscription().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsUpdateSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsUpdateSample.ts deleted file mode 100644 index 9213af785b0d..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/managedEnvironmentsUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ManagedEnvironment, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Patches a Managed Environment using JSON Merge Patch - * - * @summary Patches a Managed Environment using JSON Merge Patch - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ManagedEnvironments_Patch.json - */ -async function patchManagedEnvironment() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const environmentEnvelope: ManagedEnvironment = { - location: "East US", - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.managedEnvironments.beginUpdateAndWait( - resourceGroupName, - environmentName, - environmentEnvelope - ); - console.log(result); -} - -patchManagedEnvironment().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/namespacesCheckNameAvailabilitySample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/namespacesCheckNameAvailabilitySample.ts deleted file mode 100644 index bd9a06d62f5f..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/namespacesCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - ContainerAppsAPIClient -} from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json - */ -async function certificatesCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "testcertificatename", - type: "Microsoft.App/managedEnvironments/certificates" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -certificatesCheckNameAvailability().catch(console.error); - -/** - * This sample demonstrates how to Checks if resource name is available. - * - * @summary Checks if resource name is available. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json - */ -async function containerAppsCheckNameAvailability() { - const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; - const resourceGroupName = "examplerg"; - const environmentName = "testcontainerenv"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "testcappname", - type: "Microsoft.App/containerApps" - }; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const result = await client.namespaces.checkNameAvailability( - resourceGroupName, - environmentName, - checkNameAvailabilityRequest - ); - console.log(result); -} - -containerAppsCheckNameAvailability().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/operationsListSample.ts b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 550f15fed140..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ContainerAppsAPIClient } from "@azure/arm-appcontainers"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all of the available RP operations. - * - * @summary Lists all of the available RP operations. - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Operations_List.json - */ -async function listAllOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ContainerAppsAPIClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -listAllOperations().catch(console.error); diff --git a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/tsconfig.json b/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 416c2dd82e00..000000000000 --- a/sdk/appcontainers/arm-appcontainers/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/appcontainers/arm-appcontainers/src/containerAppsAPIClient.ts b/sdk/appcontainers/arm-appcontainers/src/containerAppsAPIClient.ts index 6c91c17ede50..429cbb2b1a23 100644 --- a/sdk/appcontainers/arm-appcontainers/src/containerAppsAPIClient.ts +++ b/sdk/appcontainers/arm-appcontainers/src/containerAppsAPIClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ContainerAppsAuthConfigsImpl, @@ -69,7 +74,7 @@ export class ContainerAppsAPIClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-appcontainers/1.0.0`; + const packageDetails = `azsdk-js-arm-appcontainers/1.0.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -134,6 +139,35 @@ export class ContainerAppsAPIClient extends coreClient.ServiceClient { this.containerAppsSourceControls = new ContainerAppsSourceControlsImpl( this ); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } containerAppsAuthConfigs: ContainerAppsAuthConfigs; diff --git a/sdk/appcontainers/arm-appcontainers/src/models/index.ts b/sdk/appcontainers/arm-appcontainers/src/models/index.ts index 6463ddecf112..d3c549977fd5 100644 --- a/sdk/appcontainers/arm-appcontainers/src/models/index.ts +++ b/sdk/appcontainers/arm-appcontainers/src/models/index.ts @@ -945,7 +945,7 @@ export interface ManagedEnvironmentsCollection { /** Configuration properties for apps environment to join a Virtual Network */ export interface VnetConfiguration { - /** Boolean indicating the environment only has an internal load balancer. These environments do not have a public static IP resource, must provide ControlPlaneSubnetResourceId and AppSubnetResourceId if enabling this property */ + /** Boolean indicating the environment only has an internal load balancer. These environments do not have a public static IP resource. They must provide runtimeSubnetId and infrastructureSubnetId if enabling this property */ internal?: boolean; /** Resource ID of a subnet for infrastructure components. This subnet must be in the same VNET as the subnet defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. */ infrastructureSubnetId?: string; diff --git a/sdk/appcontainers/arm-appcontainers/test/sampleTest.ts b/sdk/appcontainers/arm-appcontainers/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/appcontainers/arm-appcontainers/test/sampleTest.ts +++ b/sdk/appcontainers/arm-appcontainers/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/appcontainers/arm-appcontainers/tsconfig.json b/sdk/appcontainers/arm-appcontainers/tsconfig.json index 00a8ff1127f8..3e6ae96443f3 100644 --- a/sdk/appcontainers/arm-appcontainers/tsconfig.json +++ b/sdk/appcontainers/arm-appcontainers/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-appcontainers": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"