Rakesh Ravi G
Rakesh Ravi G

Reputation: 123

.Net Core Web Api deployed successfully in AWS, but URL is not working

Created a .Net Core Web App

Created a .Net Core Web App

.Net Core web application contains multiple projects, but I deployed an API project. Error : HTTP ERROR 404 No webpage was found for the web address: http://....

enter image description here

BeanStalk details are shown above.

enter image description here

Amazon S3 details are shown above. My doubt is, there have some permission issue or URL need to qualify completely for API call.

enter image description here

EC2 instance running fine.

enter image description here

launchsettings.json

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:19095",
      "sslPort": 44327
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "DATABASE_NAME": "FYP",
        "PROFILE_COLLECTION_NAME": "Profiles",
        "MAIL_COLLECTION_NAME": "Mailes",
        "INTERESTSENT_COLLECTION_NAME": "InterestSents",
        "INTERESTRECIEVED_COLLECTION_NAME": "InterestRecieveds",
        "SEEN_COLLECTION_NAME": "Seens",
        "SHORTLIST_COLLECTION_NAME": "Shortlists",
        "SKIP_COLLECTION_NAME": "Skips",
        "CHATBOT_COLLECTION_NAME": "Chatbots",
        "MEMBERSHIP_COLLECTION_NAME": "Memberships",
        "NOTIFICATION_COLLECTION_NAME": "Notifications",
        "SETTINGS_COLLECTION_NAME": "Settings",
        "SUPPORT_COLLECTION_NAME": "Supports",
        "USERACTION_COLLECTION_NAME": "UserActions",
        "USERCHAT_COLLECTION_NAME": "UserChats",
        "VERIFICATION_COLLECTION_NAME": "Verifications"
      }
    },
    "Matrimony.Api": {
      "commandName": "Project",
      "dotnetRunMessages": "true",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "DATABASE_NAME": "FYP",
        "PROFILE_COLLECTION_NAME": "Profiles",
        "MAIL_COLLECTION_NAME": "Mailes",
        "INTERESTSENT_COLLECTION_NAME": "InterestSents",
        "INTERESTRECIEVED_COLLECTION_NAME": "InterestRecieveds",
        "SEEN_COLLECTION_NAME": "Seens",
        "SHORTLIST_COLLECTION_NAME": "Shortlists",
        "SKIP_COLLECTION_NAME": "Skips",
        "CHATBOT_COLLECTION_NAME": "Chatbots",
        "MEMBERSHIP_COLLECTION_NAME": "Memberships",
        "NOTIFICATION_COLLECTION_NAME": "Notifications",
        "SETTINGS_COLLECTION_NAME": "Settings",
        "SUPPORT_COLLECTION_NAME": "Supports",
        "USERACTION_COLLECTION_NAME": "UserActions",
        "USERCHAT_COLLECTION_NAME": "UserChats",
        "VERIFICATION_COLLECTION_NAME": "Verifications"
      }
    }
  },
  "Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://+:5001"
      }
    }
  }
}

enter image description here

Upvotes: 1

Views: 632

Answers (1)

Pippolino
Pippolino

Reputation: 158

have you tried to enable any url for requests?

For example

ASPNETCORE_URLS=http://+:5001
Kestrel:EndPoints:Http:Url=http://+:5001

Here is the example on the appsettings.json file and link for resource:

{
  "Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://+:5001"
      }
    }
  }
}

Or, if you are in a docker container, you could set it as an environment variable in the Dokerfile:

ENV ASPNETCORE_URLS=http://+:5001
ENV ASPNETCORE_ENVIRONMENT=Production
ENV Kestrel:EndPoints:Http:Url=http://+:5001

Upvotes: 1

Related Questions