🔏
Azure Serverless Quickstart
  • Introduction
  • Initial Setup
    • Workstation Installs
    • Codebase
      • Directory Structure
      • User Interface Project
        • Configuring StoryBook
        • Configure Tailwind
        • Configure Craco
        • -Architectural Decision Log
      • Data Access Project
        • DDD
      • Untitled
      • Full Stack Debugging
      • Creating GitHub Project
    • Infrastructure
      • Configure Session Behavior
      • Create AAD Tenant
      • Resource Group
      • Create AAD B2C Instance
        • Identity Experience Framework
        • Configure Session Behavior
      • Storage Account & CDN
        • CDN Rules
        • Configure Azure BLOB Storage
      • App Insights
        • Create AppInsight Account
        • Apollo GraphQL App Insights Configuration
      • CosmosDB
      • Twilio SendGrid
      • KeyVault
      • Function
      • Function App Settings
      • Front Door
      • DevOps
      • Optional Items
        • Azure Data Factory
      • Azure Event Hub
    • CICD and Source Control
      • Azure DevOps
      • SonarCloud
        • Incorporate into Yaml
      • Chromatic
      • User Interface YAML
      • CICD for Data Access
        • Create Pipeline
        • Data Access YAML
  • Application Structure
    • Connect Apollo
      • Apollo Overview
      • Create Apollo Component
    • MongoDB Integration
      • Mappings
      • Directory Structure
      • Apollo Connection
      • Models
      • Queries Mutations and Subscriptions
      • Caching Reponses
    • Integrating GraphQL Tools
      • GraphQL Code Generator
    • Feature Flags
      • Flag Structure & Storage
      • Website Integration
      • Apollo Integration
      • Tips and Techniques
      • Alternative Approaches
    • React Router
    • Adding Authentication
      • Create AAD Applications
      • Configure AAD For External Identities
      • Adding MSAL And React
      • Add MSAL to the build
      • Add MSAL to ApolloClient
      • Add MSAL to ApolloServer
    • Ant Design
    • Jest Tests
  • Azure Active Directory Business-to-Consumer (AD B2C)
    • Introduction
    • How to navigate through AD B2C documentation
    • Localization
    • Abbreviations
    • Azure AD B2C Extension
  • Cognitive Search
  • Cost Analysis
  • Technical Architecture
    • Identity and Access Control
  • Adding Functionality
    • Google Analytics
      • Create Analytics
    • DAPR
      • DAPR setup
      • DAPR Services (ignore for now)
        • Identity
  • Patterns and Practices
    • Idempotent Messages
    • Pathways
    • DDD
      • Initial Setup
        • Aggregate Root
        • Entity
        • Value Object
      • Field Types
        • Primitive Types
        • Non-Primitive Types
          • Types.DocumentArray
          • PopulatedDoc
          • Custom Types
      • Example Walkthrough
  • Open Items
    • Issue Tracking
  • Helpful Resources
  • DDD
    • Page 1
  • Experimental
    • StaticWebApp
    • Azure Maps
Powered by GitBook
On this page
  • Why CosmosDB + MongoDB
  • Set up an instance of CosmosDB

Was this helpful?

  1. Initial Setup
  2. Infrastructure

CosmosDB

(~20 minutes)

PreviousApollo GraphQL App Insights ConfigurationNextTwilio SendGrid

Last updated 3 years ago

Was this helpful?

Why CosmosDB + MongoDB

CosmosDB is a good solution for building a solution for a startup, it allows solutions to start small and to scale globally, all with little management overhead. There are, of course drawbacks as well, the major one being that cost can be come an issue. This project will attempt to keep costs in check by fronting access to CosmosDB with Apollo GraphQL which if architected appropriately can make server side calls more efficient and can leverage caching.

The NodeJS community has excellent support for MongoDB and the maturity in working with unstructured data provides a good paring with Apollo GraphQL and helps to meet the demands of modern consumer created data driven applications.

Set up an instance of CosmosDB

  • Navigate to the in the Azure portal

  • Select the appropriate Subscription

  • Select the rg-sharethrift resource group

  • Instance Details:

    • Account Name: sharethrift<<Random Number>>

    • API: Azure CosmosDB for MogodDB API

    • Notebooks (Preview): On

    • Location: (US) East US 2

    • Apply Free Tier Discount: Apply

    • Account Type: Production

    • Version: 4.2

    • Multi-region Writes: Enable (may want to Disable for lower cost)

    • Availability Zones: Enable

    • Click Next: Networking

  • Networking

    • Network Connectivity - Connectivity method: All networks Public endpoint (selected networks)

    • Configure Firewall

      • Allow access from Azure Portal: Allow

      • Allow access from my IP: Allow

    • Click Review + create

    • Click Create (wait for completion)

  • Click Data Explorer

    • Choose New Database (Pane will show)

      • Database ID: sharethrift

      • Provision throughput: Checked

        • Important: This allows each collection to share in the 1,000 RU allotment for the free tier.

      • Database Throughput(autoscale):Autoscale

      • Max R/Us: (leave default 1,000 )

      • Click OK

Recommended Reading

  • Microsoft

  • MongoDB

      • (3.6 is the max version supported by Cosmos at the time of writing)

Recommended Tools

- Robo3T(free) / Studio3T(commercial)

How to

How to

Create Azure CosmosDB Account
Plan and manage costs for Azure Cosmos DB
The MongoDB 3.6 Manual
3T
Use Studio3T to connect to Cosmos
Use Robo3T to connect to Cosmos