[mgmt] appcontainers release (#30407)
https://github.com/Azure/sdk-release-request/issues/5297
This commit is contained in:
Родитель
f47f29548f
Коммит
d6bab1b74c
|
@ -12930,7 +12930,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-appcontainers.tgz:
|
||||
resolution: {integrity: sha512-3Q4wfbFv9/4XfRc1gSJTgCS629OwC++B3POXbJTMb+HNaUGWAKI7aXa89BtmFBJUIlkP6mKRxypywA5KqI8NOg==, tarball: file:projects/arm-appcontainers.tgz}
|
||||
resolution: {integrity: sha512-OLDQ9cIJXarZUMBqrsu4Yxni7ctTNO+xJHgapzZ42fI1r0sX+6GCHxn2KeTeLImDs2i+unsZMtiPGybNhlFnUw==, tarball: file:projects/arm-appcontainers.tgz}
|
||||
name: '@rush-temp/arm-appcontainers'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -12949,9 +12949,10 @@ packages:
|
|||
mkdirp: 3.0.1
|
||||
mocha: 10.7.0
|
||||
rimraf: 5.0.10
|
||||
ts-node: 10.9.2(@types/node@18.19.43)(typescript@5.5.4)
|
||||
ts-node: 10.9.2(@types/node@18.19.43)(typescript@5.4.5)
|
||||
tslib: 2.6.3
|
||||
typescript: 5.5.4
|
||||
tsx: 4.16.5
|
||||
typescript: 5.4.5
|
||||
uglify-js: 3.19.1
|
||||
transitivePeerDependencies:
|
||||
- '@swc/core'
|
||||
|
|
|
@ -1,18 +1,51 @@
|
|||
# Release History
|
||||
|
||||
## 2.1.0-beta.2 (Unreleased)
|
||||
|
||||
|
||||
## 2.1.0 (2024-07-15)
|
||||
|
||||
### Features Added
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Added operation group ManagedEnvironmentUsages
|
||||
- Added operation group Usages
|
||||
- Added operation Jobs.getDetector
|
||||
- Added operation Jobs.listDetectors
|
||||
- Added operation Jobs.proxyGet
|
||||
- Added Interface BlobStorageTokenStore
|
||||
- Added Interface EncryptionSettings
|
||||
- Added Interface GetCustomDomainVerificationIdOptionalParams
|
||||
- Added Interface IngressPortMapping
|
||||
- Added Interface JobsGetDetectorOptionalParams
|
||||
- Added Interface JobsListDetectorsNextOptionalParams
|
||||
- Added Interface JobsListDetectorsOptionalParams
|
||||
- Added Interface JobsProxyGetOptionalParams
|
||||
- Added Interface ListUsagesResult
|
||||
- Added Interface ManagedEnvironmentPropertiesPeerTrafficConfiguration
|
||||
- Added Interface ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption
|
||||
- Added Interface ManagedEnvironmentUsagesListNextOptionalParams
|
||||
- Added Interface ManagedEnvironmentUsagesListOptionalParams
|
||||
- Added Interface TokenStore
|
||||
- Added Interface Usage
|
||||
- Added Interface UsageName
|
||||
- Added Interface UsagesListNextOptionalParams
|
||||
- Added Interface UsagesListOptionalParams
|
||||
- Added Type Alias GetCustomDomainVerificationIdResponse
|
||||
- Added Type Alias JobsGetDetectorResponse
|
||||
- Added Type Alias JobsListDetectorsNextResponse
|
||||
- Added Type Alias JobsListDetectorsResponse
|
||||
- Added Type Alias JobsProxyGetResponse
|
||||
- Added Type Alias ManagedEnvironmentUsagesListNextResponse
|
||||
- Added Type Alias ManagedEnvironmentUsagesListResponse
|
||||
- Added Type Alias UsagesListNextResponse
|
||||
- Added Type Alias UsagesListResponse
|
||||
- Interface AuthConfig has a new optional parameter encryptionSettings
|
||||
- Interface AvailableWorkloadProfileProperties has a new optional parameter gpus
|
||||
- Interface Ingress has a new optional parameter additionalPortMappings
|
||||
- Interface Login has a new optional parameter tokenStore
|
||||
- Interface ManagedEnvironment has a new optional parameter peerTrafficConfiguration
|
||||
|
||||
|
||||
## 2.1.0-beta.1 (2024-03-18)
|
||||
|
||||
**Features**
|
||||
### Features Added
|
||||
|
||||
- Added operation group AppResiliencyOperations
|
||||
- Added operation group BuildAuthToken
|
||||
|
@ -236,7 +269,7 @@
|
|||
|
||||
## 2.0.0 (2023-08-08)
|
||||
|
||||
**Features**
|
||||
### Features Added
|
||||
|
||||
- Added operation group AvailableWorkloadProfiles
|
||||
- Added operation group BillingMeters
|
||||
|
@ -548,7 +581,7 @@
|
|||
- Added function getContinuationToken
|
||||
- Interface ContainerAppsRevisionsListRevisionsNextOptionalParams no longer has parameter filter
|
||||
|
||||
**Breaking Changes**
|
||||
### Breaking Changes
|
||||
|
||||
- Interface VnetConfiguration no longer has parameter runtimeSubnetId
|
||||
- Type of parameter customDomainVerificationFailureInfo of interface CustomHostnameAnalysisResult is changed from DefaultErrorResponse to CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo
|
||||
|
@ -556,19 +589,19 @@
|
|||
|
||||
## 1.1.2 (2022-10-08)
|
||||
|
||||
**Bugs Fixed**
|
||||
### Bugs Fixed
|
||||
|
||||
- revert credential scopes
|
||||
|
||||
## 1.1.1 (2022-09-30)
|
||||
|
||||
**Bugs Fixed**
|
||||
### Bugs Fixed
|
||||
|
||||
- fix better user experience of credential scopes in government cloud
|
||||
|
||||
## 1.1.0 (2022-08-02)
|
||||
|
||||
**Features**
|
||||
### Features Added
|
||||
|
||||
- Added Interface AuthConfig
|
||||
- Added Interface Certificate
|
||||
|
@ -585,4 +618,4 @@
|
|||
|
||||
## 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).
|
||||
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/azsdk/js/mgmt/quickstart).
|
||||
|
|
|
@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
|
|||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcontainers/arm-appcontainers) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appcontainers) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers?view=azure-node-preview) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"commit": "0cca8953ec713d8cc0e940c37e865d36b43d18f8",
|
||||
"commit": "1aa912658531534e4e57ea613591075f7b97897c",
|
||||
"readme": "specification/app/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\app\\resource-manager\\readme.md --use=@autorest/typescript@6.0.17 --generate-sample=true",
|
||||
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\app\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.4",
|
||||
"use": "@autorest/typescript@6.0.17"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.11",
|
||||
"use": "@autorest/typescript@6.0.23"
|
||||
}
|
|
@ -2,5 +2,5 @@
|
|||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "js",
|
||||
"TagPrefix": "js/appcontainers/arm-appcontainers",
|
||||
"Tag": "js/appcontainers/arm-appcontainers_deb7eea194"
|
||||
"Tag": "js/appcontainers/arm-appcontainers_9d19b5e29d"
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for ContainerAppsAPIClient.",
|
||||
"version": "2.1.0-beta.2",
|
||||
"version": "2.1.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
|
@ -30,16 +30,17 @@
|
|||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.31.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"typescript": "~5.5.3",
|
||||
"typescript": "~5.4.5",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^5.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"@azure/identity": "^4.0.1",
|
||||
"@azure-tools/test-recorder": "^3.0.0",
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"@azure-tools/test-credential": "^1.1.0",
|
||||
"mocha": "^10.0.0",
|
||||
"@types/mocha": "^10.0.0",
|
||||
"tsx": "^4.7.1",
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
|
@ -114,4 +115,4 @@
|
|||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appcontainers?view=azure-node-preview"
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,79 +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 {
|
||||
AppResiliency,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update container app resiliency policy.
|
||||
*
|
||||
* @summary Create or update container app resiliency policy.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateAppResiliency() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const appName = "testcontainerApp0";
|
||||
const name = "resiliency-policy-1";
|
||||
const resiliencyEnvelope: AppResiliency = {
|
||||
circuitBreakerPolicy: {
|
||||
consecutiveErrors: 5,
|
||||
intervalInSeconds: 10,
|
||||
maxEjectionPercent: 50,
|
||||
},
|
||||
httpConnectionPool: {
|
||||
http1MaxPendingRequests: 1024,
|
||||
http2MaxRequests: 1024,
|
||||
},
|
||||
httpRetryPolicy: {
|
||||
errors: [
|
||||
"5xx",
|
||||
"connect-failure",
|
||||
"reset",
|
||||
"retriable-headers",
|
||||
"retriable-status-codes",
|
||||
],
|
||||
headers: [{ header: "X-Content-Type", prefixMatch: "GOATS" }],
|
||||
httpStatusCodes: [502, 503],
|
||||
initialDelayInMilliseconds: 1000,
|
||||
maxIntervalInMilliseconds: 10000,
|
||||
maxRetries: 5,
|
||||
},
|
||||
tcpConnectionPool: { maxConnections: 100 },
|
||||
tcpRetryPolicy: { maxConnectAttempts: 3 },
|
||||
timeoutPolicy: {
|
||||
connectionTimeoutInSeconds: 5,
|
||||
responseTimeoutInSeconds: 15,
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.appResiliencyOperations.createOrUpdate(
|
||||
resourceGroupName,
|
||||
appName,
|
||||
name,
|
||||
resiliencyEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateAppResiliency();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,44 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete container app resiliency policy.
|
||||
*
|
||||
* @summary Delete container app resiliency policy.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Delete.json
|
||||
*/
|
||||
async function deleteAppResiliency() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const appName = "testcontainerApp0";
|
||||
const name = "resiliency-policy-1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.appResiliencyOperations.delete(
|
||||
resourceGroupName,
|
||||
appName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteAppResiliency();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,44 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get container app resiliency policy.
|
||||
*
|
||||
* @summary Get container app resiliency policy.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Get.json
|
||||
*/
|
||||
async function getAppResiliency() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const appName = "testcontainerApp0";
|
||||
const name = "resiliency-policy-1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.appResiliencyOperations.get(
|
||||
resourceGroupName,
|
||||
appName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAppResiliency();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List container app resiliency policies.
|
||||
*
|
||||
* @summary List container app resiliency policies.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_List.json
|
||||
*/
|
||||
async function listAppResiliency() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const appName = "testcontainerApp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appResiliencyOperations.list(
|
||||
resourceGroupName,
|
||||
appName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppResiliency();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get all available workload profiles for a location.
|
||||
*
|
||||
* @summary Get all available workload profiles for a location.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AvailableWorkloadProfiles_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AvailableWorkloadProfiles_Get.json
|
||||
*/
|
||||
async function billingMetersGet() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get all billingMeters for a location.
|
||||
*
|
||||
* @summary Get all billingMeters for a location.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/BillingMeters_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/BillingMeters_Get.json
|
||||
*/
|
||||
async function billingMetersGet() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -1,44 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the token used to connect to the endpoint where source code can be uploaded for a build.
|
||||
*
|
||||
* @summary Gets the token used to connect to the endpoint where source code can be uploaded for a build.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListAuthToken.json
|
||||
*/
|
||||
async function getBuildAuthToken() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const buildName = "testBuild";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.buildAuthToken.list(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
buildName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getBuildAuthToken();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,71 +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 {
|
||||
BuilderResource,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a BuilderResource
|
||||
*
|
||||
* @summary Create or update a BuilderResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_CreateOrUpdate.json
|
||||
*/
|
||||
async function buildersCreateOrUpdate0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const builderEnvelope: BuilderResource = {
|
||||
containerRegistries: [
|
||||
{
|
||||
containerRegistryServer: "test.azurecr.io",
|
||||
identityResourceId:
|
||||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
|
||||
},
|
||||
{
|
||||
containerRegistryServer: "test2.azurecr.io",
|
||||
identityResourceId:
|
||||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
|
||||
},
|
||||
],
|
||||
environmentId:
|
||||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv",
|
||||
identity: {
|
||||
type: "SystemAssigned,UserAssigned",
|
||||
userAssignedIdentities: {
|
||||
"/subscriptions/00000000000000000000000000000000/resourceGroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1":
|
||||
{},
|
||||
},
|
||||
},
|
||||
location: "eastus",
|
||||
tags: { company: "Microsoft" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builders.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
builderEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersCreateOrUpdate0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a BuilderResource
|
||||
*
|
||||
* @summary Delete a BuilderResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Delete.json
|
||||
*/
|
||||
async function buildersDelete0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builders.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersDelete0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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.
|
||||
import { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a BuilderResource
|
||||
*
|
||||
* @summary Get a BuilderResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Get.json
|
||||
*/
|
||||
async function buildersGet0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builders.get(resourceGroupName, builderName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersGet0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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.
|
||||
import { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List BuilderResource resources by resource group
|
||||
*
|
||||
* @summary List BuilderResource resources by resource group
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListByResourceGroup.json
|
||||
*/
|
||||
async function buildersListByResourceGroup0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.builders.listByResourceGroup(
|
||||
resourceGroupName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersListByResourceGroup0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,40 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List BuilderResource resources by subscription ID
|
||||
*
|
||||
* @summary List BuilderResource resources by subscription ID
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListBySubscription.json
|
||||
*/
|
||||
async function buildersListBySubscription0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"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.builders.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersListBySubscription0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 {
|
||||
BuilderResourceUpdate,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update a BuilderResource
|
||||
*
|
||||
* @summary Update a BuilderResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Update.json
|
||||
*/
|
||||
async function buildersUpdate0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const builderEnvelope: BuilderResourceUpdate = {
|
||||
tags: { mytag1: "myvalue1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builders.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
builderEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildersUpdate0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List BuildResource resources by BuilderResource
|
||||
*
|
||||
* @summary List BuildResource resources by BuilderResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListByBuilderResource.json
|
||||
*/
|
||||
async function buildsListByBuilderResource0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.buildsByBuilderResource.list(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildsListByBuilderResource0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,109 +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 {
|
||||
BuildResource,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create a BuildResource
|
||||
*
|
||||
* @summary Create a BuildResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate_NoConfig.json
|
||||
*/
|
||||
async function buildsCreateOrUpdateNoConfig() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const buildName = "testBuild";
|
||||
const buildEnvelope: BuildResource = {};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builds.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
buildName,
|
||||
buildEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create a BuildResource
|
||||
*
|
||||
* @summary Create a BuildResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate.json
|
||||
*/
|
||||
async function buildsCreateOrUpdateWithConfig() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const buildName = "testBuild-123456789az";
|
||||
const buildEnvelope: BuildResource = {
|
||||
configuration: {
|
||||
baseOs: "DebianBullseye",
|
||||
environmentVariables: [
|
||||
{ name: "foo1", value: "bar1" },
|
||||
{ name: "foo2", value: "bar2" },
|
||||
],
|
||||
platform: "dotnetcore",
|
||||
platformVersion: "7.0",
|
||||
preBuildSteps: [
|
||||
{
|
||||
description: "First pre build step.",
|
||||
httpGet: {
|
||||
fileName: "output.txt",
|
||||
headers: ["foo", "bar"],
|
||||
url: "https://microsoft.com",
|
||||
},
|
||||
scripts: ["echo 'hello'", "echo 'world'"],
|
||||
},
|
||||
{
|
||||
description: "Second pre build step.",
|
||||
httpGet: {
|
||||
fileName: "output.txt",
|
||||
headers: ["foo"],
|
||||
url: "https://microsoft.com",
|
||||
},
|
||||
scripts: ["echo 'hello'", "echo 'again'"],
|
||||
},
|
||||
],
|
||||
},
|
||||
destinationContainerRegistry: {
|
||||
image: "test.azurecr.io/repo:tag",
|
||||
server: "test.azurecr.io",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builds.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
buildName,
|
||||
buildEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildsCreateOrUpdateNoConfig();
|
||||
buildsCreateOrUpdateWithConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,44 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a BuildResource
|
||||
*
|
||||
* @summary Delete a BuildResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Delete.json
|
||||
*/
|
||||
async function buildsDelete0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const buildName = "testBuild";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builds.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
buildName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildsDelete0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,44 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a BuildResource
|
||||
*
|
||||
* @summary Get a BuildResource
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Get.json
|
||||
*/
|
||||
async function buildsGet0() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const builderName = "testBuilder";
|
||||
const buildName = "testBuild";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.builds.get(
|
||||
resourceGroupName,
|
||||
builderName,
|
||||
buildName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
buildsGet0();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -22,7 +22,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateCertificate() {
|
||||
const subscriptionId =
|
||||
|
@ -35,7 +35,6 @@ async function createOrUpdateCertificate() {
|
|||
const certificateEnvelope: Certificate = {
|
||||
location: "East US",
|
||||
properties: {
|
||||
certificateType: "ImagePullTrustedCA",
|
||||
password: "private key password",
|
||||
value: Buffer.from("Y2VydA=="),
|
||||
},
|
||||
|
@ -54,48 +53,8 @@ async function createOrUpdateCertificate() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json
|
||||
*/
|
||||
async function createOrUpdateCertificateUsingManagedIdentity() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "testcontainerenv";
|
||||
const certificateName = "certificate-firendly-name";
|
||||
const certificateEnvelope: Certificate = {
|
||||
location: "East US",
|
||||
properties: {
|
||||
certificateKeyVaultProperties: {
|
||||
identity:
|
||||
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi",
|
||||
keyVaultUrl: "https://xxxxxxxx.vault.azure.net/certificates/certName",
|
||||
},
|
||||
certificateType: "ServerSSLCertificate",
|
||||
},
|
||||
};
|
||||
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);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateCertificate();
|
||||
createOrUpdateCertificateUsingManagedIdentity();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Deletes the specified Certificate.
|
||||
*
|
||||
* @summary Deletes the specified Certificate.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Delete.json
|
||||
*/
|
||||
async function deleteCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the specified Certificate.
|
||||
*
|
||||
* @summary Get the specified Certificate.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Get.json
|
||||
*/
|
||||
async function getCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Certificates_ListByManagedEnvironment.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_ListByManagedEnvironment.json
|
||||
*/
|
||||
async function listCertificatesByManagedEnvironment() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Certificates_Patch.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_Patch.json
|
||||
*/
|
||||
async function patchCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -22,7 +22,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Deletes the specified Certificate.
|
||||
*
|
||||
* @summary Deletes the specified Certificate.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Delete.json
|
||||
*/
|
||||
async function deleteCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the specified Certificate.
|
||||
*
|
||||
* @summary Get the specified Certificate.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Get.json
|
||||
*/
|
||||
async function getCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the Certificates in a given connected environment.
|
||||
*
|
||||
* @summary Get the Certificates in a given connected environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json
|
||||
*/
|
||||
async function listCertificatesByConnectedEnvironment() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_Patch.json
|
||||
*/
|
||||
async function patchCertificate() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Checks if resource connectedEnvironmentName is available.
|
||||
*
|
||||
* @summary Checks if resource connectedEnvironmentName is available.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json
|
||||
*/
|
||||
async function certificatesCheckNameAvailability() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Creates or updates an connectedEnvironment.
|
||||
*
|
||||
* @summary Creates or updates an connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_CreateOrUpdate.json
|
||||
*/
|
||||
async function createKubeEnvironments() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Creates or updates a Dapr Component in a connected environment.
|
||||
*
|
||||
* @summary Creates or updates a Dapr Component in a connected environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponent() {
|
||||
const subscriptionId =
|
||||
|
@ -43,14 +43,6 @@ async function createOrUpdateDaprComponent() {
|
|||
],
|
||||
scopes: ["container-app-1", "container-app-2"],
|
||||
secrets: [{ name: "masterkey", value: "keyvalue" }],
|
||||
serviceComponentBind: [
|
||||
{
|
||||
name: "statestore",
|
||||
metadata: { name: "daprcomponentBind", value: "redis-bind" },
|
||||
serviceId:
|
||||
"/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis",
|
||||
},
|
||||
],
|
||||
version: "v1",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Delete a Dapr Component from a connected environment.
|
||||
*
|
||||
* @summary Delete a Dapr Component from a connected environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json
|
||||
*/
|
||||
async function deleteDaprComponent() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get a dapr component.
|
||||
*
|
||||
* @summary Get a dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_Get.json
|
||||
*/
|
||||
async function getDaprComponent() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the Dapr Components for a connected environment.
|
||||
*
|
||||
* @summary Get the Dapr Components for a connected environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_List.json
|
||||
*/
|
||||
async function listDaprComponents() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json
|
||||
*/
|
||||
async function listContainerAppsSecrets() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Delete an connectedEnvironment.
|
||||
*
|
||||
* @summary Delete an connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Delete.json
|
||||
*/
|
||||
async function deleteConnectedEnvironmentByConnectedEnvironmentName() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the properties of an connectedEnvironment.
|
||||
*
|
||||
* @summary Get the properties of an connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Get.json
|
||||
*/
|
||||
async function getConnectedEnvironmentByConnectedEnvironmentName() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get all connectedEnvironments in a resource group.
|
||||
*
|
||||
* @summary Get all connectedEnvironments in a resource group.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_ListByResourceGroup.json
|
||||
*/
|
||||
async function listEnvironmentsByResourceGroup() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get all connectedEnvironments for a subscription.
|
||||
*
|
||||
* @summary Get all connectedEnvironments for a subscription.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListBySubscription.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_ListBySubscription.json
|
||||
*/
|
||||
async function listConnectedEnvironmentsBySubscription() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Create or update storage for a connectedEnvironment.
|
||||
*
|
||||
* @summary Create or update storage for a connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateEnvironmentsStorage() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Delete storage for a connectedEnvironment.
|
||||
*
|
||||
* @summary Delete storage for a connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Delete.json
|
||||
*/
|
||||
async function listEnvironmentsStoragesBySubscription() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get storage for a connectedEnvironment.
|
||||
*
|
||||
* @summary Get storage for a connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Get.json
|
||||
*/
|
||||
async function getAEnvironmentsStoragePropertiesBySubscription() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get all storages for a connectedEnvironment.
|
||||
*
|
||||
* @summary Get all storages for a connectedEnvironment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_List.json
|
||||
*/
|
||||
async function listEnvironmentsStoragesBySubscription() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Patches a Managed Environment. Only patching of tags is supported currently
|
||||
*
|
||||
* @summary Patches a Managed Environment. Only patching of tags is supported currently
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Patch.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Patch.json
|
||||
*/
|
||||
async function patchManagedEnvironment() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/AuthConfigs_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateContainerAppAuthConfig() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/AuthConfigs_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Delete.json
|
||||
*/
|
||||
async function deleteContainerAppAuthConfig() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/AuthConfigs_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Get.json
|
||||
*/
|
||||
async function getContainerAppAuthConfig() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/AuthConfigs_ListByContainer.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_ListByContainer.json
|
||||
*/
|
||||
async function listAuthConfigsByContainerApps() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,151 +18,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json
|
||||
*/
|
||||
async function createOrUpdateAppOnAConnectedEnvironment() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppEnvelope: ContainerApp = {
|
||||
configuration: {
|
||||
dapr: {
|
||||
appPort: 3000,
|
||||
appProtocol: "http",
|
||||
enableApiLogging: true,
|
||||
enabled: true,
|
||||
httpMaxRequestSize: 10,
|
||||
httpReadBufferSize: 30,
|
||||
logLevel: "debug",
|
||||
},
|
||||
ingress: {
|
||||
additionalPortMappings: [
|
||||
{ external: true, targetPort: 1234 },
|
||||
{ exposedPort: 3456, external: false, targetPort: 2345 },
|
||||
],
|
||||
clientCertificateMode: "accept",
|
||||
corsPolicy: {
|
||||
allowCredentials: true,
|
||||
allowedHeaders: ["HEADER1", "HEADER2"],
|
||||
allowedMethods: ["GET", "POST"],
|
||||
allowedOrigins: ["https://a.test.com", "https://b.test.com"],
|
||||
exposeHeaders: ["HEADER3", "HEADER4"],
|
||||
maxAge: 1234,
|
||||
},
|
||||
customDomains: [
|
||||
{
|
||||
name: "www.my-name.com",
|
||||
bindingType: "SniEnabled",
|
||||
certificateId:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/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/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
|
||||
},
|
||||
],
|
||||
external: true,
|
||||
ipSecurityRestrictions: [
|
||||
{
|
||||
name: "Allow work IP A subnet",
|
||||
description:
|
||||
"Allowing all IP's within the subnet below to access containerapp",
|
||||
action: "Allow",
|
||||
ipAddressRange: "192.168.1.1/32",
|
||||
},
|
||||
{
|
||||
name: "Allow work IP B subnet",
|
||||
description:
|
||||
"Allowing all IP's within the subnet below to access containerapp",
|
||||
action: "Allow",
|
||||
ipAddressRange: "192.168.1.1/8",
|
||||
},
|
||||
],
|
||||
stickySessions: { affinity: "sticky" },
|
||||
targetPort: 3000,
|
||||
traffic: [
|
||||
{
|
||||
label: "production",
|
||||
revisionName: "testcontainerApp0-ab1234",
|
||||
weight: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
maxInactiveRevisions: 10,
|
||||
},
|
||||
environmentId:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube",
|
||||
extendedLocation: {
|
||||
name: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation",
|
||||
type: "CustomLocation",
|
||||
},
|
||||
location: "East US",
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
initContainers: [
|
||||
{
|
||||
name: "testinitcontainerApp0",
|
||||
args: ["-c", "while true; do echo hello; sleep 10;done"],
|
||||
command: ["/bin/sh"],
|
||||
image: "repo/testcontainerApp0:v4",
|
||||
resources: { cpu: 0.2, memory: "100Mi" },
|
||||
},
|
||||
],
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const containerAppEnvelope: ContainerApp = {
|
||||
configuration: {
|
||||
dapr: {
|
||||
|
@ -224,7 +87,7 @@ async function createOrUpdateContainerApp() {
|
|||
traffic: [
|
||||
{
|
||||
label: "production",
|
||||
revisionName: "testcontainerApp0-ab1234",
|
||||
revisionName: "testcontainerapp0-ab1234",
|
||||
weight: 100,
|
||||
},
|
||||
],
|
||||
|
@ -238,8 +101,8 @@ async function createOrUpdateContainerApp() {
|
|||
template: {
|
||||
containers: [
|
||||
{
|
||||
name: "testcontainerApp0",
|
||||
image: "repo/testcontainerApp0:v1",
|
||||
name: "testcontainerapp0",
|
||||
image: "repo/testcontainerapp0:v1",
|
||||
probes: [
|
||||
{
|
||||
type: "Liveness",
|
||||
|
@ -252,18 +115,6 @@ async function createOrUpdateContainerApp() {
|
|||
periodSeconds: 3,
|
||||
},
|
||||
],
|
||||
volumeMounts: [
|
||||
{
|
||||
mountPath: "/mnt/path1",
|
||||
subPath: "subPath1",
|
||||
volumeName: "azurefile",
|
||||
},
|
||||
{
|
||||
mountPath: "/mnt/path2",
|
||||
subPath: "subPath2",
|
||||
volumeName: "nfsazurefile",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
initContainers: [
|
||||
|
@ -271,8 +122,8 @@ async function createOrUpdateContainerApp() {
|
|||
name: "testinitcontainerApp0",
|
||||
args: ["-c", "while true; do echo hello; sleep 10;done"],
|
||||
command: ["/bin/sh"],
|
||||
image: "repo/testcontainerApp0:v4",
|
||||
resources: { cpu: 0.2, memory: "100Mi" },
|
||||
image: "repo/testcontainerapp0:v4",
|
||||
resources: { cpu: 0.5, memory: "1Gi" },
|
||||
},
|
||||
],
|
||||
scale: {
|
||||
|
@ -288,20 +139,10 @@ async function createOrUpdateContainerApp() {
|
|||
serviceBinds: [
|
||||
{
|
||||
name: "redisService",
|
||||
clientType: "dotnet",
|
||||
customizedKeys: { desiredKey: "defaultKey" },
|
||||
serviceId:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService",
|
||||
},
|
||||
],
|
||||
volumes: [
|
||||
{ name: "azurefile", storageName: "storage", storageType: "AzureFile" },
|
||||
{
|
||||
name: "nfsazurefile",
|
||||
storageName: "nfsStorage",
|
||||
storageType: "NfsAzureFile",
|
||||
},
|
||||
],
|
||||
},
|
||||
workloadProfileName: "My-GP-01",
|
||||
};
|
||||
|
@ -319,14 +160,14 @@ async function createOrUpdateContainerApp() {
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ManagedBy_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateManagedByApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerAppManagedBy";
|
||||
const containerAppName = "testcontainerappmanagedby";
|
||||
const containerAppEnvelope: ContainerApp = {
|
||||
configuration: {
|
||||
ingress: {
|
||||
|
@ -334,7 +175,7 @@ async function createOrUpdateManagedByApp() {
|
|||
external: true,
|
||||
targetPort: 3000,
|
||||
traffic: [
|
||||
{ revisionName: "testcontainerAppManagedBy-ab1234", weight: 100 },
|
||||
{ revisionName: "testcontainerappmanagedby-ab1234", weight: 100 },
|
||||
],
|
||||
transport: "tcp",
|
||||
},
|
||||
|
@ -347,8 +188,8 @@ async function createOrUpdateManagedByApp() {
|
|||
template: {
|
||||
containers: [
|
||||
{
|
||||
name: "testcontainerAppManagedBy",
|
||||
image: "repo/testcontainerAppManagedBy:v1",
|
||||
name: "testcontainerappmanagedby",
|
||||
image: "repo/testcontainerappmanagedby:v1",
|
||||
probes: [
|
||||
{
|
||||
type: "Liveness",
|
||||
|
@ -385,21 +226,21 @@ async function createOrUpdateManagedByApp() {
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateTcpApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerAppTcp";
|
||||
const containerAppName = "testcontainerapptcp";
|
||||
const containerAppEnvelope: ContainerApp = {
|
||||
configuration: {
|
||||
ingress: {
|
||||
exposedPort: 4000,
|
||||
external: true,
|
||||
targetPort: 3000,
|
||||
traffic: [{ revisionName: "testcontainerAppTcp-ab1234", weight: 100 }],
|
||||
traffic: [{ revisionName: "testcontainerapptcp-ab1234", weight: 100 }],
|
||||
transport: "tcp",
|
||||
},
|
||||
},
|
||||
|
@ -409,8 +250,8 @@ async function createOrUpdateTcpApp() {
|
|||
template: {
|
||||
containers: [
|
||||
{
|
||||
name: "testcontainerAppTcp",
|
||||
image: "repo/testcontainerAppTcp:v1",
|
||||
name: "testcontainerapptcp",
|
||||
image: "repo/testcontainerapptcp:v1",
|
||||
probes: [
|
||||
{
|
||||
type: "Liveness",
|
||||
|
@ -444,7 +285,6 @@ async function createOrUpdateTcpApp() {
|
|||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateAppOnAConnectedEnvironment();
|
||||
createOrUpdateContainerApp();
|
||||
createOrUpdateManagedByApp();
|
||||
createOrUpdateTcpApp();
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* This sample demonstrates how to Delete a Container App.
|
||||
*
|
||||
* @summary Delete a Container App.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Delete.json
|
||||
*/
|
||||
async function deleteContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testWorkerApp0";
|
||||
const containerAppName = "testworkerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.beginDeleteAndWait(
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get a diagnostics result of a Container App.
|
||||
*
|
||||
* @summary Get a diagnostics result of a Container App.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_Get.json
|
||||
*/
|
||||
async function getContainerAppDiagnosticsInfo() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json
|
||||
*/
|
||||
async function getContainerAppRevision() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json
|
||||
*/
|
||||
async function getContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerAppsDiagnostics.getRoot(
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the list of diagnostics for a given Container App.
|
||||
*
|
||||
* @summary Get the list of diagnostics for a given Container App.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_List.json
|
||||
*/
|
||||
async function getTheListOfAvailableDiagnosticsForAGivenContainerApp() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json
|
||||
*/
|
||||
async function listContainerAppRevisions() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get auth token for a container app
|
||||
*
|
||||
* @summary Get auth token for a container app
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_GetAuthToken.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_GetAuthToken.json
|
||||
*/
|
||||
async function getContainerAppAuthToken() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"651f8027-33e8-4ec4-97b4-f6e9f3dc8744";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.getAuthToken(
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json
|
||||
*/
|
||||
async function getContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.get(
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_ListByResourceGroup.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListByResourceGroup.json
|
||||
*/
|
||||
async function listContainerAppsByResourceGroup() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_ListBySubscription.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListBySubscription.json
|
||||
*/
|
||||
async function listContainerAppsBySubscription() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,14 +21,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json
|
||||
*/
|
||||
async function analyzeCustomHostname() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const customHostname = "my.name.corp";
|
||||
const options: ContainerAppsListCustomHostNameAnalysisOptionalParams = {
|
||||
customHostname,
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_ListSecrets.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListSecrets.json
|
||||
*/
|
||||
async function listContainerAppsSecrets() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.listSecrets(
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Replicas_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_Get.json
|
||||
*/
|
||||
async function getContainerAppRevisionReplica() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Replicas_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_List.json
|
||||
*/
|
||||
async function listContainerAppReplicas() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_Activate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Activate.json
|
||||
*/
|
||||
async function activateContainerAppRevision() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_Deactivate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Deactivate.json
|
||||
*/
|
||||
async function deactivateContainerAppRevision() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json
|
||||
*/
|
||||
async function getContainerAppRevision() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json
|
||||
*/
|
||||
async function listContainerAppRevisions() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/Revisions_Restart.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Restart.json
|
||||
*/
|
||||
async function restartContainerAppRevision() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/SourceControls_CreateOrUpdate.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateContainerAppSourceControl() {
|
||||
const subscriptionId =
|
||||
|
@ -40,10 +40,6 @@ async function createOrUpdateContainerAppSourceControl() {
|
|||
kind: "feaderated",
|
||||
tenantId: "<tenantid>",
|
||||
},
|
||||
buildEnvironmentVariables: [
|
||||
{ name: "foo1", value: "bar1" },
|
||||
{ name: "foo2", value: "bar2" },
|
||||
],
|
||||
contextPath: "./",
|
||||
githubPersonalAccessToken: "test",
|
||||
image: "image/tag",
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/SourceControls_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Delete.json
|
||||
*/
|
||||
async function deleteContainerAppSourceControl() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/SourceControls_Get.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Get.json
|
||||
*/
|
||||
async function getContainerAppSourceControl() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/SourceControls_ListByContainer.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_ListByContainer.json
|
||||
*/
|
||||
async function listAppSourceControls() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* This sample demonstrates how to Start a container app
|
||||
*
|
||||
* @summary Start a container app
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Start.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Start.json
|
||||
*/
|
||||
async function startContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testWorkerApp0";
|
||||
const containerAppName = "testworkerapp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.beginStartAndWait(
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* This sample demonstrates how to Stop a container app
|
||||
*
|
||||
* @summary Stop a container app
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Stop.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Stop.json
|
||||
*/
|
||||
async function stopContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testWorkerApp0";
|
||||
const containerAppName = "testworkerApp0";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.containerApps.beginStopAndWait(
|
||||
|
|
|
@ -18,14 +18,14 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/ContainerApps_Patch.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Patch.json
|
||||
*/
|
||||
async function patchContainerApp() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
|
||||
const containerAppName = "testcontainerApp0";
|
||||
const containerAppName = "testcontainerapp0";
|
||||
const containerAppEnvelope: ContainerApp = {
|
||||
configuration: {
|
||||
dapr: {
|
||||
|
@ -74,7 +74,7 @@ async function patchContainerApp() {
|
|||
traffic: [
|
||||
{
|
||||
label: "production",
|
||||
revisionName: "testcontainerApp0-ab1234",
|
||||
revisionName: "testcontainerapp0-ab1234",
|
||||
weight: 100,
|
||||
},
|
||||
],
|
||||
|
@ -87,8 +87,8 @@ async function patchContainerApp() {
|
|||
template: {
|
||||
containers: [
|
||||
{
|
||||
name: "testcontainerApp0",
|
||||
image: "repo/testcontainerApp0:v1",
|
||||
name: "testcontainerapp0",
|
||||
image: "repo/testcontainerapp0:v1",
|
||||
probes: [
|
||||
{
|
||||
type: "Liveness",
|
||||
|
@ -106,8 +106,8 @@ async function patchContainerApp() {
|
|||
initContainers: [
|
||||
{
|
||||
name: "testinitcontainerApp0",
|
||||
image: "repo/testcontainerApp0:v4",
|
||||
resources: { cpu: 0.2, memory: "100Mi" },
|
||||
image: "repo/testcontainerapp0:v4",
|
||||
resources: { cpu: 0.5, memory: "1Gi" },
|
||||
},
|
||||
],
|
||||
scale: {
|
||||
|
@ -123,8 +123,6 @@ async function patchContainerApp() {
|
|||
serviceBinds: [
|
||||
{
|
||||
name: "service",
|
||||
clientType: "dotnet",
|
||||
customizedKeys: { desiredKey: "defaultKey" },
|
||||
serviceId:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service",
|
||||
},
|
||||
|
|
|
@ -1,169 +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 {
|
||||
DaprComponentResiliencyPolicy,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a resiliency policy for a Dapr component.
|
||||
*
|
||||
* @summary Creates or updates a resiliency policy for a Dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponentResiliencyPolicyWithAllOptions() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const name = "myresiliencypolicy";
|
||||
const daprComponentResiliencyPolicyEnvelope: DaprComponentResiliencyPolicy = {
|
||||
inboundPolicy: {
|
||||
circuitBreakerPolicy: {
|
||||
consecutiveErrors: 5,
|
||||
intervalInSeconds: 4,
|
||||
timeoutInSeconds: 10,
|
||||
},
|
||||
httpRetryPolicy: {
|
||||
maxRetries: 15,
|
||||
retryBackOff: {
|
||||
initialDelayInMilliseconds: 2000,
|
||||
maxIntervalInMilliseconds: 5500,
|
||||
},
|
||||
},
|
||||
timeoutPolicy: { responseTimeoutInSeconds: 30 },
|
||||
},
|
||||
outboundPolicy: {
|
||||
circuitBreakerPolicy: {
|
||||
consecutiveErrors: 3,
|
||||
intervalInSeconds: 60,
|
||||
timeoutInSeconds: 20,
|
||||
},
|
||||
httpRetryPolicy: {
|
||||
maxRetries: 5,
|
||||
retryBackOff: {
|
||||
initialDelayInMilliseconds: 100,
|
||||
maxIntervalInMilliseconds: 30000,
|
||||
},
|
||||
},
|
||||
timeoutPolicy: { responseTimeoutInSeconds: 12 },
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprComponentResiliencyPolicies.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
name,
|
||||
daprComponentResiliencyPolicyEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a resiliency policy for a Dapr component.
|
||||
*
|
||||
* @summary Creates or updates a resiliency policy for a Dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const name = "myresiliencypolicy";
|
||||
const daprComponentResiliencyPolicyEnvelope: DaprComponentResiliencyPolicy = {
|
||||
outboundPolicy: {
|
||||
circuitBreakerPolicy: {
|
||||
consecutiveErrors: 3,
|
||||
intervalInSeconds: 60,
|
||||
timeoutInSeconds: 20,
|
||||
},
|
||||
httpRetryPolicy: {
|
||||
maxRetries: 5,
|
||||
retryBackOff: {
|
||||
initialDelayInMilliseconds: 100,
|
||||
maxIntervalInMilliseconds: 30000,
|
||||
},
|
||||
},
|
||||
timeoutPolicy: { responseTimeoutInSeconds: 12 },
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprComponentResiliencyPolicies.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
name,
|
||||
daprComponentResiliencyPolicyEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a resiliency policy for a Dapr component.
|
||||
*
|
||||
* @summary Creates or updates a resiliency policy for a Dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const name = "myresiliencypolicy";
|
||||
const daprComponentResiliencyPolicyEnvelope: DaprComponentResiliencyPolicy = {
|
||||
inboundPolicy: {
|
||||
circuitBreakerPolicy: { consecutiveErrors: 3, timeoutInSeconds: 20 },
|
||||
httpRetryPolicy: {
|
||||
maxRetries: 5,
|
||||
retryBackOff: {
|
||||
initialDelayInMilliseconds: 2000,
|
||||
maxIntervalInMilliseconds: 5500,
|
||||
},
|
||||
},
|
||||
},
|
||||
outboundPolicy: { timeoutPolicy: { responseTimeoutInSeconds: 12 } },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprComponentResiliencyPolicies.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
name,
|
||||
daprComponentResiliencyPolicyEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateDaprComponentResiliencyPolicyWithAllOptions();
|
||||
createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly();
|
||||
createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,47 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a resiliency policy for a Dapr component.
|
||||
*
|
||||
* @summary Delete a resiliency policy for a Dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json
|
||||
*/
|
||||
async function deleteDaprComponentResiliencyPolicy() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const name = "myresiliencypolicy";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprComponentResiliencyPolicies.delete(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteDaprComponentResiliencyPolicy();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,47 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a Dapr component resiliency policy.
|
||||
*
|
||||
* @summary Get a Dapr component resiliency policy.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Get.json
|
||||
*/
|
||||
async function getDaprComponentResiliencyPolicy() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const name = "myresiliencypolicy";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprComponentResiliencyPolicies.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getDaprComponentResiliencyPolicy();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,48 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the resiliency policies for a Dapr component.
|
||||
*
|
||||
* @summary Get the resiliency policies for a Dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_List.json
|
||||
*/
|
||||
async function listDaprComponentResiliencyPolicies() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const componentName = "mydaprcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.daprComponentResiliencyPolicies.list(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
componentName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listDaprComponentResiliencyPolicies();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -21,7 +21,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponentWithSecretStoreComponent() {
|
||||
const subscriptionId =
|
||||
|
@ -43,14 +43,6 @@ async function createOrUpdateDaprComponentWithSecretStoreComponent() {
|
|||
],
|
||||
scopes: ["container-app-1", "container-app-2"],
|
||||
secretStoreComponent: "my-secret-store",
|
||||
serviceComponentBind: [
|
||||
{
|
||||
name: "statestore",
|
||||
metadata: { name: "daprcomponentBind", value: "redis-bind" },
|
||||
serviceId:
|
||||
"/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis",
|
||||
},
|
||||
],
|
||||
version: "v1",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -68,7 +60,7 @@ async function createOrUpdateDaprComponentWithSecretStoreComponent() {
|
|||
* 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/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_Secrets.json
|
||||
*/
|
||||
async function createOrUpdateDaprComponentWithSecrets() {
|
||||
const subscriptionId =
|
||||
|
@ -90,14 +82,6 @@ async function createOrUpdateDaprComponentWithSecrets() {
|
|||
],
|
||||
scopes: ["container-app-1", "container-app-2"],
|
||||
secrets: [{ name: "masterkey", value: "keyvalue" }],
|
||||
serviceComponentBind: [
|
||||
{
|
||||
name: "statestore",
|
||||
metadata: { name: "daprcomponentBind", value: "redis-bind" },
|
||||
serviceId:
|
||||
"/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis",
|
||||
},
|
||||
],
|
||||
version: "v1",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/DaprComponents_Delete.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Delete.json
|
||||
*/
|
||||
async function deleteDaprComponent() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get a dapr component.
|
||||
*
|
||||
* @summary Get a dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_SecretStoreComponent.json
|
||||
*/
|
||||
async function getDaprComponentWithSecretStoreComponent() {
|
||||
const subscriptionId =
|
||||
|
@ -42,7 +42,7 @@ async function getDaprComponentWithSecretStoreComponent() {
|
|||
* This sample demonstrates how to Get a dapr component.
|
||||
*
|
||||
* @summary Get a dapr component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_Secrets.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_Secrets.json
|
||||
*/
|
||||
async function getDaprComponentWithSecrets() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/DaprComponents_List.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_List.json
|
||||
*/
|
||||
async function listDaprComponents() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* 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/preview/2023-11-02-preview/examples/DaprComponents_ListSecrets.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_ListSecrets.json
|
||||
*/
|
||||
async function listContainerAppsSecrets() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -1,129 +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 {
|
||||
DaprSubscription,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Dapr subscription in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a Dapr subscription in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json
|
||||
*/
|
||||
async function createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mysubscription";
|
||||
const daprSubscriptionEnvelope: DaprSubscription = {
|
||||
bulkSubscribe: {
|
||||
enabled: true,
|
||||
maxAwaitDurationMs: 500,
|
||||
maxMessagesCount: 123,
|
||||
},
|
||||
pubsubName: "mypubsubcomponent",
|
||||
routes: { default: "/products" },
|
||||
scopes: ["warehouseapp", "customersupportapp"],
|
||||
topic: "inventory",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
daprSubscriptionEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Dapr subscription in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a Dapr subscription in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json
|
||||
*/
|
||||
async function createOrUpdateDaprSubscriptionWithDefaultRouteOnly() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mysubscription";
|
||||
const daprSubscriptionEnvelope: DaprSubscription = {
|
||||
pubsubName: "mypubsubcomponent",
|
||||
routes: { default: "/products" },
|
||||
topic: "inventory",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
daprSubscriptionEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Dapr subscription in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a Dapr subscription in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json
|
||||
*/
|
||||
async function createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mysubscription";
|
||||
const daprSubscriptionEnvelope: DaprSubscription = {
|
||||
metadata: { foo: "bar", hello: "world" },
|
||||
pubsubName: "mypubsubcomponent",
|
||||
routes: {
|
||||
default: "/products",
|
||||
rules: [
|
||||
{ path: "/widgets", match: "event.type == 'widget'" },
|
||||
{ path: "/gadgets", match: "event.type == 'gadget'" },
|
||||
],
|
||||
},
|
||||
topic: "inventory",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.createOrUpdate(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
daprSubscriptionEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes();
|
||||
createOrUpdateDaprSubscriptionWithDefaultRouteOnly();
|
||||
createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a Dapr subscription from a Managed Environment.
|
||||
*
|
||||
* @summary Delete a Dapr subscription from a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Delete.json
|
||||
*/
|
||||
async function deleteDaprSubscription() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mysubscription";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.delete(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteDaprSubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,95 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a dapr subscription.
|
||||
*
|
||||
* @summary Get a dapr subscription.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json
|
||||
*/
|
||||
async function getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mypubsubcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a dapr subscription.
|
||||
*
|
||||
* @summary Get a dapr subscription.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json
|
||||
*/
|
||||
async function getDaprSubscriptionWithDefaultRouteOnly() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mypubsubcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a dapr subscription.
|
||||
*
|
||||
* @summary Get a dapr subscription.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json
|
||||
*/
|
||||
async function getDaprSubscriptionWithRouteRulesAndMetadata() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mypubsubcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.daprSubscriptions.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes();
|
||||
getDaprSubscriptionWithDefaultRouteOnly();
|
||||
getDaprSubscriptionWithRouteRulesAndMetadata();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { ContainerAppsAPIClient } from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Dapr subscriptions for a managed environment.
|
||||
*
|
||||
* @summary Get the Dapr subscriptions for a managed environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_List.json
|
||||
*/
|
||||
async function listDaprSubscriptions() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.daprSubscriptions.list(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listDaprSubscriptions();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,90 +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 {
|
||||
DotNetComponent,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a .NET Component in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a .NET Component in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateNetComponent() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const dotNetComponentEnvelope: DotNetComponent = {
|
||||
componentType: "AspireDashboard",
|
||||
configurations: [{ propertyName: "dashboard-theme", value: "dark" }],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
dotNetComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a .NET Component in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a .NET Component in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json
|
||||
*/
|
||||
async function createOrUpdateNetComponentWithServiceBinds() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const dotNetComponentEnvelope: DotNetComponent = {
|
||||
componentType: "AspireDashboard",
|
||||
configurations: [{ propertyName: "dashboard-theme", value: "dark" }],
|
||||
serviceBinds: [
|
||||
{
|
||||
name: "yellowcat",
|
||||
serviceId:
|
||||
"/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
dotNetComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateNetComponent();
|
||||
createOrUpdateNetComponentWithServiceBinds();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,70 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a .NET Component.
|
||||
*
|
||||
* @summary Get a .NET Component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get.json
|
||||
*/
|
||||
async function getNetComponent() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a .NET Component.
|
||||
*
|
||||
* @summary Get a .NET Component.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get_ServiceBind.json
|
||||
*/
|
||||
async function getNetComponentWithServiceBinds() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.get(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetComponent();
|
||||
getNetComponentWithServiceBinds();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,72 +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";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the .NET Components for a managed environment.
|
||||
*
|
||||
* @summary Get the .NET Components for a managed environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List.json
|
||||
*/
|
||||
async function listNetComponents() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dotNetComponents.list(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the .NET Components for a managed environment.
|
||||
*
|
||||
* @summary Get the .NET Components for a managed environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List_ServiceBind.json
|
||||
*/
|
||||
async function listNetComponentsWithServiceBinds() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dotNetComponents.list(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listNetComponents();
|
||||
listNetComponentsWithServiceBinds();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,90 +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 {
|
||||
DotNetComponent,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches a .NET Component using JSON Merge Patch
|
||||
*
|
||||
* @summary Patches a .NET Component using JSON Merge Patch
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch.json
|
||||
*/
|
||||
async function patchNetComponent() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const dotNetComponentEnvelope: DotNetComponent = {
|
||||
componentType: "AspireDashboard",
|
||||
configurations: [{ propertyName: "dashboard-theme", value: "dark" }],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
dotNetComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches a .NET Component using JSON Merge Patch
|
||||
*
|
||||
* @summary Patches a .NET Component using JSON Merge Patch
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch_ServiceBind.json
|
||||
*/
|
||||
async function patchNetComponentWithServiceBinds() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "mydotnetcomponent";
|
||||
const dotNetComponentEnvelope: DotNetComponent = {
|
||||
componentType: "AspireDashboard",
|
||||
configurations: [{ propertyName: "dashboard-theme", value: "dark" }],
|
||||
serviceBinds: [
|
||||
{
|
||||
name: "yellowcat",
|
||||
serviceId:
|
||||
"/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.dotNetComponents.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
dotNetComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchNetComponent();
|
||||
patchNetComponentWithServiceBinds();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -18,7 +18,7 @@ dotenv.config();
|
|||
* This sample demonstrates how to Get the verification id of a subscription used for verifying custom domains
|
||||
*
|
||||
* @summary Get the verification id of a subscription used for verifying custom domains
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Subscriptions_GetCustomDomainVerificationId.json
|
||||
*/
|
||||
async function listAllOperations() {
|
||||
const subscriptionId =
|
||||
|
|
|
@ -1,102 +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 {
|
||||
JavaComponent,
|
||||
ContainerAppsAPIClient,
|
||||
} from "@azure/arm-appcontainers";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Java Component in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a Java Component in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate.json
|
||||
*/
|
||||
async function createOrUpdateJavaComponent() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "myjavacomponent";
|
||||
const javaComponentEnvelope: JavaComponent = {
|
||||
componentType: "SpringBootAdmin",
|
||||
configurations: [
|
||||
{ propertyName: "spring.boot.admin.ui.enable-toasts", value: "true" },
|
||||
{
|
||||
propertyName: "spring.boot.admin.monitor.status-interval",
|
||||
value: "10000ms",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.javaComponents.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
javaComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Java Component in a Managed Environment.
|
||||
*
|
||||
* @summary Creates or updates a Java Component in a Managed Environment.
|
||||
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json
|
||||
*/
|
||||
async function createOrUpdateJavaComponentWithServiceBinds() {
|
||||
const subscriptionId =
|
||||
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] ||
|
||||
"8efdecc5-919e-44eb-b179-915dca89ebf9";
|
||||
const resourceGroupName =
|
||||
process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
|
||||
const environmentName = "myenvironment";
|
||||
const name = "myjavacomponent";
|
||||
const javaComponentEnvelope: JavaComponent = {
|
||||
componentType: "SpringBootAdmin",
|
||||
configurations: [
|
||||
{ propertyName: "spring.boot.admin.ui.enable-toasts", value: "true" },
|
||||
{
|
||||
propertyName: "spring.boot.admin.monitor.status-interval",
|
||||
value: "10000ms",
|
||||
},
|
||||
],
|
||||
serviceBinds: [
|
||||
{
|
||||
name: "yellowcat",
|
||||
serviceId:
|
||||
"/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new ContainerAppsAPIClient(credential, subscriptionId);
|
||||
const result = await client.javaComponents.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
environmentName,
|
||||
name,
|
||||
javaComponentEnvelope,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateJavaComponent();
|
||||
createOrUpdateJavaComponentWithServiceBinds();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче