本文介绍了AWS EBS的ASP.Net Core-写入权限和.ebextensions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经在AWS EBS上部署了ASP.Net Core应用,并且在其上写入文件时遇到了问题.

We have deployed ASP.Net Core app on AWS EBS and have problem with writing files on it.

我添加了 .ebextensions \ [app_name] .config ,但没有执行任何操作

I added .ebextensions\[app_name].config but it did nothing

{
    "container_commands": {
        "01": {
            "command": "icacls \"C:/inetpub/AspNetCoreWebApps/app/App_Data\" /grant DefaultAppPool:(OI)(CI)"
        }
    }
}

我知道这是权限问题,因为当我RDP到计算机并手动更改权限时,它解决了问题.我想在部署期间使用 .ebextensions \ [app_name] .config

I know that this is permission problem because when I RDP to machine and changed permission manually it solved problem. I would like to it during deploy using .ebextensions\[app_name].config

推荐答案

.ebextensions \ [app_name] .config 在重新创建部署之前和部署文件夹期间运行-这是为什么它不起作用的原因.我通过将 postInstall Power Shell脚本添加到 aws-windows-deployment-manifest.json 中来解决此问题:

.ebextensions\[app_name].config run before deploy and during deploy folder was recreated - that why it was not working. I fixed it by adding postInstall Power Shell script into aws-windows-deployment-manifest.json:

"scripts": {
      "postInstall": {
        "file": "SetupScripts/PostInstallSetup.ps1"
      }

这篇关于AWS EBS的ASP.Net Core-写入权限和.ebextensions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 02:57