未显示Azure Web App/虚拟目录上的节点应用程序 [英] Node application on Azure Web App / Virtual Directory is not shown

查看:113
本文介绍了未显示Azure Web App/虚拟目录上的节点应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到了一篇文章,但没有一篇与当前的Azure Web App配置选项匹配.我想新版本中发生了一些变化.我正在尝试通过带有Linux App Service Plan的Azure Web App托管Node应用程序.

I have already found an article, but none that matches the current Azure Web App configuration option. I guess something has changed in the new version. I am trying to host an Node application via Azure Web App with Linux App Service Plan.

我的问题是,我的节点应用程序的内容未显示.仅显示"Azure启动"页面.我猜找不到完全存在于 site/wwwroot 中的内容.因此,我想配置虚拟目录.此选项在我的Azure门户中不再可见吗?

My problem is, my content of the node application is not displayed. Only the Azure Startup page is displayed. I guess the content can't be found which is completely present in site/wwwroot. Therefore I wanted to configure the virtual directory. This option is no longer visible in my Azure Portal?

然后,我通过Azure ARM模板自动化了部署,并在其中添加了虚拟目录.部署运行没有问题.通过Azure门户生成的模板中也可以看到该配置,但是在上面的屏幕快照中看不到该配置.

Then I automated my deployment via Azure ARM Templates and added my virtual directory there. The deployment runs without problems. The configuration is also visible in the template generated via the Azure Portal, but cannot be seen in the screenshot above.

        {
        "type": "Microsoft.Web/sites",
        "apiVersion": "2018-11-01",
        "name": "[parameters('sites__name')]",
        "location": "West Europe",
        "dependsOn": [
            "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_asp_name'))]"
        ],
        "kind": "app,linux",
        "properties": {
            "enabled": true,
            "hostNameSslStates": [
                {
                    "name": "[concat(parameters('sites_name'), '.azurewebsites.net')]",
                    "sslState": "Disabled",
                    "hostType": "Standard"
                },
                {
                    "name": "[concat(parameters('sites_name'), '.scm.azurewebsites.net')]",
                    "sslState": "Disabled",
                    "hostType": "Repository"
                }
            ],
            "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_asp_name'))]",
            "reserved": true,
            "isXenon": false,
            "hyperV": false,
            "siteConfig": {},
            "scmSiteAlsoStopped": false,
            "clientAffinityEnabled": true,
            "clientCertEnabled": false,
            "hostNamesDisabled": false,
            "containerSize": 0,
            "dailyMemoryTimeQuota": 0,
            "httpsOnly": true,
            "redundancyMode": "None"
        }
    },
    {
        "type": "Microsoft.Web/sites/config",
        "apiVersion": "2018-11-01",
        "name": "[concat(parameters('sites_name'), '/web')]",
        "location": "West Europe",
        "dependsOn": [
            "[resourceId('Microsoft.Web/sites', parameters('sites_name'))]"
        ],
        "properties": {
            "numberOfWorkers": 1,
            "defaultDocuments": [
                "Default.htm",
                "Default.html",
                "Default.asp",
                "index.htm",
                "index.html",
                "iisstart.htm",
                "default.aspx",
                "index.php",
                "hostingstart.html"
            ],
            "netFrameworkVersion": "v4.0",
            "linuxFxVersion": "NODE|12-lts",
            "requestTracingEnabled": false,
            "remoteDebuggingEnabled": false,
            "remoteDebuggingVersion": "VS2019",
            "httpLoggingEnabled": false,
            "logsDirectorySizeLimit": 35,
            "detailedErrorLoggingEnabled": false,
            "publishingUsername": "$myuser",
            "scmType": "VSTSRM",
            "use32BitWorkerProcess": true,
            "webSocketsEnabled": false,
            "alwaysOn": false,
            "managedPipelineMode": "Integrated",
            "virtualApplications": [
                {
                    "virtualPath": "/",
                    "physicalPath": "site\\wwwroot",
                    "preloadEnabled": false
                }
            ],
            "loadBalancing": "LeastRequests",
            "experiments": {
                "rampUpRules": []
            },
            "autoHealEnabled": false,
            "localMySqlEnabled": false,
            "ipSecurityRestrictions": [
                {
                    "ipAddress": "Any",
                    "action": "Allow",
                    "priority": 1,
                    "name": "Allow all",
                    "description": "Allow all access"
                }
            ],
            "scmIpSecurityRestrictions": [
                {
                    "ipAddress": "Any",
                    "action": "Allow",
                    "priority": 1,
                    "name": "Allow all",
                    "description": "Allow all access"
                }
            ],
            "scmIpSecurityRestrictionsUseMain": false,
            "http20Enabled": false,
            "minTlsVersion": "1.2",
            "ftpsState": "AllAllowed",
            "reservedInstanceCount": 0
        }
    },

我通过Kudu检查了Azure Web App,index.html之类的文件位于 site/wwwroot 中. Azure Web App的基本目录为/home ,内部目录为 site/wwwroot .如何配置虚拟目录?我的错在哪里?

I checked the Azure Web App via Kudu, the files like index.html are present in site/wwwroot. The Azure Web App has as base directory /home, inside is site/wwwroot. How can I configure the Virtual Directory? Where is my fault?

非常感谢.

推荐答案

在Linux App Service上配置虚拟目录的方法与在Windows App Service中配置虚拟目录的方法不同.

Configuration of virtual directories on Linux App Service isn't done the same way as it is on Windows App Service.

Windows App Service的虚拟目录配置直接映射到IIS的虚拟目录功能,因为该平台上的所有网站都由IIS托管.在Linux App Service上,您可以自由使用所需的任何Web服务器技术,并根据需要进行配置.

The Virtual Directory configuration for Windows App Service maps directly to IIS' virtual directories feature, as all websites on that platform are hosted by IIS. On Linux App Service, you are free to use whatever web server technology you like and configure it however you want.

目前,实现此目的最简单的方法是使用所需的设置对应用程序进行容器化,或者派生我们现有的内置容器之一.

For now, the easiest way to implement this is to containerize your application with the settings you want, or fork one of our existing built-in containers.

您可以为容器化的应用添加自定义存储.容器化的应用程序包括所有Linux应用程序,以及在App Service上运行的Windows和Linux自定义容器.

You can add custom storage for your containerized app. Containerized apps include all Linux apps and also the Windows and Linux custom containers running on App Service.

有关更多详细信息,您可以参考此

For more details, you could refer to this article.

这篇关于未显示Azure Web App/虚拟目录上的节点应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