In this episode, we'll explore the features, capabilities, and real-world use cases of Cosmos DB, and discover how it enables developers to build highly responsive and scalable applications with ease.
During the episode, we'll cover:
• An overview of Cosmos DB and its key benefits
• Understanding the different data models supported by Cosmos DB
• Best practices for designing and implementing Cosmos DB solutions
• Real-world use cases showcasing the versatility and power of Cosmos DB across various industries
Whether you're a developer, data engineer, or IT professional, this episode is your opportunity to gain valuable insights into Cosmos DB and learn how to leverage its capabilities to build modern, globally distributed applications in the cloud. Don't miss out on this informative session packed with practical tips and demonstrations!
📺 CSharp TV - Dev Streaming Destination http://csharp.tv
🌎 C# Corner - Community of Software and Data Developers https://www.c-sharpcorner.com/
#Azure #AzureShow #CSharpTV #LiveShow #AzureEssentils #CosmosDB
Show More Show Less View Video Transcript
0:01
[Music]
0:19
[Music]
0:33
hello guys Welcome to our live show
0:36
hello guys Welcome to our live show
0:36
hello guys Welcome to our live show where we dive into the power of cloud
0:38
where we dive into the power of cloud
0:38
where we dive into the power of cloud computing with Aur Cosmos d uh discover
0:42
computing with Aur Cosmos d uh discover
0:42
computing with Aur Cosmos d uh discover how this globally distributed multimodel
0:44
how this globally distributed multimodel
0:44
how this globally distributed multimodel database service can transform your
0:46
database service can transform your
0:46
database service can transform your business by providing High availability
0:50
business by providing High availability
0:50
business by providing High availability scalability and low latency whether you
0:53
scalability and low latency whether you
0:53
scalability and low latency whether you are using key value document column
0:56
are using key value document column
0:56
are using key value document column family or graph database or uh as your
1:00
family or graph database or uh as your
1:00
family or graph database or uh as your Cosmos DB has got you
1:03
Cosmos DB has got you
1:03
Cosmos DB has got you covered tune in as we express seamless
1:06
covered tune in as we express seamless
1:06
covered tune in as we express seamless integration with nosql and how to
1:09
integration with nosql and how to
1:09
integration with nosql and how to leverage these Technologies for
1:11
leverage these Technologies for
1:11
leverage these Technologies for unparallel performance don't miss out on
1:13
unparallel performance don't miss out on
1:13
unparallel performance don't miss out on unlocking the full professional of your
1:16
unlocking the full professional of your
1:16
unlocking the full professional of your data with Azor Cosmos TV so this is your
1:19
data with Azor Cosmos TV so this is your
1:19
data with Azor Cosmos TV so this is your host Habib ran and I will be hosting
1:22
host Habib ran and I will be hosting
1:22
host Habib ran and I will be hosting this show so let's start
1:26
this first of all uh um my name is
1:30
this first of all uh um my name is
1:30
this first of all uh um my name is habiban I'm two time cop Corner MVP
1:33
habiban I'm two time cop Corner MVP
1:33
habiban I'm two time cop Corner MVP Microsoft certified solution developer
1:35
Microsoft certified solution developer
1:35
Microsoft certified solution developer and Lead software developer at now
1:37
and Lead software developer at now
1:37
and Lead software developer at now software and this is the agenda for our
1:40
software and this is the agenda for our
1:40
software and this is the agenda for our Today Show uh first of all we will talk
1:43
Today Show uh first of all we will talk
1:43
Today Show uh first of all we will talk about uh Azure Cosmos TV then pros and
1:46
about uh Azure Cosmos TV then pros and
1:46
about uh Azure Cosmos TV then pros and cons of azour Cosmos TB and the
1:50
cons of azour Cosmos TB and the
1:50
cons of azour Cosmos TB and the different available models and at the
1:52
different available models and at the
1:52
different available models and at the end we will integrate a your Cosmos DB
1:55
end we will integrate a your Cosmos DB
1:55
end we will integrate a your Cosmos DB with asp.net core MVC
1:57
with asp.net core MVC
1:57
with asp.net core MVC application uh and at the end we will
2:00
application uh and at the end we will
2:00
application uh and at the end we will have a QA session so let's start this
2:03
have a QA session so let's start this
2:03
have a QA session so let's start this first of all Azure Cosmos DB is a global
2:07
first of all Azure Cosmos DB is a global
2:07
first of all Azure Cosmos DB is a global uh distributed database uh provided by
2:10
uh distributed database uh provided by
2:10
uh distributed database uh provided by Microsoft asual uh so it provide global
2:14
Microsoft asual uh so it provide global
2:14
Microsoft asual uh so it provide global distribution and it's a multimodel
2:16
distribution and it's a multimodel
2:16
distribution and it's a multimodel support you can have use different apis
2:19
support you can have use different apis
2:19
support you can have use different apis for different models using AZ Cosmos GB
2:23
for different models using AZ Cosmos GB
2:23
for different models using AZ Cosmos GB uh you can use uh global distribution
2:26
uh you can use uh global distribution
2:26
uh you can use uh global distribution with with just uh on single click and
2:30
with with just uh on single click and
2:30
with with just uh on single click and you can also uh Implement automatic
2:33
you can also uh Implement automatic
2:33
you can also uh Implement automatic scaling with SLA backend performance uh
2:37
scaling with SLA backend performance uh
2:37
scaling with SLA backend performance uh a your Cosmos DB provide Enterprises
2:40
a your Cosmos DB provide Enterprises
2:40
a your Cosmos DB provide Enterprises level Grid security with uh encryption
2:44
level Grid security with uh encryption
2:44
level Grid security with uh encryption uh and it also provide fully managed
2:46
uh and it also provide fully managed
2:46
uh and it also provide fully managed service you don't have to provision your
2:49
service you don't have to provision your
2:49
service you don't have to provision your hardware and at the end integration with
2:51
hardware and at the end integration with
2:52
hardware and at the end integration with AO Services is very easy with aure
2:55
AO Services is very easy with aure
2:55
AO Services is very easy with aure Cosmos DB so uh the pros of Cosmos DB is
2:59
Cosmos DB so uh the pros of Cosmos DB is
3:00
Cosmos DB so uh the pros of Cosmos DB is first of all uh global distribution you
3:02
first of all uh global distribution you
3:02
first of all uh global distribution you can distribute your Aur Cosmos DB on
3:05
can distribute your Aur Cosmos DB on
3:05
can distribute your Aur Cosmos DB on multiple regions uh with multiple
3:08
multiple regions uh with multiple
3:08
multiple regions uh with multiple availability zones then you can have
3:10
availability zones then you can have
3:11
availability zones then you can have multimodel support uh basically a your
3:13
multimodel support uh basically a your
3:13
multimodel support uh basically a your Cosmos DB provide uh nosql model mongod
3:18
Cosmos DB provide uh nosql model mongod
3:18
Cosmos DB provide uh nosql model mongod DB cassendra DB you can integrate with
3:21
DB cassendra DB you can integrate with
3:21
DB cassendra DB you can integrate with any database using Azure Cosmos DB apis
3:24
any database using Azure Cosmos DB apis
3:24
any database using Azure Cosmos DB apis it provide elastic
3:26
it provide elastic
3:26
it provide elastic scalability uh you can scalable uh uh
3:30
scalability uh you can scalable uh uh
3:30
scalability uh you can scalable uh uh Aur Cosmos DB for handling millions of
3:33
Aur Cosmos DB for handling millions of
3:33
Aur Cosmos DB for handling millions of request with uh less than 1 millisecond
3:36
request with uh less than 1 millisecond
3:36
request with uh less than 1 millisecond latency it provides a very high
3:40
latency it provides a very high
3:40
latency it provides a very high performance it also provide SLA backed
3:43
performance it also provide SLA backed
3:43
performance it also provide SLA backed availability and performance as your
3:46
availability and performance as your
3:46
availability and performance as your Cosmos DB is almost 99% available
3:50
Cosmos DB is almost 99% available
3:50
Cosmos DB is almost 99% available 99.99% available all the time and it is
3:53
99.99% available all the time and it is
3:53
99.99% available all the time and it is all insured by Microsoft to provide
3:56
all insured by Microsoft to provide
3:56
all insured by Microsoft to provide Enterprise level gr security uh with in
3:59
Enterprise level gr security uh with in
3:59
Enterprise level gr security uh with in ion and thetion feature it's a fully
4:03
ion and thetion feature it's a fully
4:03
ion and thetion feature it's a fully managed Service uh by Azure you don't
4:06
managed Service uh by Azure you don't
4:06
managed Service uh by Azure you don't have to provision your Hardware you
4:08
have to provision your Hardware you
4:08
have to provision your Hardware you don't have to uh check your Hardware
4:11
don't have to uh check your Hardware
4:11
don't have to uh check your Hardware whether there is any issue or not
4:13
whether there is any issue or not
4:13
whether there is any issue or not Microsoft will automatically manage it
4:15
Microsoft will automatically manage it
4:15
Microsoft will automatically manage it they will automatically replicate it on
4:17
they will automatically replicate it on
4:17
they will automatically replicate it on different regions uh for availability
4:21
different regions uh for availability
4:21
different regions uh for availability and security and then as your service
4:24
and security and then as your service
4:24
and security and then as your service integration you can integrate it very
4:27
integration you can integrate it very
4:27
integration you can integrate it very easily with aure Services just like a
4:29
easily with aure Services just like a
4:30
easily with aure Services just like a your function a your logic apps or
4:32
your function a your logic apps or
4:32
your function a your logic apps or asp.net cor MVC because it provide sdks
4:36
asp.net cor MVC because it provide sdks
4:36
asp.net cor MVC because it provide sdks and apis for almost all languages and at
4:40
and apis for almost all languages and at
4:40
and apis for almost all languages and at the end it's cost effective
4:42
the end it's cost effective
4:42
the end it's cost effective solution and few cons of aor Cosmos DB
4:46
solution and few cons of aor Cosmos DB
4:46
solution and few cons of aor Cosmos DB uh first of all cost if you have a very
4:49
uh first of all cost if you have a very
4:49
uh first of all cost if you have a very big data set uh and very high you need a
4:53
big data set uh and very high you need a
4:53
big data set uh and very high you need a very high availability for different
4:55
very high availability for different
4:55
very high availability for different regions then this will be a little bit
4:58
regions then this will be a little bit
4:58
regions then this will be a little bit cost then uh a learning curve uh you
5:01
cost then uh a learning curve uh you
5:01
cost then uh a learning curve uh you have to uh learn a different concept of
5:04
have to uh learn a different concept of
5:04
have to uh learn a different concept of azure Cosmos TB because it provides a
5:08
azure Cosmos TB because it provides a
5:08
azure Cosmos TB because it provides a lot of Avis for different models and
5:10
lot of Avis for different models and
5:10
lot of Avis for different models and then consistency tradeoffs as as us
5:15
then consistency tradeoffs as as us
5:15
then consistency tradeoffs as as us Cosmos DB can be replicated on different
5:18
Cosmos DB can be replicated on different
5:18
Cosmos DB can be replicated on different aure regions uh so consistency is very
5:22
aure regions uh so consistency is very
5:22
aure regions uh so consistency is very important uh then cury
5:24
important uh then cury
5:24
important uh then cury limitations there are cury limitations
5:27
limitations there are cury limitations
5:27
limitations there are cury limitations for example there are few ques uh you
5:29
for example there are few ques uh you
5:29
for example there are few ques uh you cannot run on aure Cosmos TB for example
5:33
cannot run on aure Cosmos TB for example
5:34
cannot run on aure Cosmos TB for example aggregate functions which you can use on
5:36
aggregate functions which you can use on
5:36
aggregate functions which you can use on SQL databases uh but you uh can't use
5:40
SQL databases uh but you uh can't use
5:40
SQL databases uh but you uh can't use directly here then we have a data
5:42
directly here then we have a data
5:42
directly here then we have a data migration complexity if you are
5:44
migration complexity if you are
5:44
migration complexity if you are migrating your relational databases uh
5:47
migrating your relational databases uh
5:47
migrating your relational databases uh to asure Cosmos DB uh then there will be
5:51
to asure Cosmos DB uh then there will be
5:51
to asure Cosmos DB uh then there will be a little bit complexity because your
5:53
a little bit complexity because your
5:53
a little bit complexity because your solution maybe an Enterprise level
5:56
solution maybe an Enterprise level
5:56
solution maybe an Enterprise level solution and you have to uh deal with
5:59
solution and you have to uh deal with
5:59
solution and you have to uh deal with with a lot of things so it's very
6:02
with a lot of things so it's very
6:02
with a lot of things so it's very difficult uh then we have vendor lock in
6:04
difficult uh then we have vendor lock in
6:04
difficult uh then we have vendor lock in as uh Cosmos CB is provided by uh
6:08
as uh Cosmos CB is provided by uh
6:08
as uh Cosmos CB is provided by uh microsof Microsoft so later on if you
6:10
microsof Microsoft so later on if you
6:10
microsof Microsoft so later on if you want to switch on any other database it
6:13
want to switch on any other database it
6:13
want to switch on any other database it will be a little bit difficult uh
6:16
will be a little bit difficult uh
6:16
will be a little bit difficult uh because you have to uh model your
6:18
because you have to uh model your
6:18
because you have to uh model your database with your application uh very
6:21
database with your application uh very
6:21
database with your application uh very carefully then we have limited Cy
6:23
carefully then we have limited Cy
6:23
carefully then we have limited Cy optimization
6:25
optimization
6:25
optimization tools uh then monitoring and debugging
6:27
tools uh then monitoring and debugging
6:27
tools uh then monitoring and debugging complexity as your solution grows
6:30
complexity as your solution grows
6:30
complexity as your solution grows monitoring is very essential for aure
6:33
monitoring is very essential for aure
6:33
monitoring is very essential for aure Cosmos DB and for problems debugging
6:36
Cosmos DB and for problems debugging
6:37
Cosmos DB and for problems debugging complexity is very high uh then we have
6:39
complexity is very high uh then we have
6:39
complexity is very high uh then we have eventual consistency concerns as we have
6:42
eventual consistency concerns as we have
6:42
eventual consistency concerns as we have Azure Cosmos TB availability on
6:44
Azure Cosmos TB availability on
6:44
Azure Cosmos TB availability on different regions and if you are uh
6:47
different regions and if you are uh
6:47
different regions and if you are uh updating data in your AZ Cosmos DB then
6:52
updating data in your AZ Cosmos DB then
6:52
updating data in your AZ Cosmos DB then it will be eventually uh be changes on
6:55
it will be eventually uh be changes on
6:55
it will be eventually uh be changes on different regions uh so any person who
6:59
different regions uh so any person who
6:59
different regions uh so any person who is read the data uh Mega dirty data so
7:02
is read the data uh Mega dirty data so
7:02
is read the data uh Mega dirty data so these things uh are important to
7:05
these things uh are important to
7:05
these things uh are important to consider while working with Azor Cosmos
7:07
consider while working with Azor Cosmos
7:07
consider while working with Azor Cosmos CB and then we have limited offline
7:11
CB and then we have limited offline
7:11
CB and then we have limited offline functional uh then as we talk about uh
7:14
functional uh then as we talk about uh
7:14
functional uh then as we talk about uh multimodel support as your cosos TB
7:16
multimodel support as your cosos TB
7:16
multimodel support as your cosos TB provide apis for these models okay no
7:20
provide apis for these models okay no
7:20
provide apis for these models okay no SQL database uh basically it's a keybase
7:23
SQL database uh basically it's a keybase
7:23
SQL database uh basically it's a keybase or document database so you can use uh
7:26
or document database so you can use uh
7:26
or document database so you can use uh no SQL database uh apis or drivers as
7:30
no SQL database uh apis or drivers as
7:31
no SQL database uh apis or drivers as with Cosmos DB then you can use mongod
7:34
with Cosmos DB then you can use mongod
7:34
with Cosmos DB then you can use mongod DB uh mongod DB uh for document database
7:39
DB uh mongod DB uh for document database
7:39
DB uh mongod DB uh for document database model so you can for example if you have
7:42
model so you can for example if you have
7:42
model so you can for example if you have an existing mongodb model so you can use
7:45
an existing mongodb model so you can use
7:45
an existing mongodb model so you can use this uh model using as your Cosmos DB
7:48
this uh model using as your Cosmos DB
7:48
this uh model using as your Cosmos DB API so it's very easy to use then we
7:51
API so it's very easy to use then we
7:51
API so it's very easy to use then we have a post G SQL so if you have a
7:54
have a post G SQL so if you have a
7:54
have a post G SQL so if you have a relational uh database model in post G
7:57
relational uh database model in post G
7:57
relational uh database model in post G SQL so still you can use as Z your cost
7:59
SQL so still you can use as Z your cost
7:59
SQL so still you can use as Z your cost most CB apis uh then Apachi Cassandra so
8:03
most CB apis uh then Apachi Cassandra so
8:03
most CB apis uh then Apachi Cassandra so you can also use this one then we have
8:05
you can also use this one then we have
8:05
you can also use this one then we have gramlin gramlin is basically a graph
8:08
gramlin gramlin is basically a graph
8:08
gramlin gramlin is basically a graph based database model uh so you can also
8:12
based database model uh so you can also
8:12
based database model uh so you can also use this one with Azure Cosmos TV and at
8:14
use this one with Azure Cosmos TV and at
8:14
use this one with Azure Cosmos TV and at the end we have table storage uh so you
8:17
the end we have table storage uh so you
8:17
the end we have table storage uh so you can also use table storage with Z Cosmos
8:21
can also use table storage with Z Cosmos
8:21
can also use table storage with Z Cosmos TV uh so this was a little introduction
8:24
TV uh so this was a little introduction
8:24
TV uh so this was a little introduction and pros of pros and cons of aor Cosmos
8:27
and pros of pros and cons of aor Cosmos
8:28
and pros of pros and cons of aor Cosmos TV uh so so let's dive into the code
8:32
TV uh so so let's dive into the code
8:32
TV uh so so let's dive into the code where I will show you how to uh create
8:35
where I will show you how to uh create
8:35
where I will show you how to uh create an asp.net core MVC API where we can
8:38
an asp.net core MVC API where we can
8:38
an asp.net core MVC API where we can integrate with aor Cosmos DB and for
8:42
integrate with aor Cosmos DB and for
8:42
integrate with aor Cosmos DB and for this episode I will be using no esql
8:45
this episode I will be using no esql
8:45
this episode I will be using no esql database API uh I will show you how to
8:49
database API uh I will show you how to
8:49
database API uh I will show you how to perform CR operations on uh Azure
8:53
perform CR operations on uh Azure
8:53
perform CR operations on uh Azure cosb uh so let's start it uh let me
8:57
cosb uh so let's start it uh let me
8:57
cosb uh so let's start it uh let me share my screen
9:05
okay so that's it uh for uh this episode
9:08
okay so that's it uh for uh this episode
9:08
okay so that's it uh for uh this episode I'm using V Studio
9:11
I'm using V Studio
9:11
I'm using V Studio 2022 I already have created one solution
9:15
2022 I already have created one solution
9:15
2022 I already have created one solution in uh preer episode so I will be using
9:17
in uh preer episode so I will be using
9:17
in uh preer episode so I will be using that uh so that you can guys uh can
9:20
that uh so that you can guys uh can
9:20
that uh so that you can guys uh can easily access this code I will be
9:22
easily access this code I will be
9:22
easily access this code I will be creating this asp.net for
9:26
creating this asp.net for
9:26
creating this asp.net for uh MVC application or I will select
9:30
uh MVC application or I will select
9:30
uh MVC application or I will select asp.net for web apis I will say it
9:34
asp.net for web apis I will say it
9:34
asp.net for web apis I will say it episode
9:35
episode
9:35
episode 2 and then I will be using net 8 uh and
9:40
2 and then I will be using net 8 uh and
9:40
2 and then I will be using net 8 uh and authentication type will be none
9:42
authentication type will be none
9:42
authentication type will be none currently I'm not interested in any of
9:44
currently I'm not interested in any of
9:44
currently I'm not interested in any of these things okay and I will be using
9:47
these things okay and I will be using
9:47
these things okay and I will be using controllers for this so let's create
9:51
controllers for this so let's create
9:51
controllers for this so let's create it okay you can see uh a new asp.net
9:55
it okay you can see uh a new asp.net
9:55
it okay you can see uh a new asp.net core MVC project have been created so
9:59
core MVC project have been created so
9:59
core MVC project have been created so there are few uh pre prerequisites uh
10:02
there are few uh pre prerequisites uh
10:02
there are few uh pre prerequisites uh that you need to set before using your
10:04
that you need to set before using your
10:04
that you need to set before using your Cosmos
10:06
Cosmos
10:06
Cosmos DB uh as you guys know that there are
10:09
DB uh as you guys know that there are
10:09
DB uh as you guys know that there are two ways uh for using Azure Cosmos DB uh
10:13
two ways uh for using Azure Cosmos DB uh
10:13
two ways uh for using Azure Cosmos DB uh for development first one is you can
10:15
for development first one is you can
10:15
for development first one is you can create your azur fmos DB on uh Microsoft
10:19
create your azur fmos DB on uh Microsoft
10:19
create your azur fmos DB on uh Microsoft Azure but for that you need a
10:22
Azure but for that you need a
10:22
Azure but for that you need a subscription and you have to pay for
10:24
subscription and you have to pay for
10:24
subscription and you have to pay for that and uh I think instead of using
10:27
that and uh I think instead of using
10:27
that and uh I think instead of using that I'm using a your Cosmos DB emulator
10:31
that I'm using a your Cosmos DB emulator
10:31
that I'm using a your Cosmos DB emulator uh so you can use or download this
10:34
uh so you can use or download this
10:34
uh so you can use or download this emulator from Microsoft website I
10:37
emulator from Microsoft website I
10:37
emulator from Microsoft website I already have uh downloaded one emulator
10:40
already have uh downloaded one emulator
10:40
already have uh downloaded one emulator so here you can see uh I already have
10:43
so here you can see uh I already have
10:43
so here you can see uh I already have one database uh it name is cosmix work
10:47
one database uh it name is cosmix work
10:47
one database uh it name is cosmix work so I will be using uh this database uh
10:51
so I will be using uh this database uh
10:51
so I will be using uh this database uh there are a few existing container and
10:53
there are a few existing container and
10:53
there are a few existing container and I'm going to uh delete that so that I
10:56
I'm going to uh delete that so that I
10:56
I'm going to uh delete that so that I can show you how we can uh create
11:00
can show you how we can uh create
11:00
can show you how we can uh create containers and database programmatic
11:04
containers and database programmatic
11:04
containers and database programmatic VI okay uh so first of all let me tell
11:08
VI okay uh so first of all let me tell
11:08
VI okay uh so first of all let me tell you the uh hierarchy of uh Azure Cosmos
11:12
you the uh hierarchy of uh Azure Cosmos
11:12
you the uh hierarchy of uh Azure Cosmos DB in no SQL API basically first of all
11:16
DB in no SQL API basically first of all
11:16
DB in no SQL API basically first of all we have a database uh database is just
11:19
we have a database uh database is just
11:19
we have a database uh database is just like other databases and inside uh this
11:22
like other databases and inside uh this
11:22
like other databases and inside uh this database you have a collection of
11:25
database you have a collection of
11:25
database you have a collection of containers container is just like a
11:28
containers container is just like a
11:28
containers container is just like a table
11:29
table
11:29
table that we have in a relational databases
11:33
that we have in a relational databases
11:33
that we have in a relational databases or just like a you can say that a
11:36
or just like a you can say that a
11:36
or just like a you can say that a document group we have in no SQL
11:38
document group we have in no SQL
11:38
document group we have in no SQL database so we will have container and
11:41
database so we will have container and
11:41
database so we will have container and then inside container we can have
11:43
then inside container we can have
11:44
then inside container we can have different items so this is the hierarchy
11:46
different items so this is the hierarchy
11:47
different items so this is the hierarchy how it works if I click on quick start
11:50
how it works if I click on quick start
11:50
how it works if I click on quick start button here I can see uh the connection
11:53
button here I can see uh the connection
11:53
button here I can see uh the connection string that I need to use with my
11:57
string that I need to use with my
11:57
string that I need to use with my solution okay so now uh uh let's move to
12:00
solution okay so now uh uh let's move to
12:01
solution okay so now uh uh let's move to my
12:05
application first of all uh I need to
12:07
application first of all uh I need to
12:07
application first of all uh I need to install Azure Cosmos DB
12:11
install Azure Cosmos DB
12:11
install Azure Cosmos DB SDK uh we can also use Entity framework
12:14
SDK uh we can also use Entity framework
12:14
SDK uh we can also use Entity framework with Azure cosos DP but in uh this
12:18
with Azure cosos DP but in uh this
12:18
with Azure cosos DP but in uh this episode I will be
12:24
using uh microsoft.
12:27
using uh microsoft.
12:27
using uh microsoft. ao. so this is the
12:32
SDK that we need to use uh I'm going to
12:37
SDK that we need to use uh I'm going to
12:37
SDK that we need to use uh I'm going to install
12:38
install
12:38
install this accept it okay my package have been
12:44
this accept it okay my package have been
12:44
this accept it okay my package have been installed okay now uh first of all I
12:47
installed okay now uh first of all I
12:47
installed okay now uh first of all I will create a
12:49
will create a
12:49
will create a service where I will write my code for
12:53
service where I will write my code for
12:53
service where I will write my code for uh communicating with a your Cosmos CB
12:57
uh communicating with a your Cosmos CB
12:57
uh communicating with a your Cosmos CB so let's create a new class and I will
13:00
so let's create a new class and I will
13:00
so let's create a new class and I will say it student
13:06
service okay so this is my uh student
13:11
service okay so this is my uh student
13:11
service okay so this is my uh student service let me create a Constructor and
13:14
service let me create a Constructor and
13:14
service let me create a Constructor and now first of
13:16
now first of
13:16
now first of all I need to create a z Cosmos client
13:20
all I need to create a z Cosmos client
13:20
all I need to create a z Cosmos client okay so for example I
13:24
okay so for example I
13:24
okay so for example I say
13:26
say
13:26
say line and I need to
13:33
the name space
13:42
using. Microsoft asual do
13:50
Cosmos and here I will say it
13:56
[Music]
13:59
[Music]
13:59
[Music] Microsoft at a.
14:06
cosmos. okay so inside this client I
14:10
cosmos. okay so inside this client I
14:10
cosmos. okay so inside this client I need to pause my connection string and
14:12
need to pause my connection string and
14:12
need to pause my connection string and then we have Cosmos client
14:17
option and there is uh another function
14:20
option and there is uh another function
14:20
option and there is uh another function overload which provides uh another way
14:23
overload which provides uh another way
14:23
overload which provides uh another way you can also provide account endpoint
14:26
you can also provide account endpoint
14:26
you can also provide account endpoint and Au key resource credential so you
14:29
and Au key resource credential so you
14:29
and Au key resource credential so you can use both of I will be using account
14:34
can use both of I will be using account
14:34
can use both of I will be using account endpoint this one and R
14:38
endpoint this one and R
14:38
endpoint this one and R key resource
14:42
key resource
14:42
key resource token okay so let's copy the values
14:48
token okay so let's copy the values
14:48
token okay so let's copy the values from my Azure Cosmos
14:53
DB here is my
14:57
DB here is my
14:57
DB here is my URL or
15:00
URL or
15:00
URL or and then I need to copy the primary key
15:05
and then I need to copy the primary key
15:05
and then I need to copy the primary key so these are my credential uh for
15:08
so these are my credential uh for
15:08
so these are my credential uh for connecting with Azor Cosmos
15:15
DB
15:17
DB
15:17
DB okay uh this is my Cosmos client which
15:22
okay uh this is my Cosmos client which
15:22
okay uh this is my Cosmos client which have been created uh let me create a
15:26
have been created uh let me create a
15:26
have been created uh let me create a private read
15:27
private read
15:27
private read only and and save this
15:31
only and and save this
15:31
only and and save this client inside my private field so that I
15:34
client inside my private field so that I
15:34
client inside my private field so that I can access it later on so this is my
15:38
can access it later on so this is my
15:38
can access it later on so this is my client uh next step is uh to initialize
15:42
client uh next step is uh to initialize
15:42
client uh next step is uh to initialize my database or create a container if I
15:45
my database or create a container if I
15:45
my database or create a container if I need for example if I uh
15:50
create a
15:53
create a
15:53
create a function I will say it initialize and
15:56
function I will say it initialize and
15:57
function I will say it initialize and inside this function I will create cre a
15:59
inside this function I will create cre a
15:59
inside this function I will create cre a database and then container so I will
16:01
database and then container so I will
16:01
database and then container so I will say
16:02
say
16:02
say client. create database if not
16:06
client. create database if not
16:06
client. create database if not exist so you can also use just create
16:10
exist so you can also use just create
16:10
exist so you can also use just create database and inside this you need to
16:13
database and inside this you need to
16:13
database and inside this you need to provide the database ID as I already
16:18
provide the database ID as I already
16:18
provide the database ID as I already have created one database here that is
16:21
have created one database here that is
16:21
have created one database here that is uh Comics work uh but now I'm interested
16:24
uh Comics work uh but now I'm interested
16:25
uh Comics work uh but now I'm interested to create another database and I will
16:27
to create another database and I will
16:27
to create another database and I will say that database to
16:31
uh student management system for example
16:34
uh student management system for example
16:35
uh student management system for example sms
16:37
sms
16:37
sms okay so I need to put a weight here
16:42
okay so I need to put a weight here
16:42
okay so I need to put a weight here because this
16:44
because this
16:44
because this is and asynchronous function uh make my
16:49
is and asynchronous function uh make my
16:49
is and asynchronous function uh make my method ASN so this will check if there
16:52
method ASN so this will check if there
16:52
method ASN so this will check if there is no SMS database it will create one
16:55
is no SMS database it will create one
16:55
is no SMS database it will create one for
16:57
for
16:57
for us uh then we need a
16:59
us uh then we need a
17:00
us uh then we need a container for example uh I need
17:03
container for example uh I need
17:03
container for example uh I need container and container is just like a
17:07
container and container is just like a
17:07
container and container is just like a table so I will now call database do
17:20
create weate container if not
17:25
create weate container if not
17:25
create weate container if not exist and inside this container function
17:30
exist and inside this container function
17:30
exist and inside this container function I need to provide my container ID so
17:33
I need to provide my container ID so
17:33
I need to provide my container ID so basically the name of the container and
17:35
basically the name of the container and
17:35
basically the name of the container and then the partition keyo partition keyo
17:39
then the partition keyo partition keyo
17:39
then the partition keyo partition keyo is basically uh in no SQL databases it's
17:43
is basically uh in no SQL databases it's
17:43
is basically uh in no SQL databases it's the primary key uh by using which you
17:46
the primary key uh by using which you
17:46
the primary key uh by using which you can access your data so I will say it
17:51
can access your data so I will say it
17:51
can access your data so I will say it students and then my partition key will
17:54
students and then my partition key will
17:54
students and then my partition key will be slash ID
17:59
so this will create a container for
18:04
me uh then of course I need to access
18:08
me uh then of course I need to access
18:08
me uh then of course I need to access this container in other
18:10
this container in other
18:10
this container in other function uh so I will
18:14
function uh so I will
18:14
function uh so I will also use it
18:19
sep I will create another uh field this
18:24
sep I will create another uh field this
18:24
sep I will create another uh field this time uh one for container
18:32
and here I will assign
18:36
and here I will assign
18:36
and here I will assign this okay so now currently I have to
18:39
this okay so now currently I have to
18:39
this okay so now currently I have to call my initialized function and then I
18:42
call my initialized function and then I
18:42
call my initialized function and then I can access my data on
18:49
this
18:51
this
18:51
this okay uh now next step is uh write a
18:55
okay uh now next step is uh write a
18:55
okay uh now next step is uh write a different function for for my services
18:58
different function for for my services
18:58
different function for for my services uh so that I can read uh write data or I
19:01
uh so that I can read uh write data or I
19:01
uh so that I can read uh write data or I can perform the CR operation on my Azure
19:05
can perform the CR operation on my Azure
19:05
can perform the CR operation on my Azure Cosmos DP uh but before uh doing that I
19:09
Cosmos DP uh but before uh doing that I
19:09
Cosmos DP uh but before uh doing that I need to create a
19:11
need to create a
19:11
need to create a model which I will be using with aure
19:14
model which I will be using with aure
19:14
model which I will be using with aure Cosmos view so let's create a new folder
19:19
Cosmos view so let's create a new folder
19:19
Cosmos view so let's create a new folder with name models and inside this uh I
19:23
with name models and inside this uh I
19:23
with name models and inside this uh I will create a new
19:26
will create a new
19:26
will create a new item and say it
19:33
student okay so
19:35
student okay so
19:35
student okay so now I think instead of creating a class
19:40
now I think instead of creating a class
19:40
now I think instead of creating a class uh I will be using
19:42
uh I will be using
19:42
uh I will be using record that's enough for me uh I will
19:46
record that's enough for me uh I will
19:46
record that's enough for me uh I will say
19:48
say
19:48
say ID I have name
19:51
ID I have name
19:51
ID I have name field I have email okay uh as uh we are
19:55
field I have email okay uh as uh we are
19:55
field I have email okay uh as uh we are working with uh no SQL database so I
19:58
working with uh no SQL database so I
19:58
working with uh no SQL database so I would also like to tell you how to uh
20:01
would also like to tell you how to uh
20:01
would also like to tell you how to uh save the nestate fields for example I
20:04
save the nestate fields for example I
20:04
save the nestate fields for example I want to save uh a list of spring for
20:09
want to save uh a list of spring for
20:09
want to save uh a list of spring for obes so so that you can understand how
20:13
obes so so that you can understand how
20:13
obes so so that you can understand how this works as well so this is the model
20:16
this works as well so this is the model
20:16
this works as well so this is the model that I will be
20:20
using okay now create another
20:23
using okay now create another
20:24
using okay now create another function uh which will insert my student
20:37
Now call my container
20:40
Now call my container
20:40
Now call my container dot create item
20:43
dot create item
20:43
dot create item AC and pass it inside this uh and put a
20:49
AC and pass it inside this uh and put a
20:49
AC and pass it inside this uh and put a wait here because
20:51
wait here because
20:51
wait here because it's and then make it as
20:54
it's and then make it as
20:54
it's and then make it as sync so now whenever I will call this
20:57
sync so now whenever I will call this
20:57
sync so now whenever I will call this meod it will create uh a new item inside
21:02
meod it will create uh a new item inside
21:02
meod it will create uh a new item inside my
21:05
database
21:07
database
21:07
database uh okay I think uh let's uh test this
21:11
uh okay I think uh let's uh test this
21:11
uh okay I think uh let's uh test this and see how it look lies and then we
21:14
and see how it look lies and then we
21:14
and see how it look lies and then we will move to the next option okay as uh
21:18
will move to the next option okay as uh
21:18
will move to the next option okay as uh this is the student service now I will
21:20
this is the student service now I will
21:20
this is the student service now I will uh register it with my dependency
21:22
uh register it with my dependency
21:23
uh register it with my dependency Injection Service uh so that I can use
21:25
Injection Service uh so that I can use
21:25
Injection Service uh so that I can use it uh and inject it in in my controller
21:30
it uh and inject it in in my controller
21:30
it uh and inject it in in my controller so I will uh in inject it
21:37
here
21:39
here
21:39
here services. scope and here I will say
21:43
services. scope and here I will say
21:43
services. scope and here I will say student service I don't have any
21:46
student service I don't have any
21:46
student service I don't have any interface for now to keep it simple okay
21:51
interface for now to keep it simple okay
21:51
interface for now to keep it simple okay I have a WEA for cost controller I will
21:54
I have a WEA for cost controller I will
21:54
I have a WEA for cost controller I will create a new controller
22:00
I need to create an API
22:02
I need to create an API
22:02
I need to create an API controller empty1 click on ADD button
22:06
controller empty1 click on ADD button
22:06
controller empty1 click on ADD button and I will say
22:08
and I will say
22:08
and I will say it students
22:11
it students
22:11
it students controller okay now inside this
22:13
controller okay now inside this
22:13
controller okay now inside this controller first of all I will inject my
22:16
controller first of all I will inject my
22:16
controller first of all I will inject my student
22:20
service okay now create an
22:23
service okay now create an
22:23
service okay now create an HTTP uh put method and this method will
22:28
HTTP uh put method and this method will
22:28
HTTP uh put method and this method will be inserting a new
22:31
be inserting a new
22:31
be inserting a new student now create a new action and this
22:35
student now create a new action and this
22:35
student now create a new action and this action name will be insert it will
22:40
action name will be insert it will
22:40
action name will be insert it will get uh student as a
22:44
get uh student as a
22:44
get uh student as a body I will say it
22:49
request and then here I will call my
22:53
request and then here I will call my
22:53
request and then here I will call my student service
22:55
student service
22:55
student service function for example I say it away
22:59
function for example I say it away
22:59
function for example I say it away uh student service do
23:04
uh student service do
23:04
uh student service do insert
23:06
insert
23:06
insert this and I also need to call my student
23:10
this and I also need to call my student
23:10
this and I also need to call my student service. initialize async method so that
23:14
service. initialize async method so that
23:14
service. initialize async method so that it initializes the container and uh the
23:17
it initializes the container and uh the
23:17
it initializes the container and uh the database for me and at the end I will
23:21
database for me and at the end I will
23:21
database for me and at the end I will make okay result and say uh student
23:25
make okay result and say uh student
23:25
make okay result and say uh student created successfully
23:31
okay I need to make it in because it's
23:35
okay I need to make it in because it's
23:35
okay I need to make it in because it's an Asing function okay so I think it's
23:40
an Asing function okay so I think it's
23:40
an Asing function okay so I think it's look ready let's change my startup
23:43
look ready let's change my startup
23:43
look ready let's change my startup project and
23:52
run okay so everything is working for
23:56
run okay so everything is working for
23:56
run okay so everything is working for perfect
24:00
so this is uh you can see my student API
24:04
so this is uh you can see my student API
24:04
so this is uh you can see my student API uh before testing that let me put a
24:06
uh before testing that let me put a
24:07
uh before testing that let me put a break point here to see whether any
24:09
break point here to see whether any
24:09
break point here to see whether any error comes or
24:11
error comes or
24:11
error comes or not and click on try it
24:15
not and click on try it
24:15
not and click on try it out okay currently I'm not generating ID
24:19
out okay currently I'm not generating ID
24:19
out okay currently I'm not generating ID randomly so I can say it uh any ID here
24:25
randomly so I can say it uh any ID here
24:25
randomly so I can say it uh any ID here I say it 1 2 3
24:28
I say it 1 2 3
24:28
I say it 1 2 3 and name is abib rman and then
24:39
email.com and here I can provide my
24:42
email.com and here I can provide my
24:42
email.com and here I can provide my hobbies for example uh
24:47
writing I can say reading and last one
24:54
writing I can say reading and last one
24:54
writing I can say reading and last one cing okay let's run this to see how it
24:58
cing okay let's run this to see how it
24:58
cing okay let's run this to see how it works uh first of all if I inspect this
25:01
works uh first of all if I inspect this
25:01
works uh first of all if I inspect this request it's getting all the values
25:04
request it's getting all the values
25:04
request it's getting all the values properly okay uh then go into the
25:09
properly okay uh then go into the
25:09
properly okay uh then go into the initialize function first of all check
25:12
initialize function first of all check
25:12
initialize function first of all check the client whether that have been
25:14
the client whether that have been
25:14
the client whether that have been created or not if I
25:18
see client have been created okay so
25:22
see client have been created okay so
25:22
see client have been created okay so this creates a new database name SMS and
25:26
this creates a new database name SMS and
25:26
this creates a new database name SMS and then again if I run this function it it
25:28
then again if I run this function it it
25:28
then again if I run this function it it creates a
25:30
creates a
25:30
creates a new okay continue it uh click my student
25:35
new okay continue it uh click my student
25:35
new okay continue it uh click my student insert function and
25:37
insert function and
25:37
insert function and okay so it look like a new record have
25:41
okay so it look like a new record have
25:41
okay so it look like a new record have been created so let's go to the as your
25:44
been created so let's go to the as your
25:44
been created so let's go to the as your Cosmos DB emulator
25:47
Cosmos DB emulator
25:47
Cosmos DB emulator dashboard if I refresh this and see a
25:51
dashboard if I refresh this and see a
25:51
dashboard if I refresh this and see a new database have been created with name
25:53
new database have been created with name
25:53
new database have been created with name SMS basically a student management
25:56
SMS basically a student management
25:56
SMS basically a student management system then we have a container inside
25:59
system then we have a container inside
25:59
system then we have a container inside this database name students and inside
26:03
this database name students and inside
26:03
this database name students and inside this container I can see items if I
26:06
this container I can see items if I
26:06
this container I can see items if I click on first item uh you can see my
26:09
click on first item uh you can see my
26:09
click on first item uh you can see my data is showing in Json format and it's
26:13
data is showing in Json format and it's
26:13
data is showing in Json format and it's uh ID name email hand hobes so this is
26:17
uh ID name email hand hobes so this is
26:17
uh ID name email hand hobes so this is how you can perform insert operation on
26:20
how you can perform insert operation on
26:20
how you can perform insert operation on your
26:22
your
26:22
your database
26:24
database
26:24
database okay uh let me create one or two more
26:27
okay uh let me create one or two more
26:27
okay uh let me create one or two more records
26:28
records
26:29
records inside my
26:30
inside my
26:30
inside my database and then I will uh
26:36
perform read operation on my database so
26:41
perform read operation on my database so
26:41
perform read operation on my database so here I say
26:43
here I say
26:43
here I say byes or here I can say speaking and
26:48
byes or here I can say speaking and
26:48
byes or here I can say speaking and click it
26:50
click it
26:50
click it again uh by PA the break
26:54
again uh by PA the break
26:54
again uh by PA the break points okay okay make it a little bit
26:58
points okay okay make it a little bit
26:58
points okay okay make it a little bit bit more
26:59
bit more
26:59
bit more change and test it
27:02
change and test it
27:02
change and test it with different
27:06
ID okay execute
27:10
it okay now uh three items should be in
27:14
it okay now uh three items should be in
27:14
it okay now uh three items should be in my database so here are these three
27:17
my database so here are these three
27:17
my database so here are these three items okay now I will create a new API
27:21
items okay now I will create a new API
27:21
items okay now I will create a new API uh from where I will access all my data
27:25
uh from where I will access all my data
27:25
uh from where I will access all my data so let's go to my student service and
27:27
so let's go to my student service and
27:27
so let's go to my student service and create create a new function this
27:30
create create a new function this
27:30
create create a new function this function will be I enumerable student
27:33
function will be I enumerable student
27:34
function will be I enumerable student this will provide uh list of
27:37
this will provide uh list of
27:37
this will provide uh list of student and I will say it get all
27:40
student and I will say it get all
27:40
student and I will say it get all student and here I will write my code so
27:44
student and here I will write my code so
27:44
student and here I will write my code so first of all I need to call container.
27:47
first of all I need to call container.
27:47
first of all I need to call container. get item uh Link
27:54
cable so this will provide me an IQ to
27:58
cable so this will provide me an IQ to
27:58
cable so this will provide me an IQ to as your Cosmos VD and I can perform any
28:02
as your Cosmos VD and I can perform any
28:02
as your Cosmos VD and I can perform any cury on uh this for example if you want
28:07
cury on uh this for example if you want
28:07
cury on uh this for example if you want to search data uh using any field like
28:11
to search data uh using any field like
28:11
to search data uh using any field like email or Hobbies or name or anything you
28:15
email or Hobbies or name or anything you
28:15
email or Hobbies or name or anything you can perform that here but in this case
28:18
can perform that here but in this case
28:18
can perform that here but in this case currently I will be just uh returning
28:21
currently I will be just uh returning
28:21
currently I will be just uh returning this response and I will say it
28:24
this response and I will say it
28:24
this response and I will say it inumerable
28:29
okay uh now create a new
28:32
okay uh now create a new
28:32
okay uh now create a new action inside my controller I will say
28:35
action inside my controller I will say
28:35
action inside my controller I will say it get
28:38
it get
28:38
it get all and create a new I action
28:45
result this will be getting no
28:49
result this will be getting no
28:49
result this will be getting no parameter access the student
28:52
parameter access the student
28:52
parameter access the student service do that all and then return the
28:56
service do that all and then return the
28:56
service do that all and then return the response to the user
28:59
response to the user
28:59
response to the user so let's run the code and see how it
29:01
so let's run the code and see how it
29:01
so let's run the code and see how it look
29:05
likees okay so here is my
29:08
likees okay so here is my
29:08
likees okay so here is my API uh I have missed one thing as you
29:12
API uh I have missed one thing as you
29:12
API uh I have missed one thing as you know
29:13
know
29:13
know currently I have the logic of getting
29:17
currently I have the logic of getting
29:17
currently I have the logic of getting the container inside this function uh so
29:21
the container inside this function uh so
29:21
the container inside this function uh so I have to call this initialize function
29:24
I have to call this initialize function
29:24
I have to call this initialize function uh but I want to uh I don't want to call
29:28
uh but I want to uh I don't want to call
29:28
uh but I want to uh I don't want to call this again and again so currently I will
29:32
this again and again so currently I will
29:32
this again and again so currently I will just call it here again container and I
29:36
just call it here again container and I
29:36
just call it here again container and I will say
29:41
a or I will say initialize function
29:47
a or I will say initialize function
29:47
a or I will say initialize function here this is a temporary solution but
29:50
here this is a temporary solution but
29:50
here this is a temporary solution but later on uh we can set up this inside
29:53
later on uh we can set up this inside
29:53
later on uh we can set up this inside our dependency injection so that we
29:55
our dependency injection so that we
29:55
our dependency injection so that we don't have to call this function again
29:57
don't have to call this function again
29:57
don't have to call this function again and again
29:58
and again
29:58
and again uh but for now to make it simple I think
30:03
uh but for now to make it simple I think
30:03
uh but for now to make it simple I think uh it's
30:06
okay so let's run
30:11
this now if I click on that all try it
30:16
this now if I click on that all try it
30:16
this now if I click on that all try it out and if I execute
30:21
it now you can see that uh my API is
30:24
it now you can see that uh my API is
30:24
it now you can see that uh my API is returning uh a list of students and
30:27
returning uh a list of students and
30:27
returning uh a list of students and these are three student that I have
30:29
these are three student that I have
30:29
these are three student that I have inserted in my
30:30
inserted in my
30:30
inserted in my database Habib Omar and
30:34
database Habib Omar and
30:34
database Habib Omar and Sumer so you can see that the hobbies
30:36
Sumer so you can see that the hobbies
30:37
Sumer so you can see that the hobbies are also coming uh in my nested field so
30:40
are also coming uh in my nested field so
30:40
are also coming uh in my nested field so this is the uh good thing of no SQL
30:43
this is the uh good thing of no SQL
30:44
this is the uh good thing of no SQL database you can store any type of data
30:47
database you can store any type of data
30:47
database you can store any type of data uh in your items because these are
30:49
uh in your items because these are
30:49
uh in your items because these are document based databases and they are
30:52
document based databases and they are
30:52
document based databases and they are very flexible and there is no schema
30:55
very flexible and there is no schema
30:55
very flexible and there is no schema concentrates on that
30:59
concentrates on that
30:59
concentrates on that okay now I will create another function
31:03
okay now I will create another function
31:03
okay now I will create another function that will return me single item of
31:06
that will return me single item of
31:06
that will return me single item of student on the basis of
31:08
student on the basis of
31:08
student on the basis of ID I will get call it HTTP get and this
31:13
ID I will get call it HTTP get and this
31:13
ID I will get call it HTTP get and this will be get inside this I will create a
31:18
will be get inside this I will create a
31:18
will be get inside this I will create a new
31:19
new
31:19
new action say I action result get and here
31:23
action say I action result get and here
31:23
action say I action result get and here I need
31:24
I need
31:25
I need to input the ID of the
31:30
to input the ID of the
31:30
to input the ID of the student then I will call wa. student
31:33
student then I will call wa. student
31:33
student then I will call wa. student service. getet uh I don't have get
31:37
service. getet uh I don't have get
31:37
service. getet uh I don't have get function for now so let's create that
31:42
first I will say it's task of student
31:47
first I will say it's task of student
31:48
first I will say it's task of student then get here I need to get the
31:55
id id
31:59
here I can uh call container
32:04
here I can uh call container
32:04
here I can uh call container dot read item asnc basically I want to
32:08
dot read item asnc basically I want to
32:08
dot read item asnc basically I want to read a student and I need to provide my
32:12
read a student and I need to provide my
32:12
read a student and I need to provide my ID here then the partition key so for
32:16
ID here then the partition key so for
32:16
ID here then the partition key so for now I will select partition key as none
32:20
now I will select partition key as none
32:20
now I will select partition key as none as this is an await function so I need
32:22
as this is an await function so I need
32:22
as this is an await function so I need to put an a before that also call
32:26
to put an a before that also call
32:26
to put an a before that also call initialize
32:29
initialize
32:29
initialize okay let's connect this function uh with
32:33
okay let's connect this function uh with
32:33
okay let's connect this function uh with my asp.net MVC
32:35
my asp.net MVC
32:35
my asp.net MVC action return the
32:38
action return the
32:38
action return the response so that's it so if I uh now
32:42
response so that's it so if I uh now
32:42
response so that's it so if I uh now test this and I will provide uh the ID
32:46
test this and I will provide uh the ID
32:46
test this and I will provide uh the ID for my item and this will return me that
32:50
for my item and this will return me that
32:50
for my item and this will return me that item I it out I need to put the ID of
32:54
item I it out I need to put the ID of
32:54
item I it out I need to put the ID of the student for example 1 2 3
32:58
the student for example 1 2 3
32:58
the student for example 1 2 3 and this should return me
33:00
and this should return me
33:00
and this should return me the ID uh currently it's giving an error
33:04
the ID uh currently it's giving an error
33:04
the ID uh currently it's giving an error so what is the error the response status
33:07
so what is the error the response status
33:07
so what is the error the response status code does not indicate success uh so
33:10
code does not indicate success uh so
33:10
code does not indicate success uh so let's check this what mistake we
33:16
made whether I'm providing a wrong ID or
33:22
anything so let's go to that function
33:27
anything so let's go to that function
33:27
anything so let's go to that function it's using the
33:29
it's using the
33:29
it's using the container and
33:32
container and
33:32
container and then read item AC uh it's looking
33:42
fine partion key as none is also
33:47
fine partion key as none is also
33:47
fine partion key as none is also fine uh okay let's run it again
34:03
execute and ID is 1 12
34:09
3
34:14
okay iiz
34:17
okay iiz
34:17
okay iiz [Music]
34:29
[Music]
34:55
okay this
34:57
okay this
34:57
okay this [Music]
35:06
[Music]
35:10
[Music]
35:10
[Music] I and as I'm going to delete student and
35:14
I and as I'm going to delete student and
35:14
I and as I'm going to delete student and here I need
35:17
here I need
35:17
here I need to and then the par key
35:24
as the same function as well so let's
35:28
as the same function as well so let's
35:28
as the same function as well so let's see whether it works or it gives error
35:32
see whether it works or it gives error
35:32
see whether it works or it gives error also now I will say it HTTP
35:36
also now I will say it HTTP
35:36
also now I will say it HTTP delete the name will be
35:39
delete the name will be
35:39
delete the name will be delete and then public casing
35:42
delete and then public casing
35:42
delete and then public casing cross I action
35:47
[Music]
35:50
[Music]
35:50
[Music] result spring as
35:55
ID if it come success
35:58
ID if it come success
35:58
ID if it come success sucessfully then I will say student
36:05
Del and call the delete function
36:11
here uh let's TR this
36:28
I will
36:31
[Music]
36:38
[Music]
36:42
provide so now we have to it
36:48
provide so now we have to it
36:48
provide so now we have to it look if I say Cosmos
36:52
look if I say Cosmos
36:52
look if I say Cosmos is not found so it means
36:58
is not found so it means
36:58
is not found so it means the item that
37:00
the item that
37:00
the item that we need
37:04
[Music]
37:48
[Music]
38:26
[Music]
38:26
[Music] d a
38:30
d a
38:30
d a [Music]
38:57
[Music]
38:57
[Music] n
39:01
[Music]
39:16
[Music]
39:53
[Music]
39:53
[Music] d
39:57
d
39:58
d
39:58
d [Music]
40:39
hello
40:41
hello
40:41
hello guys welcome back I lost the connection
40:45
guys welcome back I lost the connection
40:45
guys welcome back I lost the connection uh I just check
40:48
uh I just check
40:48
uh I just check that okay so
40:52
I was talking about how we can move
40:58
I was talking about how we can move
40:58
I was talking about how we can move or uh end point
41:02
and toen uh from hardcoded to our app
41:06
and toen uh from hardcoded to our app
41:06
and toen uh from hardcoded to our app setting so I
41:12
have uh created a new key in my app
41:15
have uh created a new key in my app
41:15
have uh created a new key in my app setting and its name is aor Cosmos GB
41:19
setting and its name is aor Cosmos GB
41:19
setting and its name is aor Cosmos GB then we have URL and key so we'll be
41:22
then we have URL and key so we'll be
41:22
then we have URL and key so we'll be reading uh this data
41:25
reading uh this data
41:25
reading uh this data from so first of all uh I will get
41:29
from so first of all uh I will get
41:29
from so first of all uh I will get my configuration and inside this
41:32
my configuration and inside this
41:32
my configuration and inside this configuration I will say
41:35
configuration I will say
41:35
configuration I will say URL currently I'm using it reading it
41:39
URL currently I'm using it reading it
41:39
URL currently I'm using it reading it [Music]
41:47
man uh but you guys can also use options
41:50
man uh but you guys can also use options
41:50
man uh but you guys can also use options pattern
42:22
this um but I think it's
42:27
this um but I think it's
42:27
this um but I think it's enough for now and here I will say it
42:31
enough for now and here I will say it
42:32
enough for now and here I will say it key
42:33
key
42:33
key things to my
42:38
connection so pause this key here
42:43
connection so pause this key here
42:43
connection so pause this key here okay let's run this to see
42:50
whether it's working or not
43:02
okay so my solution is running now if I
43:05
okay so my solution is running now if I
43:05
okay so my solution is running now if I go to my get
43:09
all okay so I hope
43:17
that's okay so I thinkr know guys
43:30
let's wait for a few second and see if
43:32
let's wait for a few second and see if
43:32
let's wait for a few second and see if anyone have any
43:39
questions okay one thing left uh that I
43:41
questions okay one thing left uh that I
43:42
questions okay one thing left uh that I need to share you guys can also access
43:45
need to share you guys can also access
43:45
need to share you guys can also access this code on my GitHub repo so let me
43:48
this code on my GitHub repo so let me
43:48
this code on my GitHub repo so let me push that as well R operations for
43:52
push that as well R operations for
43:52
push that as well R operations for student using Cosmos
43:55
student using Cosmos
43:55
student using Cosmos DB uh let let me push this so that you
43:59
DB uh let let me push this so that you
43:59
DB uh let let me push this so that you guys can access
44:05
it let's refresh
44:09
it let's refresh
44:09
it let's refresh it
44:11
it
44:11
it okay so I am
44:13
okay so I am
44:13
okay so I am creating uh a new Branch for each
44:16
creating uh a new Branch for each
44:16
creating uh a new Branch for each episode so here if you guys are
44:20
episode so here if you guys are
44:20
episode so here if you guys are interested uh to download the code or uh
44:24
interested uh to download the code or uh
44:24
interested uh to download the code or uh explore the same thing you can access
44:27
explore the same thing you can access
44:27
explore the same thing you can access this code from my GitHub
44:29
this code from my GitHub
44:29
this code from my GitHub repo uh my GitHub account is Habib D
44:32
repo uh my GitHub account is Habib D
44:32
repo uh my GitHub account is Habib D developer and this repo is a public repo
44:35
developer and this repo is a public repo
44:35
developer and this repo is a public repo so you can access it
44:39
so you can access it
44:39
so you can access it so I will also share uh this
44:44
so I will also share uh this
44:44
so I will also share uh this Rao inside comments so you guys
44:50
Rao inside comments so you guys
44:50
Rao inside comments so you guys can that please
45:05
that's it
45:10
[Music]


