我们已经在AWS EBS上部署了ASP.Net Core应用,并且在其上写入文件时遇到了问题.
We have deployed ASP.Net Core app on AWS EBS and have problem with writing files on it.
拒绝访问路径 C:\ inetpub \ AspNetCoreWebApps \ app \ App_Data \ file.txt
我添加了 .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
发布评论