Azure 深入浅出[2] --- App Service的部署并查看应用Log

news2025/1/9 3:21:27

假设读者已经申请了Azure的免费订阅的账户。如果想部署一个前端NodeJS的服务到Azure的App Service应该如何部署并查看应用程序本身的日志呢?笔者在这边文章就带大家快速看一下。

1.环境准备

安装Visual Studio Code以及在Visual Studio Code里面安装Azure App Service插件。
在这里插入图片描述

2.新建一个NodeJS的项目

新建一个NodeJs的项目,其目录结果如下
在这里插入图片描述
2.1 app.js

var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', indexRouter);
app.use('/users', usersRouter);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  next(createError(404));
});

// error handler
app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};

  // render the error page
  res.status(err.status || 500);
  res.render('error');
});

module.exports = app;

2.2 package.json

{
  "name": "myexpressapp",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "cookie-parser": "~1.4.4",
    "debug": "~2.6.9",
    "ejs": "~2.6.1",
    "express": "~4.16.1",
    "http-errors": "~1.6.3",
    "morgan": "~1.9.1"
  }
}

2.3 index.ejs

<!DOCTYPE html>
<html>
  <head>
    <title>Welcome to Azure 1111</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <h1><%= title %></h1>
    <p>Welcome to <%= title %></p>
  </body>
</html>

2.4 index.js

var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

module.exports = router;

3.登录并发布应用到AppService

打开Azure App Service的插件,并选择你的应用,并点击右键进行部署。
在这里插入图片描述

4.发布成功后,查看App Service的应用

打开浏览器,就可以看到你在Azure的App Service发布的App的了
https://xxxxx-yyyyy-nn.azurewebsites.net/
在这里插入图片描述

如果用azure CLI执行同样的部署,则部署命令如下:

SUBSCRIPTION="免费试用"
RESOURCEGROUP="xxxxxx-rg"
LOCATION="eastus"
PLANNAME="xxxxxx-plan"
PLANSKU="F1"
SITENAME="xxxxxx
RUNTIME="NODE|18-lts"

# login supports device login, username/password, and service principals
# see https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest#az_login
az login
# list all of the available subscriptions
az account list -o table
# set the default subscription for subsequent operations
az account set --subscription $SUBSCRIPTION
# create a resource group for your application
az group create --name $RESOURCEGROUP --location $LOCATION
# create an appservice plan (a machine) where your site will run
az appservice plan create --name $PLANNAME --location $LOCATION --is-linux --sku $PLANSKU --resource-group $RESOURCEGROUP
# create the web application on the plan
# specify the node version your app requires
az webapp create --name $SITENAME --plan $PLANNAME --runtime $RUNTIME --resource-group $RESOURCEGROUP

# To set up deployment from a local git repository, uncomment the following commands.
# first, set the username and password (use environment variables!)
# USERNAME=""
# PASSWORD=""
# az webapp deployment user set --user-name $USERNAME --password $PASSWORD

# now, configure the site for deployment. in this case, we will deploy from the local git repository
# you can also configure your site to be deployed from a remote git repository or set up a CI/CD workflow
# az webapp deployment source config-local-git --name $SITENAME --resource-group $RESOURCEGROUP

# the previous command returned the git remote to deploy to
# use this to set up a new remote named "azure"
# git remote add azure "https://$USERNAME@$SITENAME.scm.azurewebsites.net/$SITENAME.git"
# push master to deploy the site
# git push azure master

# browse to the site
# az webapp browse --name $SITENAME --resource-group $RESOURCEGROUP

部署后,其Log如下:

