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

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

问题描述

我已经找到一篇文章,但没有一篇与当前 Azure Web App 配置选项匹配.我想新版本中发生了一些变化.我正在尝试通过带有 Linux 应用服务计划的 Azure Web 应用托管 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 应用服务上配置虚拟目录的方式与在 Windows 应用服务上不同.

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

Windows 应用服务的虚拟目录配置直接映射到 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 应用以及在应用服务上运行的 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 应用程序/虚拟目录上的节点应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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