Skip to content

A ASP.NET Core 2.0 MVC App to consume ASP.NET Core 2.0 API

License

Notifications You must be signed in to change notification settings

bozhiqian/AzureApiAppClient

Repository files navigation

Author: Bozhi Qian

An ASP.NET Core MVC and Web Api Demo - Get pets grouped by owner's gender

An ASP.NET Core 2.0 MVC front-end deployed to Azure App Service.

  1. Azure DevOps bring this github repository to create a continuous integration (CI) and continuous delivery (CD) pipeline from VSTS project "pets". Each change to the GitHub repo initiates a build in VSTS, and a VSTS Release Management definition executes a deployment to Azure. http://pets-people.azurewebsites.net/
  2. This one was first time deployed from publishing directly from VS2017 to Azure App Service. http://aspnetcoremvcappdemo.azurewebsites.net/

Restful Services

  1. A json web service has been set up at the url: http://agl-developer-test.azurewebsites.net/people.json
  2. And another people api is imeplemented at http://peopleapi2017.azurewebsites.net/swagger

ASP.NET Core Middlewares to be used

Source code

Please use latest VS2017 to open solution.

Build Status from VSTS

Commit changes to GitHub and automatically deploy to Azure

Build configuration on VSTS

Screenshot of the build definition from VSTS for the "Pet" project.

Azure DevOps project

Screenshot of the Azure DevOps project

Reference:

people.json

[
  {
    "name": "Bob",
    "gender": "Male",
    "age": 23,
    "pets": [
      {
        "name": "Garfield",
        "type": "Cat"
      },
      {
        "name": "Fido",
        "type": "Dog"
      }
    ]
  },
  {
    "name": "Jennifer",
    "gender": "Female",
    "age": 18,
    "pets": [
      {
        "name": "Garfield",
        "type": "Cat"
      }
    ]
  },
  {
    "name": "Steve",
    "gender": "Male",
    "age": 45,
    "pets": null
  },
  {
    "name": "Fred",
    "gender": "Male",
    "age": 40,
    "pets": [
      {
        "name": "Tom",
        "type": "Cat"
      },
      {
        "name": "Max",
        "type": "Cat"
      },
      {
        "name": "Sam",
        "type": "Dog"
      },
      {
        "name": "Jim",
        "type": "Cat"
      }
    ]
  },
  {
    "name": "Samantha",
    "gender": "Female",
    "age": 40,
    "pets": [
      {
        "name": "Tabby",
        "type": "Cat"
      }
    ]
  },
  {
    "name": "Alice",
    "gender": "Female",
    "age": 64,
    "pets": [
      {
        "name": "Simba",
        "type": "Cat"
      },
      {
        "name": "Nemo",
        "type": "Fish"
      }
    ]
  }
]