GithubHelp home page GithubHelp logo

bmaluijb / buildingcloudnativesolutions Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 10.0 550 KB

This is the repository for the Pluralsight course: Building Cloud-Native Solutions for Azure with Visual Studio

Home Page: https://www.pluralsight.com/courses/building-cloud-native-solutions-azure-visual-studio

C# 62.84% HTML 33.86% CSS 2.65% JavaScript 0.65%
azure azure-functions cosmosdb netcore2 netstandard pluralsight containers docker docker-compose

buildingcloudnativesolutions's Introduction

NationalCookies

enter image description here

Hi!

Welcome to the GitHub repository of the nationalcookies application. This app is the demo app for the Pluralsight course Building Cloud-Native Solutions for Azure with Visual Studio.

You can download a copy of the code and follow along in the course.

You can see the end result running live here: https://www.nationalcookies.nl/

The solution consists of:

  • NationalCookies.MVC
    • This is the website for the Nationalcookies cookie store
    • Technology: ASP.NET Core MVC 2.1
  • NationalCookies.Data
    • This is a class library that contains classes to connect to the Cosmos DB database and work with cookies and orders
    • Technology:
      • Class library (.NET Standard 2.0)

There are three branches in this repo:

  • main
    • The branch that contains the MVC and Data projects. This branch is used in the module Building Azure Cosmos DB Apps with Visual Studio
  • withazurefunction
    • This branch contains an additional project with an Azure Function in it. This branch is used in the module Creating Azure Functions in Visual Studio
  • withcontainers
    • This branch contains changes to support running the application in containers. It also contains an additional Web API project. This branch is used in the module Creating Container-based Apps in Visual Studio

How to get this code working

The website needs a database to get information about cookies and read and write order information. The database that we are using is an Azure Cosmos DB. This can be one that you run with the local emulator (https://aka.ms/cosmosdb-emulator) or an Azure Cosmos DB that you run in Azure.

Once you have a Cosmos DB running, fill in the Cosmos DB connection details in the appsettings.json file of the NationalCookies.MVC project.

That's it! Now, you can run the NationalCookies.MVC project and follow along with the course.

Thanks for watching and let me know if you have any questions!

buildingcloudnativesolutions's People

Contributors

bmaluijb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

buildingcloudnativesolutions's Issues

Setup Cosmos DB

Hi Barry in the video you indicate that there is 3 branches, one for creating the cosmosDB which I can't find, I only see Master, withFunction, with asp, no branch for cosmos, can you please share instructions on how to create and populate the cosmos DBs, in order to continue with model "building-azure-cosmos-db-apps-with-visual-studio-slides"

I am using a locak CosmosDb container which I can access, and managed to create a CookiesDatabase, then I updated the appsetting in the mvc project

"CosmosDBEndpoint": "https://172.22.194.61:8081/",
"CosmosDBAccessKey": "mykey--------+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZ.....",

but did not fill the other params
Here is copy of my local cosmos and the CookiesDatabase I created
cookies_003

I fired the mvc project and ran it, I got a nice page with 1 cookie as you can notice but no collections were created was created my cosmos DB
cookies

Clicking on cookies, generates an error in the function

cookies_002

Thanks in advance

Creating Container-Based Apps - URL for the API project

Hi Barry, In home controller for the branch (withContainers), You use the following

request.RequestUri = new Uri("http://nationalcookies.api/api/values/");
whereas in the properties page of the API project it runs on
http://localhost:61157

how it can magically, the mvc communicate with this url (no DNS entrey, not host file........) run as you indicated? is it a url that needs to be configured somewhere? when I hit F5, I have the normal mvc that runs without creating a container.
Can you please tell me where I can find the config for docker support to double check

Here is the error I am getting

ContainerErr

Create the DB on Azure

Barry, after creating the resource for cosmos DB in Azure, then going to data explorer, in the drop down list, I have
New Constainer
New Database

I don't have "New Collection as you show? Is it something because of a different subscription or a new interface? Is it a container which means docker container or is replacement for collection?
Thanks
cosmosColl

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.