0

I'm trying to get my .Net Core Web API Solution deployed to Elastic Beanstalk via CLI and I'm running into an issue. I am able to publish my project without errors and deploy the application successfully. My problem is that when I access the URL, I'm still seeing the Sample App.

Is there a config change that I can make to my app, or the web.config, or in Elastic Beanstalk that I should change to get my Web API deployed?

publish command

dotnet publish My.WebAPI/My.WebAPI.csproj --runtime win10-x64 --output my-api

web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\MyWebAPI.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>

aws-windows-deployment-manifest.json

{
    "manifestVersion": 1,
    "deployments": {
        "aspNetCoreWeb": [
        {
            "name": "my-webapi",
            "parameters": {
                "appBundle": ".",
                "iisPath": "/",
                "iisWebSite": "Default Web Site"
            }
        }
        ]
    }
}
2
  • How did you solve your problem? Commented Aug 23, 2019 at 17:06
  • @dyesdyes I answered below. I was a problem with our I was creating the zip file for deployment Commented Aug 24, 2019 at 14:11

1 Answer 1

3

The solution was to fix the way I was zipping the publish content. My Jenkins deployment script is generating a custom zip. I was zipping the compiled code into a subdirectory, so my deployments were failing. I updated our zip command to flatten the archive, so all deployment files are in a flat file.

Per AWS Documentation: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html (Relevant passage below)

When you use the AWS Elastic Beanstalk console to deploy a new application or an application version, you'll need to upload a source bundle. Your source bundle must meet the following requirements:

  • Consist of a single ZIP file or WAR file (you can include multiple WAR files inside your ZIP file)
  • Not exceed 512 MB
  • Not include a parent folder or top-level directory (subdirectories are fine)
Sign up to request clarification or add additional context in comments.

1 Comment

Exactly. Managed to make it work to thanks to this link : docs.aws.amazon.com/elasticbeanstalk/latest/dg/… Feel free to add it to your answer. Note that the hidden files are also important.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.