23:09:20 xxxxx-01: Starting deployment...
23:09:26 xxxxx-01: Creating zip package...
23:09:29 xxxxx-01: Zip package size: 699 kB
23:09:36: Error: request to https://xxxxx-01.scm.azurewebsites.net/api/deployments/latest?deployer=Push-Deployer&time=2022-11-20_15-09-29Z failed, reason: Client network socket disconnected before secure TLS connection was established
23:11:56 xxxxx-01: Starting deployment...
23:12:03 xxxxx-01: Creating zip package...
23:12:04 xxxxx-01: Zip package size: 699 kB
23:12:09 xxxxx-01: Fetching changes.
23:12:10 xxxxx-01: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/27046216-ca9d-45e5-957c-89645f86ecda.zip (0.68 MB) to /tmp/zipdeploy/extracted
23:12:17 xxxxx-01: Updating submodules.
23:12:19 xxxxx-01: Preparing deployment for commit id '7a23d334-b'.
23:12:19 xxxxx-01: PreDeployment: context.CleanOutputPath False
23:12:19 xxxxx-01: PreDeployment: context.OutputPath /home/site/wwwroot
23:12:20 xxxxx-01: Repository path is /tmp/zipdeploy/extracted
23:12:20 xxxxx-01: Running oryx build...
23:12:20 xxxxx-01: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 18 -p virtualenv_name= --log-file /tmp/build-debug.log  -i /tmp/8dacb099e11e089 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
23:12:25 xxxxx-01: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
23:12:26 xxxxx-01: You can report issues at https://github.com/Microsoft/Oryx/issues
23:12:26 xxxxx-01: Oryx Version: 0.2.20220825.1, Commit: 24032445dbf7bf6ef068688f1b123a7144453b7f, ReleaseTagName: 20220825.1
23:12:26 xxxxx-01: Build Operation ID: |GEQyjIHtYOs=.77ba5015_
23:12:26 xxxxx-01: Repository Commit : 7a23d334-b04b-49a2-8064-033140072ee1
23:12:26 xxxxx-01: Detecting platforms...
23:12:32 xxxxx-01: Detected following platforms:
23:12:32 xxxxx-01:   nodejs: 18.12.0
23:12:33 xxxxx-01: Detected the following frameworks: Express
23:12:34 xxxxx-01: Using intermediate directory '/tmp/8dacb099e11e089'.
23:12:34 xxxxx-01: Copying files to the intermediate directory...
23:12:38 xxxxx-01: Done in 4 sec(s).
23:12:38 xxxxx-01: Source directory     : /tmp/8dacb099e11e089
23:12:38 xxxxx-01: Destination directory: /home/site/wwwroot
23:12:41 xxxxx-01: Removing existing manifest file
23:12:41 xxxxx-01: Creating directory for command manifest file if it does not exist
23:12:41 xxxxx-01: Creating a manifest file...
23:12:41 xxxxx-01: Node Build Command Manifest file created.
23:12:41 xxxxx-01: Using Node version:
23:12:44 xxxxx-01: v18.12.0
23:12:44 xxxxx-01: Using Npm version:
23:13:04 xxxxx-01: 8.19.2
23:13:04 xxxxx-01: Running 'npm install --unsafe-perm'...
23:13:07 xxxxx-01: npm WARN old lockfile 
23:13:08 xxxxx-01: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
23:13:08 xxxxx-01: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
23:13:08 xxxxx-01: npm WARN old lockfile 
23:13:08 xxxxx-01: npm WARN old lockfile This is a one-time fix-up, please be patient...
23:13:08 xxxxx-01: npm WARN old lockfile 
23:13:15 xxxxx-01: added 54 packages, and audited 55 packages in 9s
23:13:15 xxxxx-01: 1 critical severity vulnerability
23:13:15 xxxxx-01: To address all issues (including breaking changes), run:
23:13:15 xxxxx-01:   npm audit fix --force
23:13:15 xxxxx-01: Run `npm audit` for details.
23:13:15 xxxxx-01: Zipping existing node_modules folder...
23:13:16 xxxxx-01: Done in 1 sec(s).
23:13:16 xxxxx-01: Preparing output...
23:13:16 xxxxx-01: Copying files to destination directory '/home/site/wwwroot'...
23:13:16 xxxxx-01: Done in 0 sec(s).
23:13:16 xxxxx-01: Removing existing manifest file
23:13:16 xxxxx-01: Creating a manifest file...
23:13:16 xxxxx-01: Manifest file created.
23:13:16 xxxxx-01: Copying .ostype to manifest output directory.
23:13:18 xxxxx-01: Done in 42 sec(s).
23:13:21 xxxxx-01: Running post deployment command(s)...
23:13:21 xxxxx-01: Generating summary of Oryx build
23:13:21 xxxxx-01: Parsing the build logs
23:13:22 xxxxx-01: Found 0 issue(s)
23:13:22 xxxxx-01: Build Summary :
23:13:22 xxxxx-01: ===============
23:13:22 xxxxx-01: Errors (0)
23:13:23 xxxxx-01: Warnings (0)
23:13:23 xxxxx-01: Triggering recycle (preview mode disabled).
23:13:24 xxxxx-01: Deployment successful. deployer = Push-Deployer deploymentPath = ZipDeploy. Extract zip. Remote build.
23:13:54: Deployment to "xxxxx-01" completed.

5. 通过App Service Web查看App Service的部署信息

在你的App Service的域名后缀前面加上scm,比如,https://xxxxx-yyyyy-nn.azurewebsites.net/变成
https://xxxxx-yyyyy-nn.scm.azurewebsites.net/,就能看到你的App Service的部署信息了。

5.1 查看环境信息

在这里插入图片描述

5.2 查看部署log

甚至还能看到部署的信息
https://xxxxx-yyyyy-nn.scm.azurewebsites.net/deploymentlogs/

5.3 查看部署Docker log

查看Docker log
https://xxxxx-yyyyy-nn.scm.azurewebsites.net/api/logs/docker/

