recording refresh 21 (#24246)
* recording refresh 21 * update files * Update pnpm-lock.yaml * update files * update files * update files * update files
This commit is contained in:
Родитель
e980afad44
Коммит
63cf49eca7
|
@ -3784,7 +3784,7 @@ packages:
|
|||
dependencies:
|
||||
semver: 7.3.8
|
||||
shelljs: 0.8.5
|
||||
typescript: 5.0.0-dev.20221218
|
||||
typescript: 5.0.0-dev.20221219
|
||||
dev: false
|
||||
|
||||
/downlevel-dts/0.7.0:
|
||||
|
@ -8488,8 +8488,8 @@ packages:
|
|||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/typescript/5.0.0-dev.20221218:
|
||||
resolution: {integrity: sha512-H9OjIoDzurBIgB+Gq/9aAudpSKtfaN+dRCwWc/Ugg8B6/p5VA5KFlnwm2sLjOyTzApusKKUJUpV+u/hXEfxaOA==}
|
||||
/typescript/5.0.0-dev.20221219:
|
||||
resolution: {integrity: sha512-/ZglDGQtpeVudCAVJuEdM8K8vUCA1yPMpsk3y08/ZXn6dxk/D1hy59FEI25/EHqsACElN++9CoKzkJS1wBTiRw==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
@ -9891,7 +9891,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-appservice-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-5MygL1hdb+v5sTzCGHfUVLFZjxzWkSlG8RH7EuVbaU8oxNQrpMpqYrG1/DgjwuMnaHUIZNjyav8c+eh7nnZT9Q==, tarball: file:projects/arm-appservice-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-4hgR3nTbpaNCjhsBvryqC6HtxauC2JPA+wVySCBSc6RUkW4Z+rWC2PAGX66QSd/XV8vnrbmHWWMkf/J1Aw7AwQ==, tarball: file:projects/arm-appservice-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-appservice-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -9902,18 +9902,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -9987,7 +9989,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-authorization-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-qkNdkK2xrC1E4v0Q37U2JJBI9LCwLTIlks3/anrG2SM6FSwR2N/ZA0ltRnDZtP3cpSW9CRiEo7Mj0eOBm/or0g==, tarball: file:projects/arm-authorization-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-SuwN4FnyqC5zSSTUXYhOXdZD9+tjgVBM7CYTPn37TdiFWSCctsuI3RQFYjhqNa+7nLEvSPcZz0zfRtUDTLahNw==, tarball: file:projects/arm-authorization-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-authorization-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -9998,18 +10000,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -10442,7 +10446,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-k+sV8xO6YyYDcty4EfUymWWzpR5rBP/WnTBlPHMqG+3RXZyce8deQnQJKevOTPv1o1uQNhzwxkcDSrxnu1y9jw==, tarball: file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-U9Q9QlA0JYRNANmV5FiVoAvBYyXsd4GInoGP5aQhVAL2A1N6GQcyOGvH03zm5NBKrR+W+RU3WP8WFShW6hpxQA==, tarball: file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-commerce-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10453,18 +10457,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -10580,7 +10586,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-compute-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-DWlew1VsOFbfvamVVvZm/ioj5NaILePfoEOFdEG4P8LyBMAR3Z+c7BJFNt4gTEzzefeK2G+fxDwUuRIz7S6w+g==, tarball: file:projects/arm-compute-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-ulg+sgzXZwUU0lDu7Um7/HCU9NIXktZ1K7E2NUiQFk6+FFe9D1rT6066pV4uPaKwebXwNBe8DyaR8UVn2VuWTA==, tarball: file:projects/arm-compute-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-compute-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10591,18 +10597,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
|
|
@ -1,5 +1,117 @@
|
|||
# Release History
|
||||
|
||||
## 2.1.0 (2022-12-16)
|
||||
|
||||
**Features**
|
||||
|
||||
- Added Interface AppServicePlan
|
||||
- Added Interface AppServicePlanPatchResource
|
||||
- Added Interface AzureStoragePropertyDictionaryResource
|
||||
- Added Interface BackupItem
|
||||
- Added Interface BackupRequest
|
||||
- Added Interface BillingMeter
|
||||
- Added Interface Certificate
|
||||
- Added Interface CertificatePatchResource
|
||||
- Added Interface ConnectionStringDictionary
|
||||
- Added Interface ContinuousWebJob
|
||||
- Added Interface CustomHostnameAnalysisResult
|
||||
- Added Interface DeletedAppRestoreRequest
|
||||
- Added Interface Deployment
|
||||
- Added Interface FunctionEnvelope
|
||||
- Added Interface FunctionSecrets
|
||||
- Added Interface GeoRegion
|
||||
- Added Interface HostNameBinding
|
||||
- Added Interface HybridConnection
|
||||
- Added Interface HybridConnectionKey
|
||||
- Added Interface HybridConnectionLimits
|
||||
- Added Interface Identifier
|
||||
- Added Interface MigrateMySqlRequest
|
||||
- Added Interface MigrateMySqlStatus
|
||||
- Added Interface MSDeploy
|
||||
- Added Interface MSDeployLog
|
||||
- Added Interface MSDeployStatus
|
||||
- Added Interface NetworkFeatures
|
||||
- Added Interface PremierAddOn
|
||||
- Added Interface PremierAddOnOffer
|
||||
- Added Interface PremierAddOnPatchResource
|
||||
- Added Interface PrivateAccess
|
||||
- Added Interface ProcessInfo
|
||||
- Added Interface ProcessModuleInfo
|
||||
- Added Interface ProcessThreadInfo
|
||||
- Added Interface PublicCertificate
|
||||
- Added Interface PushSettings
|
||||
- Added Interface Recommendation
|
||||
- Added Interface RecommendationRule
|
||||
- Added Interface RelayServiceConnectionEntity
|
||||
- Added Interface ResourceMetricDefinition
|
||||
- Added Interface RestoreRequest
|
||||
- Added Interface Site
|
||||
- Added Interface SiteAuthSettings
|
||||
- Added Interface SiteConfigResource
|
||||
- Added Interface SiteConfigurationSnapshotInfo
|
||||
- Added Interface SiteExtensionInfo
|
||||
- Added Interface SiteInstance
|
||||
- Added Interface SiteLogsConfig
|
||||
- Added Interface SitePatchResource
|
||||
- Added Interface SitePhpErrorLogFlag
|
||||
- Added Interface SiteSourceControl
|
||||
- Added Interface SlotConfigNamesResource
|
||||
- Added Interface SlotDifference
|
||||
- Added Interface Snapshot
|
||||
- Added Interface SnapshotRestoreRequest
|
||||
- Added Interface SourceControl
|
||||
- Added Interface StorageMigrationOptions
|
||||
- Added Interface StorageMigrationResponse
|
||||
- Added Interface StringDictionary
|
||||
- Added Interface SwiftVirtualNetwork
|
||||
- Added Interface TriggeredJobHistory
|
||||
- Added Interface TriggeredJobRun
|
||||
- Added Interface TriggeredWebJob
|
||||
- Added Interface User
|
||||
- Added Interface VnetGateway
|
||||
- Added Interface VnetInfo
|
||||
- Added Interface VnetParameters
|
||||
- Added Interface VnetRoute
|
||||
- Added Interface VnetValidationFailureDetails
|
||||
- Added Interface VnetValidationTestFailure
|
||||
- Added Interface WebJob
|
||||
- Added function getContinuationToken
|
||||
- Interface AppServicePlansListMetricsNextOptionalParams no longer has parameter details
|
||||
- Interface AppServicePlansListMetricsNextOptionalParams no longer has parameter filter
|
||||
- Interface AppServicePlansListNextOptionalParams no longer has parameter detailed
|
||||
- Interface AppServicePlansListUsagesNextOptionalParams no longer has parameter filter
|
||||
- Interface AppServicePlansListWebAppsNextOptionalParams no longer has parameter filter
|
||||
- Interface AppServicePlansListWebAppsNextOptionalParams no longer has parameter skipToken
|
||||
- Interface AppServicePlansListWebAppsNextOptionalParams no longer has parameter top
|
||||
- Interface ListBillingMetersNextOptionalParams no longer has parameter billingLocation
|
||||
- Interface ListBillingMetersNextOptionalParams no longer has parameter osType
|
||||
- Interface ListGeoRegionsNextOptionalParams no longer has parameter linuxDynamicWorkersEnabled
|
||||
- Interface ListGeoRegionsNextOptionalParams no longer has parameter linuxWorkersEnabled
|
||||
- Interface ListGeoRegionsNextOptionalParams no longer has parameter sku
|
||||
- Interface ListGeoRegionsNextOptionalParams no longer has parameter xenonWorkersEnabled
|
||||
- Interface ProviderGetAvailableStacksNextOptionalParams no longer has parameter osTypeSelected
|
||||
- Interface ProviderGetAvailableStacksOnPremNextOptionalParams no longer has parameter osTypeSelected
|
||||
- Interface RecommendationsListHistoryForHostingEnvironmentNextOptionalParams no longer has parameter expiredOnly
|
||||
- Interface RecommendationsListHistoryForHostingEnvironmentNextOptionalParams no longer has parameter filter
|
||||
- Interface RecommendationsListHistoryForWebAppNextOptionalParams no longer has parameter expiredOnly
|
||||
- Interface RecommendationsListHistoryForWebAppNextOptionalParams no longer has parameter filter
|
||||
- Interface RecommendationsListNextOptionalParams no longer has parameter featured
|
||||
- Interface RecommendationsListNextOptionalParams no longer has parameter filter
|
||||
- Interface RecommendationsListRecommendedRulesForHostingEnvironmentNextOptionalParams no longer has parameter featured
|
||||
- Interface RecommendationsListRecommendedRulesForHostingEnvironmentNextOptionalParams no longer has parameter filter
|
||||
- Interface RecommendationsListRecommendedRulesForWebAppNextOptionalParams no longer has parameter featured
|
||||
- Interface RecommendationsListRecommendedRulesForWebAppNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListByResourceGroupNextOptionalParams no longer has parameter includeSlots
|
||||
- Interface WebAppsListMetricsNextOptionalParams no longer has parameter details
|
||||
- Interface WebAppsListMetricsNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListMetricsSlotNextOptionalParams no longer has parameter details
|
||||
- Interface WebAppsListMetricsSlotNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListPerfMonCountersNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListPerfMonCountersSlotNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListUsagesNextOptionalParams no longer has parameter filter
|
||||
- Interface WebAppsListUsagesSlotNextOptionalParams no longer has parameter filter
|
||||
|
||||
|
||||
## 2.0.0 (2022-03-11)
|
||||
|
||||
The package of @azure/arm-appservice-profile-2020-09-01-hybrid is using our next generation design principles since version 2.0.0, which contains breaking changes.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"commit": "1067b78669466324a1a2666adf053433c61e7f77",
|
||||
"readme": "specification/web/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\web\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --tag=profile-hybrid-2020-09-01 --profile-content=profile-hybrid-2020-09-01",
|
||||
"autorest_command": "autorest --version=3.9.3 --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\\web\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5 --generate-sample=true --profile-content=profile-hybrid-2020-09-01",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.1.1",
|
||||
"use": "@autorest/typescript@6.0.0-beta.16"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.5.4",
|
||||
"use": "@autorest/typescript@6.0.0-rc.5"
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for WebSiteManagementClient.",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
|
@ -11,9 +11,9 @@
|
|||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.0.0",
|
||||
"@azure/core-client": "^1.6.1",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -36,13 +36,19 @@
|
|||
"mkdirp": "^1.0.4",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~4.2.0",
|
||||
"typescript": "~4.8.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@azure-tools/test-recorder": "^1.0.0",
|
||||
"@azure-tools/test-recorder": "^2.0.0",
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"mocha": "^7.1.1",
|
||||
"cross-env": "^7.0.2"
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"@types/node": "^14.0.0",
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"dotenv": "^8.2.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid",
|
||||
"repository": {
|
||||
|
@ -93,9 +99,8 @@
|
|||
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
||||
"unit-test:browser": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
|
||||
"integration-test:browser": "echo skipped",
|
||||
"docs": "echo skipped"
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"integration-test:browser": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"//metadata": {
|
||||
|
@ -106,5 +111,13 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true
|
||||
"autoPublish": true,
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appservice-profile-2020-09-01-hybrid?view=azure-node-preview"
|
||||
}
|
||||
}
|
||||
|
|
4
sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
4
sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Entries": [],
|
||||
"Variables": {}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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 {
|
||||
AppServicePlan,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateAppServicePlan.json
|
||||
*/
|
||||
async function createOrUpdateAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan: AppServicePlan = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app",
|
||||
location: "East US",
|
||||
sku: { name: "P1", capacity: 1, family: "P", size: "P1", tier: "Premium" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
appServicePlan
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete an App Service plan.
|
||||
*
|
||||
* @summary Delete an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteAppServicePlan.json
|
||||
*/
|
||||
async function deleteAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get an App Service plan.
|
||||
*
|
||||
* @summary Get an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetAppServicePlan.json
|
||||
*/
|
||||
async function getAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans in a resource group.
|
||||
*
|
||||
* @summary Get all App Service plans in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlansByResourceGroup.json
|
||||
*/
|
||||
async function listAppServicePlansByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlansByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans for a subscription.
|
||||
*
|
||||
* @summary Get all App Service plans for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlans.json
|
||||
*/
|
||||
async function listAppServicePlans() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlans();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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 {
|
||||
AppServicePlanPatchResource,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchAppServicePlan.json
|
||||
*/
|
||||
async function patchServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan: AppServicePlanPatchResource = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.update(
|
||||
resourceGroupName,
|
||||
name,
|
||||
appServicePlan
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
Certificate,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateCertificate.json
|
||||
*/
|
||||
async function createOrUpdateCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope: Certificate = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
expirationDate: new Date("2039-12-31T23:59:59+00:00"),
|
||||
friendlyName: "",
|
||||
hostNames: ["ServerCert"],
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
issueDate: new Date("2015-11-12T23:40:25+00:00"),
|
||||
issuer: "CACert",
|
||||
location: "East US",
|
||||
password: "<password>",
|
||||
subjectName: "ServerCert",
|
||||
thumbprint: "FE703D7411A44163B6D32B3AD9B03E175886EBFE"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.createOrUpdate(
|
||||
resourceGroupName,
|
||||
name,
|
||||
certificateEnvelope
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a certificate.
|
||||
*
|
||||
* @summary Delete a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteCertificate.json
|
||||
*/
|
||||
async function deleteCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate.
|
||||
*
|
||||
* @summary Get a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetCertificate.json
|
||||
*/
|
||||
async function getCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates in a resource group.
|
||||
*
|
||||
* @summary Get all certificates in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificatesByResourceGroup.json
|
||||
*/
|
||||
async function listCertificatesByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates for a subscription.
|
||||
*
|
||||
* @summary Get all certificates for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificates.json
|
||||
*/
|
||||
async function listCertificatesForSubscription() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesForSubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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 {
|
||||
CertificatePatchResource,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchCertificate.json
|
||||
*/
|
||||
async function patchCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope: CertificatePatchResource = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
password: "<password>"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.update(
|
||||
resourceGroupName,
|
||||
name,
|
||||
certificateEnvelope
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
*
|
||||
* @summary Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListOperations.json
|
||||
*/
|
||||
async function listOperations() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.provider.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listOperations();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 {
|
||||
VnetParameters,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
*
|
||||
* @summary Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/VerifyHostingEnvironmentVnet.json
|
||||
*/
|
||||
async function verifyHostingEnvironmentVnet() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const parameters: VnetParameters = {
|
||||
vnetName: "vNet123",
|
||||
vnetResourceGroup: "vNet123rg",
|
||||
vnetSubnetName: "vNet123SubNet"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.verifyHostingEnvironmentVnet(parameters);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
verifyHostingEnvironmentVnet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperation(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraces(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartNetworkTraceOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options: WebAppsStartNetworkTraceOptionalParams = { durationInSeconds };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartNetworkTraceSlotOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options: WebAppsStartNetworkTraceSlotOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartWebSiteNetworkTraceOperationOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options: WebAppsStartWebSiteNetworkTraceOperationOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options: WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopNetworkTrace(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopNetworkTraceSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopWebSiteNetworkTrace(
|
||||
resourceGroupName,
|
||||
name
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopWebSiteNetworkTraceSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,108 @@
|
|||
# client library samples for JavaScript
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [appServicePlansCreateOrUpdateSample.js][appserviceplanscreateorupdatesample] | Creates or updates an App Service Plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateAppServicePlan.json |
|
||||
| [appServicePlansDeleteSample.js][appserviceplansdeletesample] | Delete an App Service plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteAppServicePlan.json |
|
||||
| [appServicePlansGetSample.js][appserviceplansgetsample] | Get an App Service plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetAppServicePlan.json |
|
||||
| [appServicePlansListByResourceGroupSample.js][appserviceplanslistbyresourcegroupsample] | Get all App Service plans in a resource group. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlansByResourceGroup.json |
|
||||
| [appServicePlansListSample.js][appserviceplanslistsample] | Get all App Service plans for a subscription. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlans.json |
|
||||
| [appServicePlansUpdateSample.js][appserviceplansupdatesample] | Creates or updates an App Service Plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchAppServicePlan.json |
|
||||
| [certificatesCreateOrUpdateSample.js][certificatescreateorupdatesample] | Create or update a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateCertificate.json |
|
||||
| [certificatesDeleteSample.js][certificatesdeletesample] | Delete a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteCertificate.json |
|
||||
| [certificatesGetSample.js][certificatesgetsample] | Get a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetCertificate.json |
|
||||
| [certificatesListByResourceGroupSample.js][certificateslistbyresourcegroupsample] | Get all certificates in a resource group. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificatesByResourceGroup.json |
|
||||
| [certificatesListSample.js][certificateslistsample] | Get all certificates for a subscription. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificates.json |
|
||||
| [certificatesUpdateSample.js][certificatesupdatesample] | Create or update a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchCertificate.json |
|
||||
| [providerListOperationsSample.js][providerlistoperationssample] | Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListOperations.json |
|
||||
| [verifyHostingEnvironmentVnetSample.js][verifyhostingenvironmentvnetsample] | Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/VerifyHostingEnvironmentVnet.json |
|
||||
| [webAppsGetNetworkTraceOperationSample.js][webappsgetnetworktraceoperationsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationSlotSample.js][webappsgetnetworktraceoperationslotsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationSlotV2Sample.js][webappsgetnetworktraceoperationslotv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationV2Sample.js][webappsgetnetworktraceoperationv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTracesSample.js][webappsgetnetworktracessample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesSlotSample.js][webappsgetnetworktracesslotsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesSlotV2Sample.js][webappsgetnetworktracesslotv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesV2Sample.js][webappsgetnetworktracesv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsStartNetworkTraceSample.js][webappsstartnetworktracesample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartNetworkTraceSlotSample.js][webappsstartnetworktraceslotsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartWebSiteNetworkTraceOperationSample.js][webappsstartwebsitenetworktraceoperationsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartWebSiteNetworkTraceOperationSlotSample.js][webappsstartwebsitenetworktraceoperationslotsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStopNetworkTraceSample.js][webappsstopnetworktracesample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopNetworkTraceSlotSample.js][webappsstopnetworktraceslotsample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopWebSiteNetworkTraceSample.js][webappsstopwebsitenetworktracesample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopWebSiteNetworkTraceSlotSample.js][webappsstopwebsitenetworktraceslotsample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node appServicePlansCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env APPSERVICE_SUBSCRIPTION_ID="<appservice subscription id>" APPSERVICE_RESOURCE_GROUP="<appservice resource group>" node appServicePlansCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[appserviceplanscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansCreateOrUpdateSample.js
|
||||
[appserviceplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansDeleteSample.js
|
||||
[appserviceplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansGetSample.js
|
||||
[appserviceplanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansListByResourceGroupSample.js
|
||||
[appserviceplanslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansListSample.js
|
||||
[appserviceplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/appServicePlansUpdateSample.js
|
||||
[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesCreateOrUpdateSample.js
|
||||
[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesDeleteSample.js
|
||||
[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesGetSample.js
|
||||
[certificateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesListByResourceGroupSample.js
|
||||
[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesListSample.js
|
||||
[certificatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/certificatesUpdateSample.js
|
||||
[providerlistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/providerListOperationsSample.js
|
||||
[verifyhostingenvironmentvnetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/verifyHostingEnvironmentVnetSample.js
|
||||
[webappsgetnetworktraceoperationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTraceOperationSample.js
|
||||
[webappsgetnetworktraceoperationslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTraceOperationSlotSample.js
|
||||
[webappsgetnetworktraceoperationslotv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTraceOperationSlotV2Sample.js
|
||||
[webappsgetnetworktraceoperationv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTraceOperationV2Sample.js
|
||||
[webappsgetnetworktracessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTracesSample.js
|
||||
[webappsgetnetworktracesslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTracesSlotSample.js
|
||||
[webappsgetnetworktracesslotv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTracesSlotV2Sample.js
|
||||
[webappsgetnetworktracesv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsGetNetworkTracesV2Sample.js
|
||||
[webappsstartnetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStartNetworkTraceSample.js
|
||||
[webappsstartnetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStartNetworkTraceSlotSample.js
|
||||
[webappsstartwebsitenetworktraceoperationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStartWebSiteNetworkTraceOperationSample.js
|
||||
[webappsstartwebsitenetworktraceoperationslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStartWebSiteNetworkTraceOperationSlotSample.js
|
||||
[webappsstopnetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStopNetworkTraceSample.js
|
||||
[webappsstopnetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStopNetworkTraceSlotSample.js
|
||||
[webappsstopwebsitenetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStopWebSiteNetworkTraceSample.js
|
||||
[webappsstopwebsitenetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/javascript/webAppsStopWebSiteNetworkTraceSlotSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appservice-profile-2020-09-01-hybrid?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/README.md
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateAppServicePlan.json
|
||||
*/
|
||||
async function createOrUpdateAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app",
|
||||
location: "East US",
|
||||
sku: { name: "P1", capacity: 1, family: "P", size: "P1", tier: "Premium" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
appServicePlan
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete an App Service plan.
|
||||
*
|
||||
* @summary Delete an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteAppServicePlan.json
|
||||
*/
|
||||
async function deleteAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get an App Service plan.
|
||||
*
|
||||
* @summary Get an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetAppServicePlan.json
|
||||
*/
|
||||
async function getAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans in a resource group.
|
||||
*
|
||||
* @summary Get all App Service plans in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlansByResourceGroup.json
|
||||
*/
|
||||
async function listAppServicePlansByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlansByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans for a subscription.
|
||||
*
|
||||
* @summary Get all App Service plans for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlans.json
|
||||
*/
|
||||
async function listAppServicePlans() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlans();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchAppServicePlan.json
|
||||
*/
|
||||
async function patchServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.update(resourceGroupName, name, appServicePlan);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateCertificate.json
|
||||
*/
|
||||
async function createOrUpdateCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
expirationDate: new Date("2039-12-31T23:59:59+00:00"),
|
||||
friendlyName: "",
|
||||
hostNames: ["ServerCert"],
|
||||
id: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
issueDate: new Date("2015-11-12T23:40:25+00:00"),
|
||||
issuer: "CACert",
|
||||
location: "East US",
|
||||
password: "<password>",
|
||||
subjectName: "ServerCert",
|
||||
thumbprint: "FE703D7411A44163B6D32B3AD9B03E175886EBFE",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.createOrUpdate(
|
||||
resourceGroupName,
|
||||
name,
|
||||
certificateEnvelope
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a certificate.
|
||||
*
|
||||
* @summary Delete a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteCertificate.json
|
||||
*/
|
||||
async function deleteCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate.
|
||||
*
|
||||
* @summary Get a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetCertificate.json
|
||||
*/
|
||||
async function getCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates in a resource group.
|
||||
*
|
||||
* @summary Get all certificates in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificatesByResourceGroup.json
|
||||
*/
|
||||
async function listCertificatesByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates for a subscription.
|
||||
*
|
||||
* @summary Get all certificates for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificates.json
|
||||
*/
|
||||
async function listCertificatesForSubscription() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesForSubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchCertificate.json
|
||||
*/
|
||||
async function patchCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
id: "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
password: "<password>",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.update(resourceGroupName, name, certificateEnvelope);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-appservice-profile-2020-09-01-hybrid-js",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/appservice/arm-appservice-profile-2020-09-01-hybrid"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid",
|
||||
"dependencies": {
|
||||
"@azure/arm-appservice-profile-2020-09-01-hybrid": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
*
|
||||
* @summary Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListOperations.json
|
||||
*/
|
||||
async function listOperations() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.provider.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listOperations();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
*
|
||||
* @summary Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/VerifyHostingEnvironmentVnet.json
|
||||
*/
|
||||
async function verifyHostingEnvironmentVnet() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const parameters = {
|
||||
vnetName: "vNet123",
|
||||
vnetResourceGroup: "vNet123rg",
|
||||
vnetSubnetName: "vNet123SubNet",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.verifyHostingEnvironmentVnet(parameters);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
verifyHostingEnvironmentVnet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperation(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraces(resourceGroupName, name, operationId);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesV2(resourceGroupName, name, operationId);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options = { durationInSeconds };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options = {
|
||||
durationInSeconds,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options = {
|
||||
durationInSeconds,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options = {
|
||||
durationInSeconds,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopNetworkTrace(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopNetworkTraceSlot(resourceGroupName, name, slot);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopWebSiteNetworkTrace(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { WebSiteManagementClient } = require("@azure/arm-appservice-profile-2020-09-01-hybrid");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,121 @@
|
|||
# client library samples for TypeScript
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [appServicePlansCreateOrUpdateSample.ts][appserviceplanscreateorupdatesample] | Creates or updates an App Service Plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateAppServicePlan.json |
|
||||
| [appServicePlansDeleteSample.ts][appserviceplansdeletesample] | Delete an App Service plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteAppServicePlan.json |
|
||||
| [appServicePlansGetSample.ts][appserviceplansgetsample] | Get an App Service plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetAppServicePlan.json |
|
||||
| [appServicePlansListByResourceGroupSample.ts][appserviceplanslistbyresourcegroupsample] | Get all App Service plans in a resource group. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlansByResourceGroup.json |
|
||||
| [appServicePlansListSample.ts][appserviceplanslistsample] | Get all App Service plans for a subscription. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlans.json |
|
||||
| [appServicePlansUpdateSample.ts][appserviceplansupdatesample] | Creates or updates an App Service Plan. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchAppServicePlan.json |
|
||||
| [certificatesCreateOrUpdateSample.ts][certificatescreateorupdatesample] | Create or update a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateCertificate.json |
|
||||
| [certificatesDeleteSample.ts][certificatesdeletesample] | Delete a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteCertificate.json |
|
||||
| [certificatesGetSample.ts][certificatesgetsample] | Get a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetCertificate.json |
|
||||
| [certificatesListByResourceGroupSample.ts][certificateslistbyresourcegroupsample] | Get all certificates in a resource group. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificatesByResourceGroup.json |
|
||||
| [certificatesListSample.ts][certificateslistsample] | Get all certificates for a subscription. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificates.json |
|
||||
| [certificatesUpdateSample.ts][certificatesupdatesample] | Create or update a certificate. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchCertificate.json |
|
||||
| [providerListOperationsSample.ts][providerlistoperationssample] | Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListOperations.json |
|
||||
| [verifyHostingEnvironmentVnetSample.ts][verifyhostingenvironmentvnetsample] | Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/VerifyHostingEnvironmentVnet.json |
|
||||
| [webAppsGetNetworkTraceOperationSample.ts][webappsgetnetworktraceoperationsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationSlotSample.ts][webappsgetnetworktraceoperationslotsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationSlotV2Sample.ts][webappsgetnetworktraceoperationslotv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTraceOperationV2Sample.ts][webappsgetnetworktraceoperationv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsGetNetworkTracesSample.ts][webappsgetnetworktracessample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesSlotSample.ts][webappsgetnetworktracesslotsample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesSlotV2Sample.ts][webappsgetnetworktracesslotv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsGetNetworkTracesV2Sample.ts][webappsgetnetworktracesv2sample] | Gets a named operation for a network trace capturing (or deployment slot, if specified). x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json |
|
||||
| [webAppsStartNetworkTraceSample.ts][webappsstartnetworktracesample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartNetworkTraceSlotSample.ts][webappsstartnetworktraceslotsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartWebSiteNetworkTraceOperationSample.ts][webappsstartwebsitenetworktraceoperationsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStartWebSiteNetworkTraceOperationSlotSample.ts][webappsstartwebsitenetworktraceoperationslotsample] | Start capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json |
|
||||
| [webAppsStopNetworkTraceSample.ts][webappsstopnetworktracesample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopNetworkTraceSlotSample.ts][webappsstopnetworktraceslotsample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopWebSiteNetworkTraceSample.ts][webappsstopwebsitenetworktracesample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
| [webAppsStopWebSiteNetworkTraceSlotSample.ts][webappsstopwebsitenetworktraceslotsample] | Stop ongoing capturing network packets for the site. x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/appServicePlansCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env APPSERVICE_SUBSCRIPTION_ID="<appservice subscription id>" APPSERVICE_RESOURCE_GROUP="<appservice resource group>" node dist/appServicePlansCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[appserviceplanscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansCreateOrUpdateSample.ts
|
||||
[appserviceplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansDeleteSample.ts
|
||||
[appserviceplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansGetSample.ts
|
||||
[appserviceplanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansListByResourceGroupSample.ts
|
||||
[appserviceplanslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansListSample.ts
|
||||
[appserviceplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/appServicePlansUpdateSample.ts
|
||||
[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesCreateOrUpdateSample.ts
|
||||
[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesDeleteSample.ts
|
||||
[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesGetSample.ts
|
||||
[certificateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesListByResourceGroupSample.ts
|
||||
[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesListSample.ts
|
||||
[certificatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/certificatesUpdateSample.ts
|
||||
[providerlistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/providerListOperationsSample.ts
|
||||
[verifyhostingenvironmentvnetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/verifyHostingEnvironmentVnetSample.ts
|
||||
[webappsgetnetworktraceoperationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTraceOperationSample.ts
|
||||
[webappsgetnetworktraceoperationslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTraceOperationSlotSample.ts
|
||||
[webappsgetnetworktraceoperationslotv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTraceOperationSlotV2Sample.ts
|
||||
[webappsgetnetworktraceoperationv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTraceOperationV2Sample.ts
|
||||
[webappsgetnetworktracessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTracesSample.ts
|
||||
[webappsgetnetworktracesslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTracesSlotSample.ts
|
||||
[webappsgetnetworktracesslotv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTracesSlotV2Sample.ts
|
||||
[webappsgetnetworktracesv2sample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsGetNetworkTracesV2Sample.ts
|
||||
[webappsstartnetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStartNetworkTraceSample.ts
|
||||
[webappsstartnetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStartNetworkTraceSlotSample.ts
|
||||
[webappsstartwebsitenetworktraceoperationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStartWebSiteNetworkTraceOperationSample.ts
|
||||
[webappsstartwebsitenetworktraceoperationslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStartWebSiteNetworkTraceOperationSlotSample.ts
|
||||
[webappsstopnetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStopNetworkTraceSample.ts
|
||||
[webappsstopnetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStopNetworkTraceSlotSample.ts
|
||||
[webappsstopwebsitenetworktracesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStopWebSiteNetworkTraceSample.ts
|
||||
[webappsstopwebsitenetworktraceslotsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/samples/v2/typescript/src/webAppsStopWebSiteNetworkTraceSlotSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appservice-profile-2020-09-01-hybrid?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-appservice-profile-2020-09-01-hybrid-ts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/appservice/arm-appservice-profile-2020-09-01-hybrid"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appservice/arm-appservice-profile-2020-09-01-hybrid",
|
||||
"dependencies": {
|
||||
"@azure/arm-appservice-profile-2020-09-01-hybrid": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.0",
|
||||
"typescript": "~4.8.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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 {
|
||||
AppServicePlan,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateAppServicePlan.json
|
||||
*/
|
||||
async function createOrUpdateAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan: AppServicePlan = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app",
|
||||
location: "East US",
|
||||
sku: { name: "P1", capacity: 1, family: "P", size: "P1", tier: "Premium" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
appServicePlan
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete an App Service plan.
|
||||
*
|
||||
* @summary Delete an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteAppServicePlan.json
|
||||
*/
|
||||
async function deleteAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get an App Service plan.
|
||||
*
|
||||
* @summary Get an App Service plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetAppServicePlan.json
|
||||
*/
|
||||
async function getAppServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAppServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans in a resource group.
|
||||
*
|
||||
* @summary Get all App Service plans in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlansByResourceGroup.json
|
||||
*/
|
||||
async function listAppServicePlansByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlansByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all App Service plans for a subscription.
|
||||
*
|
||||
* @summary Get all App Service plans for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListAppServicePlans.json
|
||||
*/
|
||||
async function listAppServicePlans() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.appServicePlans.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAppServicePlans();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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 {
|
||||
AppServicePlanPatchResource,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an App Service Plan.
|
||||
*
|
||||
* @summary Creates or updates an App Service Plan.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchAppServicePlan.json
|
||||
*/
|
||||
async function patchServicePlan() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testsf6141";
|
||||
const appServicePlan: AppServicePlanPatchResource = {
|
||||
name: "testsf6141",
|
||||
type: "Microsoft.Web/serverfarms",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/testsf6141",
|
||||
kind: "app"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.appServicePlans.update(
|
||||
resourceGroupName,
|
||||
name,
|
||||
appServicePlan
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchServicePlan();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
Certificate,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/CreateOrUpdateCertificate.json
|
||||
*/
|
||||
async function createOrUpdateCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope: Certificate = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
expirationDate: new Date("2039-12-31T23:59:59+00:00"),
|
||||
friendlyName: "",
|
||||
hostNames: ["ServerCert"],
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
issueDate: new Date("2015-11-12T23:40:25+00:00"),
|
||||
issuer: "CACert",
|
||||
location: "East US",
|
||||
password: "<password>",
|
||||
subjectName: "ServerCert",
|
||||
thumbprint: "FE703D7411A44163B6D32B3AD9B03E175886EBFE"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.createOrUpdate(
|
||||
resourceGroupName,
|
||||
name,
|
||||
certificateEnvelope
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createOrUpdateCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a certificate.
|
||||
*
|
||||
* @summary Delete a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/DeleteCertificate.json
|
||||
*/
|
||||
async function deleteCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.delete(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate.
|
||||
*
|
||||
* @summary Get a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetCertificate.json
|
||||
*/
|
||||
async function getCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates in a resource group.
|
||||
*
|
||||
* @summary Get all certificates in a resource group.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificatesByResourceGroup.json
|
||||
*/
|
||||
async function listCertificatesByResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all certificates for a subscription.
|
||||
*
|
||||
* @summary Get all certificates for a subscription.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListCertificates.json
|
||||
*/
|
||||
async function listCertificatesForSubscription() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listCertificatesForSubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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 {
|
||||
CertificatePatchResource,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a certificate.
|
||||
*
|
||||
* @summary Create or update a certificate.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/PatchCertificate.json
|
||||
*/
|
||||
async function patchCertificate() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "testc6282";
|
||||
const certificateEnvelope: CertificatePatchResource = {
|
||||
name: "testc6282",
|
||||
type: "Microsoft.Web/certificates",
|
||||
id:
|
||||
"/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
|
||||
password: "<password>"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.update(
|
||||
resourceGroupName,
|
||||
name,
|
||||
certificateEnvelope
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
patchCertificate();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
*
|
||||
* @summary Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/ListOperations.json
|
||||
*/
|
||||
async function listOperations() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.provider.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listOperations();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 {
|
||||
VnetParameters,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
*
|
||||
* @summary Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/VerifyHostingEnvironmentVnet.json
|
||||
*/
|
||||
async function verifyHostingEnvironmentVnet() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const parameters: VnetParameters = {
|
||||
vnetName: "vNet123",
|
||||
vnetResourceGroup: "vNet123rg",
|
||||
vnetSubnetName: "vNet123SubNet"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.verifyHostingEnvironmentVnet(parameters);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
verifyHostingEnvironmentVnet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperation(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function getTheCurrentStatusOfANetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraceOperationV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getTheCurrentStatusOfANetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTraces(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlot(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const slot = "Production";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesSlotV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId,
|
||||
slot
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
*
|
||||
* @summary Gets a named operation for a network trace capturing (or deployment slot, if specified).
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/GetWebSiteNetworkTraces.json
|
||||
*/
|
||||
async function getNetworkTracesForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const operationId = "c291433b-53ad-4c49-8cae-0a293eae1c6d";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.getNetworkTracesV2(
|
||||
resourceGroupName,
|
||||
name,
|
||||
operationId
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkTracesForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartNetworkTraceOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options: WebAppsStartNetworkTraceOptionalParams = { durationInSeconds };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartNetworkTraceSlotOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options: WebAppsStartNetworkTraceSlotOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartNetworkTraceSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartWebSiteNetworkTraceOperationOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const options: WebAppsStartWebSiteNetworkTraceOperationOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 {
|
||||
WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams,
|
||||
WebSiteManagementClient
|
||||
} from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Start capturing network packets for the site.
|
||||
*
|
||||
* @summary Start capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StartWebSiteNetworkTraceOperation.json
|
||||
*/
|
||||
async function startANewNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const durationInSeconds = 60;
|
||||
const slot = "Production";
|
||||
const options: WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams = {
|
||||
durationInSeconds
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.beginStartWebSiteNetworkTraceOperationSlotAndWait(
|
||||
resourceGroupName,
|
||||
name,
|
||||
slot,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
startANewNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { WebSiteManagementClient } from "@azure/arm-appservice-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Stop ongoing capturing network packets for the site.
|
||||
*
|
||||
* @summary Stop ongoing capturing network packets for the site.
|
||||
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2018-02-01/examples/StopWebSiteNetworkTrace.json
|
||||
*/
|
||||
async function stopACurrentlyRunningNetworkTraceOperationForASite() {
|
||||
const subscriptionId =
|
||||
process.env["APPSERVICE_SUBSCRIPTION_ID"] ||
|
||||
"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
||||
const resourceGroupName =
|
||||
process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
|
||||
const name = "SampleApp";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new WebSiteManagementClient(credential, subscriptionId);
|
||||
const result = await client.webApps.stopNetworkTrace(resourceGroupName, name);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
stopACurrentlyRunningNetworkTraceOperationForASite();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче