Skip to content

Commit 3c5c7bf

Browse files
committed
First application content
1 parent 1fb98be commit 3c5c7bf

File tree

4 files changed

+57
-13
lines changed

4 files changed

+57
-13
lines changed
Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,61 @@
1-
# Create your first Cosmos DB project (console app (Jupyter notebook?))
1+
# Create your first Cosmos DB project
22

3-
- How to use the Cosmos DB SDK
4-
- How to develop locally
3+
In this section, we'll cover how to create your first Cosmos DB project. We'll use a notebook to demonstrate the basic CRUD operations. We'll also cover how to use the Azure Cosmos DB Emulator to test your code locally.
54

6-
## Emulator support (does it support vector search?)
7-
## Authentication options
8-
## Create a database
9-
## Create a collection
10-
## Create a document
5+
## Emulator support
116

12-
## INCLUDE 08_Load_Data here
7+
Azure Cosmos DB has an emulator that you can use to develop your code locally. The emulator supports the API for NoSQL and API for MongoDB. Usage of the emulator does not require an Azure Subscription nor does it incur any costs so is ideal for local development and testing. The Azure Cosmos DB emulator can also be utilized with unit tests in a [GitHub Actions CI workflow](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=windows%2Cpython&pivots=api-mongodb#use-the-emulator-in-a-github-actions-ci-workflow).
138

14-
## Read a document
15-
## Update a document
16-
## Delete a document
17-
## Query documents
9+
There is not 100% feature parity between the emulator and the cloud service. Visit the [Azure Cosmos DB emulator](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator) documentation for more details.
1810

11+
For Windows machines, the emulator can be installed via an installer. There is a Windows container using Docker available, however it does not currently support the API for Mongo DB. A Docker image is also available for Linux that does support the API for Mongo DB.
12+
13+
Learn more about the pre-requisites and installation of the emulator [here](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=windows%2Cpython&pivots=api-mongodb).
14+
15+
## Authentication
16+
17+
Authentication to Azure Cosmos DB API for Mongo DB is done using a connection string. The connection string is a URL that contains the authentication information for your Azure Cosmos DB account or local emulator. The username and password used when provisioning the Azure Cosmos DB API for MongoDB service are used in the connection string when authenticating to Azure.
18+
19+
### Retrieving the connection string from the Cosmos DB Emulator
20+
21+
The splash screen or **Quickstart** section of the Cosmos DB Emulator will display the connection string. Access this screen through the following URL: `https://localhost:8081/_explorer/index.html`.
22+
23+
![The Azure Cosmos DB emulator screen displays with the local host url, the Quickstart tab, and the Mongo connection string highlighted.](media/emulator_connection_string.png)
24+
25+
### Retrieving the connection string from the Azure portal
26+
27+
Retrieve the connection string from the Azure portal by navigating to your Azure Cosmos DB account and selecting the **Connection String** menu item on the left-hand side of the screen. The connection string contains tokens for the username an password that must be replaced with the username and password used when provisioning the Azure Cosmos DB API for MongoDB service. Additional users can be added at any time using the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/cosmosdb/mongodb/user?view=azure-cli-latest).
28+
29+
![The Azure CosmosDb API for MongoDB Connection strings screen displays with the copy button next to the connection string highlighted.](media/azure_connection_string.png)
30+
31+
## Authorization
32+
33+
Azure Cosmos DB API for MongoDB supports fine-grained role-based access control (RBAC) for authorization. There are a number of built-in roles available. The built-in roles are:
34+
1. read
35+
2. readWrite
36+
3. dbAdmin
37+
4. dbOwner
38+
39+
The ability to create custom roles is also available. Custom roles can be created using the [Azure CLI](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/how-to-setup-rbac). Custom roles can include granular permissions for specific databases, collections, and operational actions. Learn more about the [Azure CLI RBAC commands to define custom roles](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/how-to-setup-rbac#azure-cli-rbac-commands).
40+
41+
## Helpful tools
42+
43+
Visualization and querying tools:
44+
1. Studio 3T
45+
2. MongoDB Compass
46+
3. Azure Data Studio
47+
4. MongoDB Shell
48+
5. Azure Portal Data Explorer
49+
50+
## Lab 1 - Create your first Cosmos DB for MongoDB application
51+
52+
In this lab, we'll create a Cosmos DB for MongoDB application using a notebook. You have the choice to either use the Azure Cosmos DB Emulator or an Azure Cosmos DB account in Azure. The following concepts will be covered in this lab:
53+
1. Create a database
54+
2. Create a collection
55+
3. Create a document
56+
4. Read a document
57+
5. Update a document
58+
6. Delete a document
59+
7. Query documents
60+
61+
Please visit the lab repository to complete this lab.
37 KB
Loading
44.6 KB
Loading

11_Prompt_Engineering/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A prompt is an input or instruction provided to an Artificial Intelligence (AI)
1515
Prompt engineering is the iterative process of designing, evaluating, and optimizing prompts to produce consistently accurate responses from language models for a particular problem domain. It involves designing and refining the prompts given to an AI model to achieve the desired outputs. Prompt engineers experiment with various prompts, test their effectiveness, and refine them to improve performance. Performance is measured using predefined metrics such as accuracy, relevance, and user satisfaction to assess the impact of prompt engineering.
1616

1717
## General anatomy of a prompt
18+
1819
Instruction, context, input, output indicator
1920

2021
## Zero-shot prompting

0 commit comments

Comments
 (0)