Skip to content

Sample Azure Function App that leverages the MLB The Show public API using C#.

License

Notifications You must be signed in to change notification settings

regedit32/MLBTheShowFunctionApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MLB The Show Sample Azure Function App

This project is a demonstration on how to use a Azure Functions, written in C#, to consume an API and write the results to a database. In this solution, we're consuming the MLB The Show 22 API and using Azure Cosmos DB to store the data.

Functions

  • ProcessLiveSeriesValue: Using a timer schedule, this function will retrieve the value of the Live Series Collection by team, division, league, and total collection. The data pulled from the MLB The Show API is point-in-time data, so the goal of this function is to retrieve the collection value over time in order to do trend analysis with the data later.
  • GetLiveSeriesValue: HTTP trigger function that will return the current value of the Live Series Collection by team, division, league, and total collection.
  • InitMetadata: HTTP trigger function that will initialize a database and two containers. The LeagueMetadata container stores the league information (team names and their related division name/league name). The SeriesMetadata container stores the series names/IDs metadata from The Show API. No current use case for this other than demo purposes.

Application Settings

The following app settings need to be configured in order for the function to work. For information on configuring these settings for a local development environment, see Code and test Azure Functions locally. For information on configuring these settings in the Azure portal, see Work with application settings.

  • DatabaseName: Name of the database used to write data.
  • EndPointUri: The URI fo the Cosmos DB endpoint.
  • PrimaryKey: Key used to grant the Function access to the Cosmos DB account.

Resources

Work in progress

  • Add more tests
  • Add more logging
  • Implement Cosmos DB repository

About

Sample Azure Function App that leverages the MLB The Show public API using C#.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages