Socket
Socket
Sign inDemoInstall

@azure/arm-appservice

Package Overview
Dependencies
Maintainers
4
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/arm-appservice

A generated SDK for WebSiteManagementClient.


Version published
Maintainers
4
Created

What is @azure/arm-appservice?

@azure/arm-appservice is a Node.js package that provides a client library for managing Azure App Services. It allows developers to interact with Azure App Service resources, such as web apps, app service plans, and more, programmatically. This package is part of the Azure SDK for JavaScript and is used to automate and manage Azure App Service resources.

What are @azure/arm-appservice's main functionalities?

Create or Update a Web App

This feature allows you to create or update a web app in Azure App Service. The code sample demonstrates how to use the WebSiteManagementClient to create or update a web app with specific configurations.

const { WebSiteManagementClient } = require('@azure/arm-appservice');
const { DefaultAzureCredential } = require('@azure/identity');

async function createOrUpdateWebApp() {
  const credential = new DefaultAzureCredential();
  const client = new WebSiteManagementClient(credential, '<subscription-id>');
  const resourceGroupName = '<resource-group-name>';
  const appName = '<app-name>';
  const appServicePlanId = '<app-service-plan-id>';

  const webAppParams = {
    location: 'West US',
    serverFarmId: appServicePlanId,
    siteConfig: {
      appSettings: [
        { name: 'WEBSITE_NODE_DEFAULT_VERSION', value: '10.14.1' }
      ]
    }
  };

  const result = await client.webApps.createOrUpdate(resourceGroupName, appName, webAppParams);
  console.log('Web App created or updated:', result);
}

createOrUpdateWebApp().catch(console.error);

List All Web Apps

This feature allows you to list all web apps within a specific resource group. The code sample demonstrates how to use the WebSiteManagementClient to retrieve and list all web apps in a given resource group.

const { WebSiteManagementClient } = require('@azure/arm-appservice');
const { DefaultAzureCredential } = require('@azure/identity');

async function listWebApps() {
  const credential = new DefaultAzureCredential();
  const client = new WebSiteManagementClient(credential, '<subscription-id>');
  const resourceGroupName = '<resource-group-name>';

  const webApps = await client.webApps.listByResourceGroup(resourceGroupName);
  console.log('List of Web Apps:', webApps);
}

listWebApps().catch(console.error);

Delete a Web App

This feature allows you to delete a web app from Azure App Service. The code sample demonstrates how to use the WebSiteManagementClient to delete a specific web app by its name and resource group.

const { WebSiteManagementClient } = require('@azure/arm-appservice');
const { DefaultAzureCredential } = require('@azure/identity');

async function deleteWebApp() {
  const credential = new DefaultAzureCredential();
  const client = new WebSiteManagementClient(credential, '<subscription-id>');
  const resourceGroupName = '<resource-group-name>';
  const appName = '<app-name>';

  await client.webApps.deleteMethod(resourceGroupName, appName);
  console.log('Web App deleted');
}

deleteWebApp().catch(console.error);

Other packages similar to @azure/arm-appservice

Keywords

FAQs

Package last updated on 12 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc