Giter VIP home page Giter VIP logo

marketing-movie's Introduction

Movie Reviews with Free Azure Credits

Use your free Azure credits to create a movie review app!

So what are you waiting for - get some free Azure now!

Have Azure Credits? Let's Increase Our Free Time!

When you're handed a bunch of free credits for various services on Azure, you can do one of three things.

  1. Create a world changing app.
  2. Create an app that will make you billions of dollars.
  3. Create something that will increase your free time.

And let's face it - there's no time like free time ... so let's create a movie review app that will make sure we never have to see a bad movie again! (Because who has time to have a bad time at the old cineplex?)

Ok ... so this is how we're going to set it all up.

  • We're going to have an Azure Cosmos DB backend that stores movie reviews for us.
  • Going to display those movie reviews with a Xamarin.Forms app - accessing the Azure Cosmos DB through a .NET SDK.
  • But... we're only going to display some of those reviews to the general public - other, more premium reviews, are going to be witheld for only those people logged in via Azure AD B2C!
  • Then we'll have an Azure Function that will get invoked via a web call. This function checks to see whether or not a user has been authenticated via Azure AD B2C, and then returns the appropriate permissions.

Azure Cosmos DB

The first thing that you'll need to do is create an Azure Cosmos DB. Follow the directions here in order to create a SQL API version.

Create a database named: movies-and-reviews

Then create a collection named: movies

And another named reviews. When creating the reviews collection, set a partition key to be \isPremium.

Then go ahead and populate some data into each.

The movie records should look like:

{
    "id": "7e457301-e889-43c7-b035-ee738905e400",
    "movieName": "Venom",
    "releaseDate": "5-OCT-2018",
    "_rid": "vcYgAM45eqYBAAAAAAAAAA==",
    "_self": "dbs/vcYgAA==/colls/vcYgAM45eqY=/docs/vcYgAM45eqYBAAAAAAAAAA==/",
    "_etag": "\"04002f7a-0000-0800-0000-5bc110030000\"",
    "_attachments": "attachments/",
    "_ts": 1539379203
}

And the review records should look like:

{
    "id": "bd84ed9e-b0ec-49d9-bffd-5f208967df07",
    "movieId": "b404bb8f-f9c9-4389-9fa6-26aca20104fe",
    "isPremium": true,
    "reviewText": "Good stuff",
    "reviewDate": "12-OCT-2018",
    "_rid": "vcYgAK6T9FoBAAAAAAAACA==",
    "_self": "dbs/vcYgAA==/colls/vcYgAK6T9Fo=/docs/vcYgAK6T9FoBAAAAAAAACA==/",
    "_etag": "\"220002ec-0000-0800-0000-5bc117d80000\"",
    "_attachments": "attachments/",
    "_ts": 1539381208
}

Xamarin.Forms

The next thing you want to do is create a Xamarin.Forms app. Lucky you I've done all the hard work and put it into the /src directory of this repo.

One thing that I do want to call out is that the app is accessing Azure Cosmos DB directly via an SDK. Which is awesome! It doesn't need the app to go through another webservice of any type of talk to the database.

Azure AD B2C

Azure Active Directory Business 2 Consumer. Whew! This is what is going to let you have users create accounts and log in. I'm not going to kid you - there's a LOT to this.

Check out the docs here.

Check out an ELEVEN PART BLOG SERIES I wrote on B2C and mobile apps here.

Azure Functions

Then there's the Azure Functions.

There's super coolness going on here.

First off the function is invoked via an HTTP trigger. In other words - it runs in response to a web call.

Secondly - it's BOUND to Azure Cosmos DB ... wait wha?? What does that mean?

It means the Function news up it's own connection to Azure Cosmos DB and takes care of maintaining the connection. We - the developers - don't have to worry about it at all.

Crazy town ... I know.

Summing It Up

So there you have it - a quick explanation of mashing 3 different Azure services together to make a movie review app with premium reviews ... and wrapping it up in a pretty bow with Xamarin.Forms. Any questions or comments - please reach out to me on Twitter at @codemillmatt

marketing-movie's People

Contributors

codemillmatt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.