5.4 下载并查看部署应用的log

下载部署在App Service Docker里面的应用的log
https://xxxxx-yyyyy-nn.scm.azurewebsites.net/api/logs/docker/zip
下载下来的zip文件就包括应用的log,在第一个log的文件里面
在这里插入图片描述

2022-11-20T14:38:52.884307650Z    _____                               
2022-11-20T14:38:52.884358851Z   /  _  \ __________ _________   ____  
2022-11-20T14:38:52.884372451Z  /  /_\  \\___   /  |  \_  __ \_/ __ \ 
2022-11-20T14:38:52.884380951Z /    |    \/    /|  |  /|  | \/\  ___/ 
2022-11-20T14:38:52.884388151Z \____|__  /_____ \____/ |__|    \___  >
2022-11-20T14:38:52.884395751Z         \/      \/                  \/ 
2022-11-20T14:38:52.884402952Z A P P   S E R V I C E   O N   L I N U X
2022-11-20T14:38:52.884409952Z 
2022-11-20T14:38:52.884416552Z Documentation: http://aka.ms/webapp-linux
2022-11-20T14:38:52.884424052Z NodeJS quickstart: https://aka.ms/node-qs
2022-11-20T14:38:52.884431652Z NodeJS Version : v18.2.0
2022-11-20T14:38:52.884438852Z Note: Any data outside '/home' is not persisted
2022-11-20T14:38:52.884446252Z 
2022-11-20T14:38:55.842142606Z Starting OpenBSD Secure Shell server: sshd.
2022-11-20T14:38:56.499512442Z Starting periodic command scheduler: cron.
2022-11-20T14:38:57.796269012Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2022-11-20T14:38:57.806459278Z Build Operation ID: |ZZ0zxKBKLKw=.544f5388_
2022-11-20T14:38:57.822108134Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2022-11-20T14:38:59.415195621Z Writing output script to '/opt/startup/startup.sh'
2022-11-20T14:38:59.523408785Z Running #!/bin/sh
2022-11-20T14:38:59.523453286Z 
2022-11-20T14:38:59.523466686Z # Enter the source directory to make sure the script runs where the user expects
2022-11-20T14:38:59.523476186Z cd "/home/site/wwwroot"
2022-11-20T14:38:59.523484787Z 
2022-11-20T14:38:59.523493287Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2022-11-20T14:38:59.523502387Z if [ -z "$PORT" ]; then
2022-11-20T14:38:59.523511387Z 		export PORT=8080
2022-11-20T14:38:59.523521187Z fi
2022-11-20T14:38:59.523529687Z 
2022-11-20T14:38:59.523538387Z echo Found tar.gz based node_modules.
2022-11-20T14:38:59.523546788Z extractionCommand="tar -xzf node_modules.tar.gz -C /node_modules"
2022-11-20T14:38:59.523555288Z echo "Removing existing modules directory from root..."
2022-11-20T14:38:59.523563488Z rm -fr /node_modules
2022-11-20T14:38:59.523571688Z mkdir -p /node_modules
2022-11-20T14:38:59.523579888Z echo Extracting modules...
2022-11-20T14:38:59.523587688Z $extractionCommand
2022-11-20T14:38:59.523595988Z export NODE_PATH="/node_modules":$NODE_PATH
2022-11-20T14:38:59.523604889Z export PATH=/node_modules/.bin:$PATH
2022-11-20T14:38:59.523613689Z if [ -d node_modules ]; then
2022-11-20T14:38:59.523641489Z     mv -f node_modules _del_node_modules || true
2022-11-20T14:38:59.523651989Z fi
2022-11-20T14:38:59.523659989Z 
2022-11-20T14:38:59.523667590Z if [ -d /node_modules ]; then
2022-11-20T14:38:59.523674990Z     ln -sfn /node_modules ./node_modules 
2022-11-20T14:38:59.523682290Z fi
2022-11-20T14:38:59.523688790Z 
2022-11-20T14:38:59.523695490Z echo "Done."
2022-11-20T14:38:59.527160046Z PATH="$PATH:/home/site/wwwroot" npm start
2022-11-20T14:38:59.532954241Z Found tar.gz based node_modules.
2022-11-20T14:38:59.532985341Z Removing existing modules directory from root...
2022-11-20T14:38:59.656172850Z Extracting modules...
2022-11-20T14:39:00.589983271Z Done.
2022-11-20T14:39:09.119587808Z npm info it worked if it ends with ok
2022-11-20T14:39:09.121911935Z npm info using npm@6.14.15
2022-11-20T14:39:09.122844946Z npm info using node@v18.2.0
2022-11-20T14:39:10.545825075Z npm info lifecycle myexpressapp@0.0.0~prestart: myexpressapp@0.0.0
2022-11-20T14:39:10.603291258Z npm info lifecycle myexpressapp@0.0.0~start: myexpressapp@0.0.0
2022-11-20T14:39:10.631101589Z 
2022-11-20T14:39:10.631206990Z > myexpressapp@0.0.0 start /home/site/wwwroot
2022-11-20T14:39:10.631221590Z > node ./bin/www
2022-11-20T14:39:10.631229790Z 
2022-11-20T14:39:12.799287150Z [0mGET /robots933456.txt [33m404 [0m48.285 ms - 721[0m
2022-11-20T14:39:13.808576329Z [0mGET / [32m200 [0m40.712 ms - 221[0m
2022-11-20T14:39:13.818159043Z [0mGET / [32m200 [0m47.632 ms - 221[0m
2022-11-20T14:39:13.873227196Z [0mGET / [32m200 [0m11.500 ms - 221[0m
2022-11-20T14:39:14.343606075Z [0mGET /stylesheets/style.css [32m200 [0m52.733 ms - 111[0m
2022-11-20T14:39:14.692155408Z [0mGET /favicon.ico [33m404 [0m41.995 ms - 721[0m

2022-11-20T14:40:13.792141231Z [0mGET / [32m200 [0m98.869 ms - 221[0m
2022-11-20T14:40:14.434950924Z [0mGET /stylesheets/style.css [32m200 [0m82.386 ms - 111[0m
2022-11-20T14:40:14.883193946Z [0mGET /favicon.ico [33m404 [0m138.429 ms - 721[0m

2022-11-20T14:40:37.045537691Z [0mGET / [32m200 [0m132.349 ms - 221[0m

2022-11-20T15:00:06.024510739Z [0mGET / [36m304 [0m847.055 ms - -[0m
2022-11-20T15:00:06.574238751Z [0mGET /stylesheets/style.css [36m304 [0m219.435 ms - -[0m

2022-11-20T15:11:53.048642190Z    _____                               
2022-11-20T15:11:53.048694291Z   /  _  \ __________ _________   ____  
2022-11-20T15:11:53.049666097Z  /  /_\  \\___   /  |  \_  __ \_/ __ \ 
2022-11-20T15:11:53.049697897Z /    |    \/    /|  |  /|  | \/\  ___/ 
2022-11-20T15:11:53.049703897Z \____|__  /_____ \____/ |__|    \___  >
2022-11-20T15:11:53.049708697Z         \/      \/                  \/ 
2022-11-20T15:11:53.049712897Z A P P   S E R V I C E   O N   L I N U X
2022-11-20T15:11:53.049716997Z 
2022-11-20T15:11:53.049720897Z Documentation: http://aka.ms/webapp-linux
2022-11-20T15:11:53.049724997Z NodeJS quickstart: https://aka.ms/node-qs
2022-11-20T15:11:53.049728997Z NodeJS Version : v18.2.0
2022-11-20T15:11:53.049733097Z Note: Any data outside '/home' is not persisted
2022-11-20T15:11:53.049737197Z 
2022-11-20T15:11:55.021691922Z Starting OpenBSD Secure Shell server: sshd.
2022-11-20T15:11:55.438951249Z Starting periodic command scheduler: cron.
2022-11-20T15:11:56.363568272Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2022-11-20T15:11:56.377064257Z Build Operation ID: |8r8eAPAzaWg=.92bae762_
2022-11-20T15:11:56.391387347Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2022-11-20T15:11:57.581600238Z Writing output script to '/opt/startup/startup.sh'
2022-11-20T15:11:57.669418691Z Running #!/bin/sh
2022-11-20T15:11:57.669491891Z 
2022-11-20T15:11:57.669503592Z # Enter the source directory to make sure the script runs where the user expects
2022-11-20T15:11:57.669529492Z cd "/home/site/wwwroot"
2022-11-20T15:11:57.669537892Z 
2022-11-20T15:11:57.669545192Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2022-11-20T15:11:57.669710193Z if [ -z "$PORT" ]; then
2022-11-20T15:11:57.669973194Z 		export PORT=8080
2022-11-20T15:11:57.669991095Z fi
2022-11-20T15:11:57.670000895Z 
2022-11-20T15:11:57.670009595Z echo Found tar.gz based node_modules.
2022-11-20T15:11:57.670018395Z extractionCommand="tar -xzf node_modules.tar.gz -C /node_modules"
2022-11-20T15:11:57.670027195Z echo "Removing existing modules directory from root..."
2022-11-20T15:11:57.670035995Z rm -fr /node_modules
2022-11-20T15:11:57.670043895Z mkdir -p /node_modules
2022-11-20T15:11:57.670051595Z echo Extracting modules...
2022-11-20T15:11:57.670059795Z $extractionCommand
2022-11-20T15:11:57.670067695Z export NODE_PATH="/node_modules":$NODE_PATH
2022-11-20T15:11:57.670080295Z export PATH=/node_modules/.bin:$PATH
2022-11-20T15:11:57.670088895Z if [ -d node_modules ]; then
2022-11-20T15:11:57.670114495Z     mv -f node_modules _del_node_modules || true
2022-11-20T15:11:57.670140396Z fi
2022-11-20T15:11:57.670164696Z 
2022-11-20T15:11:57.674019820Z if [ -d /node_modules ]; then
2022-11-20T15:11:57.674038920Z     ln -sfn /node_modules ./node_modules 
2022-11-20T15:11:57.674047320Z fi
2022-11-20T15:11:57.674054320Z 
2022-11-20T15:11:57.674061220Z echo "Done."
2022-11-20T15:11:57.674073620Z PATH="$PATH:/home/site/wwwroot" npm start
2022-11-20T15:11:57.674327822Z Found tar.gz based node_modules.
2022-11-20T15:11:57.674622524Z Removing existing modules directory from root...
2022-11-20T15:11:57.796659092Z Extracting modules...
2022-11-20T15:11:58.284379911Z Done.
2022-11-20T15:12:08.957112831Z npm info it worked if it ends with ok
2022-11-20T15:12:08.958695651Z npm info using npm@6.14.15
2022-11-20T15:12:08.960154270Z npm info using node@v18.2.0
2022-11-20T15:12:11.535790412Z npm info lifecycle myexpressapp@0.0.0~prestart: myexpressapp@0.0.0
2022-11-20T15:12:11.544406123Z npm info lifecycle myexpressapp@0.0.0~start: myexpressapp@0.0.0
2022-11-20T15:12:11.570229355Z 
2022-11-20T15:12:11.570281956Z > myexpressapp@0.0.0 start /home/site/wwwroot
2022-11-20T15:12:11.570297056Z > node ./bin/www
2022-11-20T15:12:11.571325169Z 
2022-11-20T15:12:15.106281344Z ***********************************************
2022-11-20T15:12:15.106703543Z Start the applicaiton
2022-11-20T15:12:15.106742943Z ***********************************************
2022-11-20T15:12:15.264033765Z [0mGET /robots933456.txt [33m404 [0m66.465 ms - 721[0m

2022-11-20T15:13:57.063080724Z ***********************************************
2022-11-20T15:13:57.063194727Z Enter the example demo
2022-11-20T15:13:57.063213427Z ***********************************************
2022-11-20T15:13:57.193713828Z [0mGET / [32m200 [0m1778.700 ms - 227[0m

2022-11-20T15:13:41.519706220Z    _____                               
2022-11-20T15:13:41.519775121Z   /  _  \ __________ _________   ____  
2022-11-20T15:13:41.519789121Z  /  /_\  \\___   /  |  \_  __ \_/ __ \ 
2022-11-20T15:13:41.519795821Z /    |    \/    /|  |  /|  | \/\  ___/ 
2022-11-20T15:13:41.519802821Z \____|__  /_____ \____/ |__|    \___  >
2022-11-20T15:13:41.519809521Z         \/      \/                  \/ 
2022-11-20T15:13:41.519815921Z A P P   S E R V I C E   O N   L I N U X
2022-11-20T15:13:41.519822121Z 
2022-11-20T15:13:41.519828421Z Documentation: http://aka.ms/webapp-linux
2022-11-20T15:13:41.519851022Z NodeJS quickstart: https://aka.ms/node-qs
2022-11-20T15:13:41.519857522Z NodeJS Version : v18.2.0
2022-11-20T15:13:41.519863222Z Note: Any data outside '/home' is not persisted
2022-11-20T15:13:41.519868922Z 
2022-11-20T15:13:43.216105874Z Starting OpenBSD Secure Shell server: sshd.
2022-11-20T15:13:43.827622004Z Starting periodic command scheduler: cron.
2022-11-20T15:13:44.991757440Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2022-11-20T15:13:45.019955433Z Build Operation ID: |GEQyjIHtYOs=.77ba5015_
2022-11-20T15:13:45.034686238Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2022-11-20T15:13:48.756384008Z Writing output script to '/opt/startup/startup.sh'
2022-11-20T15:13:48.838144547Z Running #!/bin/sh
2022-11-20T15:13:48.838230948Z 
2022-11-20T15:13:48.838240748Z # Enter the source directory to make sure the script runs where the user expects
2022-11-20T15:13:48.838247748Z cd "/home/site/wwwroot"
2022-11-20T15:13:48.838254448Z 
2022-11-20T15:13:48.838260748Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2022-11-20T15:13:48.838267648Z if [ -z "$PORT" ]; then
2022-11-20T15:13:48.838273948Z 		export PORT=8080
2022-11-20T15:13:48.838280549Z fi
2022-11-20T15:13:48.838286849Z 
2022-11-20T15:13:48.838605553Z echo Found tar.gz based node_modules.
2022-11-20T15:13:48.838621353Z extractionCommand="tar -xzf node_modules.tar.gz -C /node_modules"
2022-11-20T15:13:48.838629553Z echo "Removing existing modules directory from root..."
2022-11-20T15:13:48.838636853Z rm -fr /node_modules
2022-11-20T15:13:48.838643954Z mkdir -p /node_modules
2022-11-20T15:13:48.838650754Z echo Extracting modules...
2022-11-20T15:13:48.838657954Z $extractionCommand
2022-11-20T15:13:48.838664554Z export NODE_PATH="/node_modules":$NODE_PATH
2022-11-20T15:13:48.838671954Z export PATH=/node_modules/.bin:$PATH
2022-11-20T15:13:48.838678554Z if [ -d node_modules ]; then
2022-11-20T15:13:48.838700454Z     mv -f node_modules _del_node_modules || true
2022-11-20T15:13:48.838708554Z fi
2022-11-20T15:13:48.838714855Z 
2022-11-20T15:13:48.838721055Z if [ -d /node_modules ]; then
2022-11-20T15:13:48.838727355Z     ln -sfn /node_modules ./node_modules 
2022-11-20T15:13:48.838732855Z fi
2022-11-20T15:13:48.838738755Z 
2022-11-20T15:13:48.838926358Z echo "Done."
2022-11-20T15:13:48.850006212Z PATH="$PATH:/home/site/wwwroot" npm start
2022-11-20T15:13:48.850091813Z Found tar.gz based node_modules.
2022-11-20T15:13:48.850109813Z Removing existing modules directory from root...
2022-11-20T15:13:49.266260410Z Extracting modules...
2022-11-20T15:13:49.829250051Z Done.
2022-11-20T15:14:05.546196172Z npm info it worked if it ends with ok
2022-11-20T15:14:05.546273773Z npm info using npm@6.14.15
2022-11-20T15:14:05.546292573Z npm info using node@v18.2.0
2022-11-20T15:14:08.417482264Z npm info lifecycle myexpressapp@0.0.0~prestart: myexpressapp@0.0.0
2022-11-20T15:14:08.448430583Z npm info lifecycle myexpressapp@0.0.0~start: myexpressapp@0.0.0
2022-11-20T15:14:08.482221213Z 
2022-11-20T15:14:08.482282213Z > myexpressapp@0.0.0 start /home/site/wwwroot
2022-11-20T15:14:08.482297613Z > node ./bin/www
2022-11-20T15:14:08.482306713Z 
2022-11-20T15:14:10.622264949Z ***********************************************
2022-11-20T15:14:10.623912056Z Start the applicaiton
2022-11-20T15:14:10.624365057Z ***********************************************
2022-11-20T15:14:10.744351819Z [0mGET /robots933456.txt [33m404 [0m60.877 ms - 721[0m

2022-11-20T15:14:40.852039998Z ***********************************************
2022-11-20T15:14:40.852488286Z Enter the example demo
2022-11-20T15:14:40.852548584Z ***********************************************
2022-11-20T15:14:40.868456271Z [0mGET / [32m200 [0m42.645 ms - 227[0m

2022-11-20T15:14:47.356308198Z ***********************************************
2022-11-20T15:14:47.356820695Z Enter the example demo
2022-11-20T15:14:47.357968287Z ***********************************************
2022-11-20T15:14:47.379758830Z [0mGET / [32m200 [0m30.954 ms - 227[0m

2022-11-20T15:14:53.750836482Z ***********************************************
2022-11-20T15:14:53.750892082Z Enter the example demo
2022-11-20T15:14:53.750908682Z ***********************************************
2022-11-20T15:14:53.767062366Z [0mGET / [32m200 [0m34.209 ms - 227[0m

2022-11-20T15:16:56.781710282Z ***********************************************
2022-11-20T15:16:56.782437098Z Enter the example demo
2022-11-20T15:16:56.782457799Z ***********************************************
2022-11-20T15:16:56.814575134Z [0mGET / [32m200 [0m77.894 ms - 227[0m
2022-11-20T15:16:57.268719623Z [0mGET /stylesheets/style.css [36m304 [0m59.285 ms - -[0m

2022-11-20T15:17:06.703932640Z ***********************************************
2022-11-20T15:17:06.704031732Z Start the applicaiton
2022-11-20T15:17:06.730009610Z ***********************************************
2022-11-20T15:17:06.940698114Z [0mGET /user1 [33m404 [0m259.611 ms - 721[0m
2022-11-20T15:17:10.251955118Z ***********************************************
2022-11-20T15:17:10.252035719Z Start the applicaiton
2022-11-20T15:17:10.252053219Z ***********************************************
2022-11-20T15:17:10.269605536Z [0mGET /user [33m404 [0m30.908 ms - 721[0m

2022-11-20T15:17:14.608191430Z ***********************************************
2022-11-20T15:17:14.609749640Z Enter the example demo
2022-11-20T15:17:14.610023342Z ***********************************************
2022-11-20T15:17:14.625827347Z [0mGET / [36m304 [0m31.973 ms - -[0m
2022-11-20T15:17:14.976112471Z [0mGET /stylesheets/style.css [36m304 [0m6.874 ms - -[0m

5.5 下载并查看部署应用的环境变量

https://xxxxx-yyyyy-nn.scm.azurewebsites.net/env
在这里插入图片描述

5.6 下载并查看部署应用服务器的目录

https://xxxxx-yyyyy-nn.azurewebsites.net/webssh/host
在这里插入图片描述
在这里插入图片描述

6. 通过Azure Portal查看应用的Log

6.1 “Log Stream” 查看应用的Log

登录Azure 的portal,找到想要的App Service 并点击“Log Stream” 查看应用的Log
在这里插入图片描述

6.2 “Diagnostic settings ” 查看应用的Log

此外还能通过Diagnostic settings 把App Service的应用Log注入到Log Analysis workspace
在这里插入图片描述
回到Log Analytics workspace,输入下面的命令,就能看到部署在App Service里面的Log了。

AppServiceConsoleLogs

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/21734.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

文件上传漏洞 | iwebsec

文章目录靶场搭建文件上传漏洞前端JS过滤绕过文件名过滤绕过Content-Type过滤绕过文件头过滤绕过.htaccess文件上传文件截断上传条件竞争文件上传靶场搭建 参考文章https://juejin.cn/post/7068931744547733517出现个小问题&#xff0c;我的端口冲突了&#xff0c;所以换了一个…

Linux-unbuntu修改apt源

本文介绍如何将ubuntu的apt源修改为清华大学的镜像源 主要是修改/etc/apt/source.list的文件&#xff0c;并且使用sudo apt-get update来刷新源 修改apt源 unbuntu安装好之后&#xff0c;apt的源是us的&#xff0c;这样下载速度比较慢 apt源的地址放在/etc/apt/source.list中…

SpringBoot SpringBoot 开发实用篇 4 数据层解决方案 4.14 ES 索引操作

SpringBoot 【黑马程序员SpringBoot2全套视频教程&#xff0c;springboot零基础到项目实战&#xff08;spring boot2完整版&#xff09;】 SpringBoot 开发实用篇 文章目录SpringBootSpringBoot 开发实用篇4 数据层解决方案4.14 ES 索引操作4.14.1 索引操作4.14.2 小结4 数据…

m基于OFDM数字电视地面广播系统中频域同步技术研究

目录 1.算法概述 2.仿真效果预览 3.MATLAB部分代码预览 4.完整MATLAB程序 1.算法概述 OFDM技术的基本构架如下所示&#xff1a; 注意系统中的虚线部分就是你要做的OFDM的频域同步模块。我们的MATLAB代码就是参考这个系统结构进行设计的。其中虚线就是本课题要做的代码部分…

[附源码]java毕业设计停车场管理系统

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

day04 spring 声明式事务

day04 spring 声明式事务 1.JDBCTemplate 1.1 简介 为了在特定领域帮助我们简化代码&#xff0c;Spring 封装了很多 『Template』形式的模板类。例如&#xff1a;RedisTemplate、RestTemplate 等等&#xff0c;包括我们今天要学习的 JDBCTemplate。 1.2 准备工作 1.2.1 加…

Python之TCP网络编程

目录 1. python3编码转换 2. TCP网络应用程序开发 2.1 概述 2.2 开发流程 2.3 TCP客户端程序开发 2.4 TCP服务端程序开发 2.5 注意点 3. socket之send和recv原理 4. 案例 1. python3编码转换 1.网络传输是以二进制数据进行传输的。 2.数据转化用到了encode和decode函数…

ES6 入门教程 15 Proxy 15.2 Proxy 实例的方法 15.2.1 get()

ES6 入门教程 ECMAScript 6 入门 作者&#xff1a;阮一峰 本文仅用于学习记录&#xff0c;不存在任何商业用途&#xff0c;如侵删 文章目录ES6 入门教程15 Proxy15.2 Proxy 实例的方法15.2.1 get()15 Proxy 15.2 Proxy 实例的方法 拦截方法的详细介绍。 15.2.1 get() get方…

应急响应-进程排查

进程排查 进程是计算机中的程序关于某数据集合上的一次运行活动&#xff0c;是系统进行资源分配和调度的基本单位&#xff0c;是操作系统结构的基础。无论在Windows还是Linux中&#xff0c;主机在感染恶意程序后&#xff0c;恶意程序都会启动相应进程来完成恶意操作。 Window…

Android 深入理解View.post() 、Window加载View原理

文章目录背景&#xff1a;如何在onCreate()中获取View的宽高&#xff1f;View.post()原理Window加载View流程setContentView()ActivityThread#handleResumeActivity()总结扩展Window、Activity及View三者之间的关系是否可以在子线程中更新UI资料背景&#xff1a;如何在onCreate…

m认知无线电信号检测算法matlab仿真,能量检测,循环平稳检测以及自相关检测

目录 1.算法概述 2.仿真效果预览 3.MATLAB部分代码预览 4.完整MATLAB程序 1.算法概述 频谱感测是认知无线电的一项关键技术。我们将频谱感知作为一个分类问题&#xff0c;提出一种基于深度学习分类的感知方法。我们归一化接收信号功率以克服噪声功率不确定性的影响。我们使…

postgresql源码学习(49)—— MVCC⑤-cmin与cmax 同事务内的可见性判断

一、 难以理解的场景 postgresql源码学习&#xff08;十九&#xff09;—— MVCC④-可见性判断 HeapTupleSatisfiesMVCC函数_Hehuyi_In的博客-CSDN博客 在前篇的可见性判断中有个一直没想明白的问题 —— 本事务插入的数据&#xff0c;什么场景可能会出现去查询获取快照后插入…

路面坑洼检测中的视觉算法

3D道路成像和路面坑洼检测的经典工作综述。论文链接&#xff1a;https://arxiv.org/pdf/2204.13590.pdf 计算机视觉算法在3D道路成像和路面坑洼检测中的应用已有二十多年的历史。这里先介绍了用于2D和3D道路数据采集的传感系统&#xff0c;包括摄像机、激光扫描仪和微软Kinect…

汉兰达汽车发动机怠速抖动故障诊断方案设计

目录 一、课题简介 1 1.1课题基本内容 1 1.2课题解决的主要问题 1 1.3课题设计思路 1 二、毕业设计成果 2 2.1汉兰达汽车发动机怠速抖动故障现象描述 2 2.2 汉兰达汽车发动机怠速抖动故障原因分析 2 2.3汉兰达汽车发动机怠速抖动故障诊断与排除 6 2.4维修结论与建议 12 三、毕业…

java sleep yield join区别

1、sleep&#xff1a;让出CPU调度&#xff0c;Thread类的方法&#xff0c;必须带一个时间参数。会让当前线程休眠进入阻塞状态并释放CPU&#xff08;阿里面试题 Sleep释放CPU&#xff0c;wait 也会释放cpu&#xff0c;因为cpu资源太宝贵了&#xff0c;只有在线程running的时候&…

高效正则匹配工具

很多人都用过正则&#xff0c;但文章或许会给你一种全新的认识(思考) 以下内容适合高效率正则匹配&#xff08;比较适合正则匹配场景较多的情况&#xff09; 效率提升精华&#xff1a;本地缓存减少编译次数&#xff08;对effective java的思考&#xff0c;以及对数据库连接中…

Java中的装包(装箱)和拆包(装包)

装箱和拆箱 在Java的学习中&#xff0c;我们有的时候会设计装箱和拆箱的概念&#xff08;也就是常说的装包和拆包&#xff09;&#xff0c;这篇博客将详细讲解一下装箱和拆箱的概念及其用途。 装箱&#xff08;装包&#xff09;&#xff1a;将基本数据类型转换成包装类类型 拆…

websocket给指定客户端推送消息

业务场景 最近有一个业务场景是要做实时语音转义&#xff0c;考虑到实时性&#xff0c;所以决定采用websocket实现。 业务场景是A客户端(手机)进行语音转义的结果实时同步到B客户端(pc)&#xff0c;这就需要用到websocket将A转义的结果发送给服务端&#xff0c;服务端接收到A…

软件工程经济学复习题答案

1、利润 收入-成本费用 2、资产 流动资产非流动资产 3、显性成本可以用货币计量&#xff0c;是可以在会计的帐目上反映出来的 4、领取什么保险应缴纳个人所得税 商业保险 某企业一项固定资产的原价为8000 000元&#xff0c;预计使用年限为6年&#xff0c;预计净残值为5 0…

[LeetCode周赛复盘] 第 320 场周赛20221120

[LeetCode周赛复盘] 第 320 场周赛20221120 一、本周周赛总结二、 [Easy] 6241. 数组中不等三元组的数目1. 题目描述2. 思路分析3. 代码实现三、[Medium] 6242. 二叉搜索树最近节点查询1. 题目描述2. 思路分析3. 代码实现四、[Hard] 6243. 到达首都的最少油耗1. 题目描述2. 思路…