简体   繁体   English

Azure Web应用程序Kudu配置

[英]Azure Web app Kudu configuration

Does anyone have an example of customising kudu to run npm, bower and typescript compile gulp/grunt scripts as part of the CI process, for an asp.Net app? 有没有人有一个自定义kudu的例子来运行npm,bower和typescript编译gulp / grunt脚本作为CI过程的一部分,用于asp.Net应用程序?

I have a webslot which has a deployment source configured of a branch of my repo. 我有一个webslot,其部署源配置为我的仓库的一个分支。 On pushing to the repo the webslot syncs. 在推送回购时,webslot同步。 I tried customising a deploy.cmd to run but i got errors based on the version of npm/node i had installed. 我尝试自定义deploy.cmd来运行但是我根据我安装的npm / node版本出错了。

Is there another way to force the version of npm/node being run in a web slot for an asp.net site? 是否有另一种方法可以强制在asp.net网站的Web插槽中运行npm / node的版本? I've tried Specifying these app settings, 我试过指定这些应用设置,

WEBSITE_NODE_DEFAULT_VERSION = 4.4.3
WEBSITE_NPM_DEFAULT_VERSION = 3.8.9

but running npm -v gives me 1.1.37 但是运行npm -v给了我1.1.37

and running node -v gives me v0.10.28 and the following error 并运行node -v给我v0.10.28和以下错误

Window title cannot be longer than 1023 characters.
At line:1 char:1
+ node -v
+ ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : Argument

running npm install in the d:\\home\\site\\wwwroot also fails 在d:\\ home \\ site \\ wwwroot中运行npm install也会失败

PS D:\home\site\wwwroot> npm install
npm WARN package.json basrat.org@1.0.0 No README.md file found!
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp-debug
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/gulp-typescript
npm http GET https://registry.npmjs.org/gulp-debug
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-typescript
npm http GET https://registry.npmjs.org/gulp-rimraf
npm http GET https://registry.npmjs.org/gulp-debug
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR!     at ClientRequest.<anonymous> (D:\Program Files (x86)\nodejs\node_modules\npm\node_modules\request\main.js:440:26)
npm ERR!     at ClientRequest.g (events.js:156:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.parserOnIncomingClient (http.js:1256:7)
npm ERR!     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)
npm ERR!     at CleartextStream.socketOnData (http.js:1288:20)
npm ERR!     at CleartextStream._push (tls.js:375:27)
npm ERR!     at SecurePair.cycle (tls.js:734:20)
npm ERR!     at EncryptedStream.write (tls.js:130:13)
npm ERR!     at Socket.ondata (stream.js:38:26)
npm ERR!  [Error: SSL Error: CERT_UNTRUSTED]
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\Program Files (x86)\\nodejs\\\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! message SSL Error: CERT_UNTRUSTED
npm http GET https://registry.npmjs.org/gulp-bower
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/gulp-sourcemaps
npm http GET https://registry.npmjs.org/gulp-inject
npm http GET https://registry.npmjs.org/gulp-tslint
npm http GET https://registry.npmjs.org/typings
npm http GET https://registry.npmjs.org/gulp-typescript

Should i be running all manipulation commands/scripts within the repositry folder? 我应该在repositry文件夹中运行所有操作命令/脚本吗? and then copying all to the wwwroot folder? 然后将所有内容复制到wwwroot文件夹?

For the 'CERT_UNTRUSTED' error, you can bypass https using following cmd: 对于“CERT_UNTRUSTED”错误,您可以使用以下cmd绕过https:

npm config set strict-ssl false

or execute this: 或执行此:

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';

It seems that Azure Web Apps runtime do not have the nodejs version 4.4.3 , you login the Kudu console site of your application, at the URL of https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole , and change directory to D:\\Program Files (x86)\\nodejs> , you can find all the available nodejs version list. Azure Web Apps运行时似乎没有nodejs版本4.4.3 ,您登录应用程序的Kudu控制台站点,URL为https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole ,并更改目录到D:\\Program Files (x86)\\nodejs> ,你可以找到所有可用的nodejs版本列表。

Here is the folder list: 这是文件夹列表:

Mode                LastWriteTime     Length Name                              
----                -------------     ------ ----                              
d----         4/17/2016   4:06 AM            0.10.18                           
d----         4/17/2016   4:06 AM            0.10.21                           
d----         4/17/2016   4:06 AM            0.10.24                           
d----         4/17/2016   4:05 AM            0.10.26                           
d----         4/17/2016   4:05 AM            0.10.28                           
d----         4/17/2016   4:05 AM            0.10.29                           
d----         4/17/2016   4:05 AM            0.10.31                           
d----         4/17/2016   4:05 AM            0.10.32                           
d----         4/17/2016   4:04 AM            0.10.40                           
d----         4/17/2016   3:49 AM            0.10.5                            
d----         4/17/2016   4:04 AM            0.12.0                            
d----         4/17/2016   4:04 AM            0.12.2                            
d----         4/17/2016   4:04 AM            0.12.3                            
d----         4/17/2016   4:04 AM            0.12.6                            
d----         4/17/2016   4:07 AM            0.6.20                            
d----         4/17/2016   4:08 AM            0.8.19                            
d----         4/17/2016   4:07 AM            0.8.2                             
d----         4/17/2016   4:06 AM            0.8.26                            
d----         4/17/2016   4:06 AM            0.8.27                            
d----         4/17/2016   4:06 AM            0.8.28                            
d----         4/17/2016   4:04 AM            4.0.0                             
d----         4/17/2016   4:04 AM            4.1.0                             
d----         4/17/2016   4:04 AM            4.1.2                             
d----         4/17/2016   4:04 AM            4.2.1                             
d----         4/17/2016   4:04 AM            4.2.2                             
d----         4/17/2016   4:04 AM            4.2.3                             
d----         4/17/2016   4:04 AM            4.2.4                             
d----         4/17/2016   4:04 AM            4.3.0                             
d----         4/17/2016   4:04 AM            4.3.2                             
d----         4/17/2016   4:04 AM            4.4.0                             
d----         4/17/2016   4:04 AM            4.4.1                             
d----         4/17/2016   4:03 AM            5.0.0                             
d----         4/17/2016   4:03 AM            5.1.1                             
d----         4/17/2016   4:03 AM            5.3.0                             
d----         4/17/2016   4:03 AM            5.4.0                             
d----         4/17/2016   4:03 AM            5.5.0                             
d----         4/17/2016   4:03 AM            5.6.0                             
d----         4/17/2016   4:03 AM            5.7.0                             
d----         4/17/2016   4:03 AM            5.7.1                             
d----         4/17/2016   4:03 AM            5.8.0                             
d----         4/17/2016   4:02 AM            5.9.1                             
d----         4/29/2016   7:46 PM            6.0.0

Please try to modify the App Setting WEBSITE_NODE_DEFAULT_VERSION to an available version above. 请尝试将应用程序设置WEBSITE_NODE_DEFAULT_VERSION修改为上面的可用版本。

Any further concern, please free feel to let me know. 任何进一步的关注,请随意让我知道。

您可以创建自定义部署脚本以下载所需的任何工具,并调用它们以您希望的方式部署站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM