I'm trying to set up an asp.net core 3.1 website on Amazon AWS Beanstalk using the AWS Toolkit for Visual Studio 2022, I have added the .ebextensions folder and inside my config file

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

I have also tried other StackOverflow answers like Access to the path 'C:\inetpub\wwwroot\App_Data\TEMP\PluginCache' is denied. Amazon AWS Beanstalk and How To Set Folder Permissions in Elastic Beanstalk Using YAML File? but no luck

my project folder structure is

enter image description here

could anyone please help and point out what is wrong? thank you in advance.

1

There are 1 answers

0
Nandkishor Yadav On

Got it working, writing the answer if it helps someone.

Container commands are run from the staging directory, where your source code is extracted prior to being deployed to the application server. Any changes you make to your source code in the staging directory with a container command will be included when the source is deployed to its final location.

When these config commands are run, the only folder present is C:/inetpub/AspNetCoreWebApps, that is why your command does not work, detailed information is here

The correct command will be

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