Step 1: Create an Azure Cosmos DB for MongoDB vCore Cluster

  1. Sign in to the Azure Portal:
    1. Go to Azure Portal .
    2. Search for Azure Cosmos DB in the search bar.
  2. Create a New Cosmos DB Cluster:
    1. Click Create a resource → Search for Azure Cosmos DB.
    2. On the Which API best suits your workload? page, select Azure Cosmos DB for MongoDB.
    3. On the next page, select Create under the vCore cluster section.
  3. Configure the Cluster:
    1. Click Configure under Cluster tier, then set:
      1. Shard Count: Single Shard
      2. Cluster Tier: M30 (2 vCores, 8 GB RAM)
      3. Storage per Shard: 128 GB
    2. Enable High Availability if this is a production setup.
    3. Click Save to apply changes.
  4. Enter Cluster Details:
    1. Subscription: Select your Azure subscription.
    2. Resource Group: Select an existing one or create a new one.
    3. Cluster Name: Enter a unique name (e.g., GenAI-mongo-cluster).
    4. Location: Choose a region close to your application.
    5. MongoDB Version: Select the required version.
    6. Admin Username & Password: Provide credentials for the cluster.
  5. Networking Configuration:
    1. Choose one of the following options based on your security requirements:
      1. Recommended (Restricted Access):
        • Add a firewall rule to allow access only from your local machine or specific IP ranges.
    2. For Initial Testing (Less Secure):
      • Allow all IPs temporarily by setting the firewall rule to 0.0.0.0 - 255.255.255.255.
      • This is useful for quick setup but should be restricted once connectivity is verified.
    3. Additionally, select Allow public access from Azure services to enable Azure-based applications to connect.
      1. Review & Deploy:
        • Click Review + Create, then Create.
        • Wait for the deployment to complete, then select Go to resource.