0:34
hey this is your host shiban and welcome
0:37
hey this is your host shiban and welcome
0:37
hey this is your host shiban and welcome to my show aure essential series episode
0:40
to my show aure essential series episode
0:40
to my show aure essential series episode 4 so in this episode we will talk about
0:43
4 so in this episode we will talk about
0:43
4 so in this episode we will talk about a your SQL database and how to integrate
0:47
a your SQL database and how to integrate
0:47
a your SQL database and how to integrate it with Azure functions uh so first of
0:50
it with Azure functions uh so first of
0:50
it with Azure functions uh so first of all uh basically Azure SQL Server is a
0:52
all uh basically Azure SQL Server is a
0:53
all uh basically Azure SQL Server is a fully managed relational database
0:54
fully managed relational database
0:54
fully managed relational database Service uh provided by Microsoft aure it
0:58
Service uh provided by Microsoft aure it
0:58
Service uh provided by Microsoft aure it based on SQL server database engines and
1:01
based on SQL server database engines and
1:01
based on SQL server database engines and offer the same
1:04
offer the same capabilities with additional Cloud
1:06
capabilities with additional Cloud
1:06
capabilities with additional Cloud specific features likeor SQL supports uh
1:10
specific features likeor SQL supports uh
1:10
specific features likeor SQL supports uh various deployment options uh including
1:13
various deployment options uh including
1:13
various deployment options uh including aor SQL database SQL manage instance and
1:16
aor SQL database SQL manage instance and
1:16
aor SQL database SQL manage instance and you can also use SQL server on as your
1:20
you can also use SQL server on as your
1:20
you can also use SQL server on as your virtual machine so uh these are
1:22
virtual machine so uh these are
1:22
virtual machine so uh these are different models available uh so let's
1:24
different models available uh so let's
1:24
different models available uh so let's start
1:26
start this uh this is the agenda of our show
1:29
this uh this is the agenda of our show
1:29
this uh this is the agenda of our show we will talk about uh aure SQL database
1:33
we will talk about uh aure SQL database
1:33
we will talk about uh aure SQL database then we will configure Azure SQL
1:35
then we will configure Azure SQL
1:35
then we will configure Azure SQL database using Azure portal first of all
1:38
database using Azure portal first of all
1:38
database using Azure portal first of all we have to create SQL server and then we
1:41
we have to create SQL server and then we
1:41
we have to create SQL server and then we have to create SQL database then we will
1:44
have to create SQL database then we will
1:44
have to create SQL database then we will uh May uh few firewall changes to allow
1:47
uh May uh few firewall changes to allow
1:47
uh May uh few firewall changes to allow our remote connection to the database
1:50
our remote connection to the database
1:50
our remote connection to the database and at the end we will have integration
1:52
and at the end we will have integration
1:52
and at the end we will have integration with Z
1:54
with Z function and of course at the end we
1:56
function and of course at the end we
1:56
function and of course at the end we will have a QA session so let's start
1:59
will have a QA session so let's start
1:59
will have a QA session so let's start this
2:00
this this is my introduction uh I'm sopner MP
2:04
this is my introduction uh I'm sopner MP
2:04
this is my introduction uh I'm sopner MP Microsoft certified solution developer
2:06
Microsoft certified solution developer
2:06
Microsoft certified solution developer and currently working as a lead
2:08
and currently working as a lead
2:08
and currently working as a lead developer of no
2:10
developer of no software okay so first of
2:13
software okay so first of
2:13
software okay so first of all your SQL database uh basically it's
2:17
all your SQL database uh basically it's
2:17
all your SQL database uh basically it's a fully managed Service uh provided by
2:20
a fully managed Service uh provided by
2:20
a fully managed Service uh provided by Microsoft as your uh so uh
2:24
Microsoft as your uh so uh
2:24
Microsoft as your uh so uh they handles maintenance matching
2:27
they handles maintenance matching
2:27
they handles maintenance matching backups and they also
2:30
backups and they also
2:30
backups and they also and uh the main uh the main benefit is
2:33
and uh the main uh the main benefit is
2:33
and uh the main uh the main benefit is that it also reduce the administrative
2:35
that it also reduce the administrative
2:35
that it also reduce the administrative overhead of on our teams uh then we have
2:39
overhead of on our teams uh then we have
2:39
overhead of on our teams uh then we have scalability it supports uh scaling up
2:42
scalability it supports uh scaling up
2:42
scalability it supports uh scaling up and scaling down without any downtime
2:44
and scaling down without any downtime
2:45
and scaling down without any downtime you can uh you can set automatic rules
2:48
you can uh you can set automatic rules
2:48
you can uh you can set automatic rules for scaling of your your SQL database so
2:51
for scaling of your your SQL database so
2:51
for scaling of your your SQL database so that you can handle uh any Dynamic
2:54
that you can handle uh any Dynamic
2:54
that you can handle uh any Dynamic traffic so that's a good option then we
2:56
traffic so that's a good option then we
2:56
traffic so that's a good option then we have high
2:57
have high availability Z provides uh building in
2:59
availability Z provides uh building in
3:00
availability Z provides uh building in high availability with automic failure
3:02
high availability with automic failure
3:02
high availability with automic failure and
3:04
and GE application uh so it means if one of
3:08
GE application uh so it means if one of
3:08
GE application uh so it means if one of your instance or uh one of your database
3:11
your instance or uh one of your database
3:11
your instance or uh one of your database is down you don't have to be worried
3:13
is down you don't have to be worried
3:13
is down you don't have to be worried about Azor automatically handle that
3:16
about Azor automatically handle that
3:16
about Azor automatically handle that then we have Security Options Microsoft
3:18
then we have Security Options Microsoft
3:18
then we have Security Options Microsoft Azor offers Advanced security features
3:21
Azor offers Advanced security features
3:21
Azor offers Advanced security features like encryption uh threat detection and
3:24
like encryption uh threat detection and
3:24
like encryption uh threat detection and compliance with industry standards uh so
3:27
compliance with industry standards uh so
3:27
compliance with industry standards uh so all these uh features are build and
3:29
all these uh features are build and
3:29
all these uh features are build and available well then we have intelligent
3:31
available well then we have intelligent
3:31
available well then we have intelligent performance Microsoft a your databases
3:34
performance Microsoft a your databases
3:34
performance Microsoft a your databases basically uses machine learning and
3:36
basically uses machine learning and
3:36
basically uses machine learning and artificial intelligence to optimize
3:39
artificial intelligence to optimize
3:39
artificial intelligence to optimize performance automatically uh then we
3:41
performance automatically uh then we
3:41
performance automatically uh then we have very easy integration with other
3:44
have very easy integration with other
3:44
have very easy integration with other Azure services and tools like a your
3:46
Azure services and tools like a your
3:47
Azure services and tools like a your data Factory powerb a your devops H and
3:50
data Factory powerb a your devops H and
3:50
data Factory powerb a your devops H and then we have very flexible deployment
3:52
then we have very flexible deployment
3:52
then we have very flexible deployment options it supports multiple deployment
3:55
options it supports multiple deployment
3:55
options it supports multiple deployment options to uh suit different scenarios
3:58
options to uh suit different scenarios
3:58
options to uh suit different scenarios and migration FS
4:01
and migration FS so uh next we
4:04
have pros of a SQL Server
4:08
have pros of a SQL Server
4:08
have pros of a SQL Server database uh first of all the main
4:10
database uh first of all the main
4:10
database uh first of all the main advantage of a SQL Server database is
4:12
advantage of a SQL Server database is
4:12
advantage of a SQL Server database is manage Service uh so it basically
4:14
manage Service uh so it basically
4:14
manage Service uh so it basically reduces the administrative TOS uh you
4:17
reduces the administrative TOS uh you
4:17
reduces the administrative TOS uh you don't have uh you don't have to hire a
4:20
don't have uh you don't have to hire a
4:20
don't have uh you don't have to hire a database administrator for handling
4:22
database administrator for handling
4:22
database administrator for handling maintenance and updates of your database
4:24
maintenance and updates of your database
4:24
maintenance and updates of your database Microsoft asure will automatically patch
4:28
Microsoft asure will automatically patch
4:28
Microsoft asure will automatically patch any new update or secur issues uh then
4:31
any new update or secur issues uh then
4:31
any new update or secur issues uh then it's easily scalable and down time is
4:35
it's easily scalable and down time is
4:35
it's easily scalable and down time is literally zero then it is highly
4:38
literally zero then it is highly
4:38
literally zero then it is highly available and it provides Disaster
4:40
available and it provides Disaster
4:40
available and it provides Disaster Recovery features uh so if one of you
4:44
Recovery features uh so if one of you
4:45
Recovery features uh so if one of you are uh region is down uh then uh still
4:48
are uh region is down uh then uh still
4:48
are uh region is down uh then uh still it will be available from other Geo
4:50
it will be available from other Geo
4:50
it will be available from other Geo redundant locations uh then we have a
4:52
redundant locations uh then we have a
4:53
redundant locations uh then we have a security and
4:54
security and compliance Microsoft has will provide us
4:56
compliance Microsoft has will provide us
4:56
compliance Microsoft has will provide us Advanced security features and
4:58
Advanced security features and
4:58
Advanced security features and compliance with major standards ensure
5:02
compliance with major standards ensure
5:02
compliance with major standards ensure data protection uh it provides different
5:05
data protection uh it provides different
5:05
data protection uh it provides different options to uh secure our database you
5:08
options to uh secure our database you
5:08
options to uh secure our database you can uh you can apply firewall rules you
5:11
can uh you can apply firewall rules you
5:11
can uh you can apply firewall rules you can apply uh SQL Server authentication
5:15
can apply uh SQL Server authentication
5:15
can apply uh SQL Server authentication or you can use Microsoft inv ID for
5:18
or you can use Microsoft inv ID for
5:18
or you can use Microsoft inv ID for authentication of SQL Server database
5:21
authentication of SQL Server database
5:21
authentication of SQL Server database then we have integration with AOS
5:23
then we have integration with AOS
5:24
then we have integration with AOS ecosystem as uh as your SQL database is
5:27
ecosystem as uh as your SQL database is
5:27
ecosystem as uh as your SQL database is part of azure ecosystem uh so Microsoft
5:31
part of azure ecosystem uh so Microsoft
5:31
part of azure ecosystem uh so Microsoft provides uh a lot of plugins or Services
5:35
provides uh a lot of plugins or Services
5:35
provides uh a lot of plugins or Services which are easily uh connectable with uh
5:38
which are easily uh connectable with uh
5:38
which are easily uh connectable with uh Azure database it also provide different
5:41
Azure database it also provide different
5:41
Azure database it also provide different migration tools uh so you can use these
5:45
migration tools uh so you can use these
5:45
migration tools uh so you can use these tools and services uh for while
5:47
tools and services uh for while
5:47
tools and services uh for while migrating your existing database to as
5:49
migrating your existing database to as
5:49
migrating your existing database to as your SQL Server so uh then we have a few
5:54
your SQL Server so uh then we have a few
5:54
your SQL Server so uh then we have a few cons of aor SQL Server database first of
5:57
cons of aor SQL Server database first of
5:57
cons of aor SQL Server database first of all we have cost aor SQL server uh
6:00
all we have cost aor SQL server uh
6:00
all we have cost aor SQL server uh databases can be uh expensive especially
6:03
databases can be uh expensive especially
6:03
databases can be uh expensive especially for high performance and high
6:04
for high performance and high
6:04
for high performance and high availability configuration for example
6:07
availability configuration for example
6:07
availability configuration for example if you
6:09
if you want high performance you need High CPU
6:12
want high performance you need High CPU
6:12
want high performance you need High CPU codes or high database memory and for
6:14
codes or high database memory and for
6:15
codes or high database memory and for availability purpose you need your
6:16
availability purpose you need your
6:16
availability purpose you need your location so of course if uh you have a
6:19
location so of course if uh you have a
6:19
location so of course if uh you have a lot of features then you have to pay for
6:21
lot of features then you have to pay for
6:21
lot of features then you have to pay for that then we have complexity and pricing
6:24
that then we have complexity and pricing
6:24
that then we have complexity and pricing uh basically as your SQL database
6:27
uh basically as your SQL database
6:27
uh basically as your SQL database pricing model is a little bit different
6:28
pricing model is a little bit different
6:28
pricing model is a little bit different you have to pay
6:30
you have to pay uh according to your usage according to
6:32
uh according to your usage according to
6:32
uh according to your usage according to your request and storage and there is
6:36
your request and storage and there is
6:36
your request and storage and there is also few tool to optimize these cost
6:39
also few tool to optimize these cost
6:39
also few tool to optimize these cost then we have a learning c as a database
6:41
then we have a learning c as a database
6:41
then we have a learning c as a database administrator you have to be uh familiar
6:45
administrator you have to be uh familiar
6:45
administrator you have to be uh familiar with as your specific features then you
6:47
with as your specific features then you
6:47
with as your specific features then you will be able to administrate uh that
6:50
will be able to administrate uh that
6:50
will be able to administrate uh that databases then we have limited control
6:52
databases then we have limited control
6:52
databases then we have limited control as it is an uh IAS Service uh so you
6:56
as it is an uh IAS Service uh so you
6:56
as it is an uh IAS Service uh so you have very little control on your
6:58
have very little control on your
6:58
have very little control on your databases
7:00
databases as compared to on premises deployments
7:03
as compared to on premises deployments
7:03
as compared to on premises deployments uh then we have a dependency on internet
7:05
uh then we have a dependency on internet
7:05
uh then we have a dependency on internet connection for example if you are
7:07
connection for example if you are
7:07
connection for example if you are hosting your website or any
7:09
hosting your website or any
7:09
hosting your website or any application on your own server on
7:13
application on your own server on
7:13
application on your own server on Primacy server and you are using a your
7:16
Primacy server and you are using a your
7:16
Primacy server and you are using a your SQL Server database then you have to
7:18
SQL Server database then you have to
7:18
SQL Server database then you have to rely on internet connection uh so this
7:20
rely on internet connection uh so this
7:20
rely on internet connection uh so this may be one disadvantage of a your SQ
7:24
may be one disadvantage of a your SQ
7:24
may be one disadvantage of a your SQ databases then we have deployment
7:27
databases then we have deployment
7:27
databases then we have deployment options first of all we have a z
7:29
options first of all we have a z
7:29
options first of all we have a z database database is basically a single
7:32
database database is basically a single
7:32
database database is basically a single database uh with its own set of
7:35
database uh with its own set of
7:35
database uh with its own set of resources managed by a logical server uh
7:38
resources managed by a logical server uh
7:38
resources managed by a logical server uh so this one is ideal for modern Cloud
7:41
so this one is ideal for modern Cloud
7:41
so this one is ideal for modern Cloud application with variable usage pattern
7:44
application with variable usage pattern
7:44
application with variable usage pattern uh so this is just like shared database
7:47
uh so this is just like shared database
7:47
uh so this is just like shared database Microsoft is managing the SQL Server
7:49
Microsoft is managing the SQL Server
7:49
Microsoft is managing the SQL Server instance and you just you are just uh
7:52
instance and you just you are just uh
7:52
instance and you just you are just uh creating a new database on so you have
7:54
creating a new database on so you have
7:55
creating a new database on so you have very limited control in this
7:56
very limited control in this
7:56
very limited control in this Cas then we have SQL managed instance uh
8:01
Cas then we have SQL managed instance uh
8:01
Cas then we have SQL managed instance uh so you can also create a managed
8:05
so you can also create a managed
8:05
so you can also create a managed instance of SQL server on aure uh it
8:09
instance of SQL server on aure uh it
8:09
instance of SQL server on aure uh it offers 100% compatibility with the own
8:11
offers 100% compatibility with the own
8:11
offers 100% compatibility with the own premises SQL server and it is very
8:14
premises SQL server and it is very
8:14
premises SQL server and it is very suitable for lift and shift migration so
8:16
suitable for lift and shift migration so
8:16
suitable for lift and shift migration so in this case you have more control on
8:19
in this case you have more control on
8:19
in this case you have more control on your uh database but still you don't
8:21
your uh database but still you don't
8:21
your uh database but still you don't have control at OS level OS level then
8:24
have control at OS level OS level then
8:24
have control at OS level OS level then we have SQL server on aure Virtual
8:26
we have SQL server on aure Virtual
8:26
we have SQL server on aure Virtual machines
8:28
machines so this this uh one provides You full
8:31
so this this uh one provides You full
8:31
so this this uh one provides You full control over
8:32
control over the SQL Server instance uh because it is
8:36
the SQL Server instance uh because it is
8:36
the SQL Server instance uh because it is running on your virtual machine and it's
8:39
running on your virtual machine and it's
8:39
running on your virtual machine and it's ideal for applications uh where you
8:41
ideal for applications uh where you
8:41
ideal for applications uh where you required OS level uh access and third
8:44
required OS level uh access and third
8:44
required OS level uh access and third party integration so these are uh few
8:46
party integration so these are uh few
8:46
party integration so these are uh few deployment models uh so let's start
8:50
deployment models uh so let's start
8:50
deployment models uh so let's start this let me share my screen uh first of
8:54
this let me share my screen uh first of
8:54
this let me share my screen uh first of all we will go to as your panel
9:10
so here is uh the Azure uh essential
9:13
so here is uh the Azure uh essential
9:13
so here is uh the Azure uh essential series uh solution so today I have
9:17
series uh solution so today I have
9:17
series uh solution so today I have created a new as your function project
9:19
created a new as your function project
9:19
created a new as your function project uh so we will be playing in
9:30
side this uh but so you can uh create
9:34
side this uh but so you can uh create
9:34
side this uh but so you can uh create this on as your portal or if you don't
9:37
this on as your portal or if you don't
9:37
this on as your portal or if you don't have access or you don't have uh card or
9:40
have access or you don't have uh card or
9:40
have access or you don't have uh card or credit card to create subscription so
9:42
credit card to create subscription so
9:42
credit card to create subscription so you can use a local SQL Server databases
9:45
you can use a local SQL Server databases
9:45
you can use a local SQL Server databases but now I will show you how to create uh
9:48
but now I will show you how to create uh
9:48
but now I will show you how to create uh SQL database on
9:51
SQL database on a for creating SQL Server database first
9:55
a for creating SQL Server database first
9:55
a for creating SQL Server database first of all you have to create an instance so
9:58
of all you have to create an instance so
9:58
of all you have to create an instance so instance is basically the server uh
10:01
instance is basically the server uh
10:01
instance is basically the server uh where you will create your database so
10:03
where you will create your database so
10:03
where you will create your database so one instance can have multiple databases
10:06
one instance can have multiple databases
10:06
one instance can have multiple databases so let's see how to create SQL
10:09
so let's see how to create SQL
10:09
so let's see how to create SQL Server I just opened this window first
10:11
Server I just opened this window first
10:11
Server I just opened this window first of all uh you have to select a resource
10:14
of all uh you have to select a resource
10:14
of all uh you have to select a resource Group uh resource uh group is basically
10:17
Group uh resource uh group is basically
10:17
Group uh resource uh group is basically a grouping of all the uh AO resources
10:20
a grouping of all the uh AO resources
10:21
a grouping of all the uh AO resources for example if you are working on a
10:22
for example if you are working on a
10:22
for example if you are working on a project uh you can use uh this option
10:25
project uh you can use uh this option
10:25
project uh you can use uh this option for grouping Ur as your resources then
10:27
for grouping Ur as your resources then
10:27
for grouping Ur as your resources then we have a server name
10:30
we have a server name
10:30
we have a server name this is basically SQL Server instance
10:32
this is basically SQL Server instance
10:32
this is basically SQL Server instance name so you can put any of this for
10:35
name so you can put any of this for
10:35
name so you can put any of this for example my case I can say uh as your
10:38
example my case I can say uh as your
10:38
example my case I can say uh as your essential series AES okay uh AES is
10:44
essential series AES okay uh AES is
10:44
essential series AES okay uh AES is already taken by
10:47
someone so let's try this this name is
10:51
someone so let's try this this name is
10:51
someone so let's try this this name is already uh taken
10:56
then okay this name is available the
10:59
then okay this name is available the
10:59
then okay this name is available the name is AE basically Azure essential
11:02
name is AE basically Azure essential
11:02
name is AE basically Azure essential Lear so this will be the domain for
11:06
Lear so this will be the domain for
11:06
Lear so this will be the domain for connecting with Azure SQL Server
11:08
connecting with Azure SQL Server
11:08
connecting with Azure SQL Server database then we have authentication
11:11
database then we have authentication
11:11
database then we have authentication method you can use Microsoft inra only
11:14
method you can use Microsoft inra only
11:14
method you can use Microsoft inra only authentication uh you can use SQL
11:17
authentication uh you can use SQL
11:17
authentication uh you can use SQL authentication or you can use uh both
11:19
authentication or you can use uh both
11:19
authentication or you can use uh both options so in my case I'm going to use
11:22
options so in my case I'm going to use
11:22
options so in my case I'm going to use SQL authentication uh first of all uh we
11:25
SQL authentication uh first of all uh we
11:25
SQL authentication uh first of all uh we need to
11:26
need to put uh admin user name then we have to
11:31
put uh admin user name then we have to
11:32
put uh admin user name then we have to provide
11:37
password okay password matches and
11:39
password okay password matches and
11:39
password okay password matches and confirm so let's move to the next
11:42
confirm so let's move to the next
11:42
confirm so let's move to the next section we have networking we can add
11:45
section we have networking we can add
11:45
section we have networking we can add firewall rules uh here uh but currently
11:49
firewall rules uh here uh but currently
11:49
firewall rules uh here uh but currently I'm going with no option later on I will
11:50
I'm going with no option later on I will
11:50
I'm going with no option later on I will show you how to do this then click on
11:54
show you how to do this then click on
11:54
show you how to do this then click on security uh so I will not select any
11:58
security uh so I will not select any
11:58
security uh so I will not select any option for now you can also put uh tags
12:01
option for now you can also put uh tags
12:01
option for now you can also put uh tags here uh tags are
12:04
here uh tags are basically used for searching your uh
12:07
basically used for searching your uh
12:07
basically used for searching your uh resources or you can uh TX specific
12:10
resources or you can uh TX specific
12:10
resources or you can uh TX specific thing with this server so that you can
12:11
thing with this server so that you can
12:11
thing with this server so that you can know for which purpose you are using
12:13
know for which purpose you are using
12:13
know for which purpose you are using this server so this
12:16
this server so this is uh the summary screen or review
12:18
is uh the summary screen or review
12:18
is uh the summary screen or review screen of creating SQL Server charges so
12:21
screen of creating SQL Server charges so
12:21
screen of creating SQL Server charges so let's create
12:26
this basically it will take few minutes
12:29
this basically it will take few minutes
12:29
this basically it will take few minutes uh to set up SQL Server data instance uh
12:32
uh to set up SQL Server data instance uh
12:32
uh to set up SQL Server data instance uh so you can see that a deployment has
12:34
so you can see that a deployment has
12:34
so you can see that a deployment has been initialized I already have created
12:37
been initialized I already have created
12:37
been initialized I already have created one SQL Server uh so I will show you how
12:40
one SQL Server uh so I will show you how
12:40
one SQL Server uh so I will show you how to create SQL database uh so click on uh
12:45
to create SQL database uh so click on uh
12:45
to create SQL database uh so click on uh SQL databases or you can search SQL
12:47
SQL databases or you can search SQL
12:47
SQL databases or you can search SQL database I already have created one SQL
12:50
database I already have created one SQL
12:50
database I already have created one SQL Server database uh but in this case I am
12:54
Server database uh but in this case I am
12:54
Server database uh but in this case I am going to create another
12:55
going to create another
12:55
going to create another database click on create option
13:01
okay so here first of all again you have
13:04
okay so here first of all again you have
13:04
okay so here first of all again you have to select your resource Group I have I'm
13:08
to select your resource Group I have I'm
13:08
to select your resource Group I have I'm using the same Resource Group uh then uh
13:11
using the same Resource Group uh then uh
13:11
using the same Resource Group uh then uh we need to provide the database name so
13:13
we need to provide the database name so
13:13
we need to provide the database name so here you can uh put any uh database name
13:17
here you can uh put any uh database name
13:17
here you can uh put any uh database name you can say yes
13:24
learn then uh there is one option want
13:26
learn then uh there is one option want
13:26
learn then uh there is one option want to use SQL IL elastic pool is basically
13:30
to use SQL IL elastic pool is basically
13:30
to use SQL IL elastic pool is basically for uh when you have multiple instance
13:34
for uh when you have multiple instance
13:34
for uh when you have multiple instance of SQL Server databases and you are
13:36
of SQL Server databases and you are
13:36
of SQL Server databases and you are using scalability and those things then
13:38
using scalability and those things then
13:38
using scalability and those things then you need to use SQL tool So currently
13:41
you need to use SQL tool So currently
13:41
you need to use SQL tool So currently I'm going with no option and then we
13:43
I'm going with no option and then we
13:43
I'm going with no option and then we need to select workload environment as I
13:45
need to select workload environment as I
13:45
need to select workload environment as I am doing this just for development
13:47
am doing this just for development
13:47
am doing this just for development purpose so I will select
13:50
purpose so I will select
13:50
purpose so I will select development uh then we have backup
13:52
development uh then we have backup
13:52
development uh then we have backup storage redundancy option you can make
13:55
storage redundancy option you can make
13:55
storage redundancy option you can make it only uh locally redundant backup
13:57
it only uh locally redundant backup
13:57
it only uh locally redundant backup storage we have Zone redundant backup
13:59
storage we have Zone redundant backup
13:59
storage we have Zone redundant backup storage we have Geo redundant backup
14:01
storage we have Geo redundant backup
14:01
storage we have Geo redundant backup storage so these are different options
14:03
storage so these are different options
14:03
storage so these are different options you can learn more about from uh
14:05
you can learn more about from uh
14:05
you can learn more about from uh Microsoft website so I will go go with
14:08
Microsoft website so I will go go with
14:08
Microsoft website so I will go go with locally rund backup storage because I
14:11
locally rund backup storage because I
14:11
locally rund backup storage because I don't need to be worried about and uh
14:15
don't need to be worried about and uh
14:15
don't need to be worried about and uh here is the cost summary showing for our
14:17
here is the cost summary showing for our
14:17
here is the cost summary showing for our SQL Server database and this cost is uh
14:21
SQL Server database and this cost is uh
14:21
SQL Server database and this cost is uh for GB uh and per month so the estimated
14:26
for GB uh and per month so the estimated
14:26
for GB uh and per month so the estimated cost 4.7
14:29
cost 4.7 USD for one month using but still it may
14:32
USD for one month using but still it may
14:32
USD for one month using but still it may vary uh depends on your storage and your
14:35
vary uh depends on your storage and your
14:35
vary uh depends on your storage and your uh requests so let move to networking
14:38
uh requests so let move to networking
14:38
uh requests so let move to networking section here you can also set few
14:40
section here you can also set few
14:40
section here you can also set few firewall
14:43
rules so these are options uh then we
14:46
rules so these are options uh then we
14:46
rules so these are options uh then we have Security Options inside security
14:48
have Security Options inside security
14:48
have Security Options inside security you can enable Microsoft defend uh
14:51
you can enable Microsoft defend uh
14:51
you can enable Microsoft defend uh basically it's buildin uh antivirus so
14:54
basically it's buildin uh antivirus so
14:54
basically it's buildin uh antivirus so you can use this service as well and
14:56
you can use this service as well and
14:57
you can use this service as well and there are few other options available
14:59
there are few other options available
14:59
there are few other options available for encryption so I don't need it for
15:03
for encryption so I don't need it for
15:03
for encryption so I don't need it for now then we have additional setting uh
15:06
now then we have additional setting uh
15:06
now then we have additional setting uh where you can define whether you want to
15:08
where you can define whether you want to
15:08
where you can define whether you want to use existing backup or simple database
15:11
use existing backup or simple database
15:11
use existing backup or simple database so in my case I'm going uh
15:13
so in my case I'm going uh
15:13
so in my case I'm going uh [Music]
15:14
[Music] to uh not select any of one then we have
15:18
to uh not select any of one then we have
15:19
to uh not select any of one then we have text and then we have review and create
15:22
text and then we have review and create
15:22
text and then we have review and create so now if I click on create button this
15:24
so now if I click on create button this
15:24
so now if I click on create button this will create a new database
15:29
So currently Microsoft is uh Microsoft
15:31
So currently Microsoft is uh Microsoft
15:31
So currently Microsoft is uh Microsoft as your is validating my requirement uh
15:34
as your is validating my requirement uh
15:34
as your is validating my requirement uh then it will initialize the deployment
15:36
then it will initialize the deployment
15:36
then it will initialize the deployment so basically uh the deployment
15:39
so basically uh the deployment
15:39
so basically uh the deployment shows uh is uh Azure is creating a new
15:42
shows uh is uh Azure is creating a new
15:42
shows uh is uh Azure is creating a new database server or new database for
15:47
you okay let's uh go to
15:53
home let's go to home and then inside
15:57
home let's go to home and then inside
15:57
home let's go to home and then inside SQL servers
16:00
SQL servers so you can see that uh the new SQL
16:02
so you can see that uh the new SQL
16:02
so you can see that uh the new SQL Server have been
16:04
Server have been created okay and if you want to see how
16:07
created okay and if you want to see how
16:07
created okay and if you want to see how many databases are inside This Server so
16:09
many databases are inside This Server so
16:09
many databases are inside This Server so you can move to SQL databases So
16:11
you can move to SQL databases So
16:11
you can move to SQL databases So currently there is no
16:18
database uh then we have another SQL
16:22
database uh then we have another SQL
16:22
database uh then we have another SQL Server
16:24
Server database okay this one is the uh old
16:26
database okay this one is the uh old
16:26
database okay this one is the uh old database uh currently my new database is
16:30
database uh currently my new database is
16:30
database uh currently my new database is not yet created so you can see that
16:32
not yet created so you can see that
16:32
not yet created so you can see that deployment is still in
16:34
deployment is still in
16:34
deployment is still in progress so meanwhile uh let's move to
16:37
progress so meanwhile uh let's move to
16:37
progress so meanwhile uh let's move to the code and I will show you how uh I
16:41
the code and I will show you how uh I
16:41
the code and I will show you how uh I will configure my Azure functions to use
16:44
will configure my Azure functions to use
16:44
will configure my Azure functions to use uh SQL Server
16:46
uh SQL Server databases first of all I have created
16:49
databases first of all I have created
16:49
databases first of all I have created one uh project here and then I have
16:53
one uh project here and then I have
16:53
one uh project here and then I have created a few models
16:59
and these models basically will be used
17:01
and these models basically will be used
17:01
and these models basically will be used for binding with Microsoft SQL Server uh
17:06
for binding with Microsoft SQL Server uh
17:06
for binding with Microsoft SQL Server uh so let's
17:08
so let's see this uh first of all I have emply
17:12
see this uh first of all I have emply
17:12
see this uh first of all I have emply model okay uh this is uh basically
17:15
model okay uh this is uh basically
17:15
model okay uh this is uh basically representing or you can say that this is
17:18
representing or you can say that this is
17:18
representing or you can say that this is the entity model I will create a new
17:20
the entity model I will create a new
17:20
the entity model I will create a new table inside my database with name imply
17:23
table inside my database with name imply
17:23
table inside my database with name imply and that table will have these three
17:25
and that table will have these three
17:25
and that table will have these three properties so this is my database model
17:30
properties so this is my database model
17:30
properties so this is my database model okay so currently I have just
17:33
okay so currently I have just
17:33
okay so currently I have just uncommented
17:35
uncommented this uh then I have created one function
17:40
this uh then I have created one function
17:40
this uh then I have created one function this function is basically HTTP trigger
17:42
this function is basically HTTP trigger
17:42
this function is basically HTTP trigger function and the authorization level is
17:44
function and the authorization level is
17:44
function and the authorization level is anonymous uh and this function is
17:46
anonymous uh and this function is
17:46
anonymous uh and this function is basically HTTP get
17:53
function and this is my HTTP request
17:56
function and this is my HTTP request
17:56
function and this is my HTTP request data then I am using SQL input uh
18:00
data then I am using SQL input uh
18:01
data then I am using SQL input uh basically in Aur isolated uh worker
18:04
basically in Aur isolated uh worker
18:04
basically in Aur isolated uh worker models uh we have these binding
18:07
models uh we have these binding
18:07
models uh we have these binding attributes we have SQL input and we have
18:10
attributes we have SQL input and we have
18:10
attributes we have SQL input and we have SQL output SQL input is basically used
18:13
SQL output SQL input is basically used
18:13
SQL output SQL input is basically used for reading data from server database so
18:18
for reading data from server database so
18:18
for reading data from server database so this attribute
18:20
this attribute basically takes two parameters one is
18:23
basically takes two parameters one is
18:23
basically takes two parameters one is the uh command text that you want to run
18:25
the uh command text that you want to run
18:25
the uh command text that you want to run on database and then uh we have the con
18:28
on database and then uh we have the con
18:28
on database and then uh we have the con connection string and this connection
18:31
connection string and this connection
18:31
connection string and this connection string is uh basically uh the app
18:34
string is uh basically uh the app
18:35
string is uh basically uh the app setting names or the uh secret name
18:37
setting names or the uh secret name
18:37
setting names or the uh secret name where we are storing our SQL Server
18:39
where we are storing our SQL Server
18:39
where we are storing our SQL Server database connection string then we have
18:42
database connection string then we have
18:42
database connection string then we have a inumerable of employees and this will
18:44
a inumerable of employees and this will
18:44
a inumerable of employees and this will be basically getting uh the data from
18:48
be basically getting uh the data from
18:48
be basically getting uh the data from SQL Server database and then I am
18:50
SQL Server database and then I am
18:50
SQL Server database and then I am returning this data to my
18:52
returning this data to my
18:52
returning this data to my API okay so this is my basic
18:56
API okay so this is my basic
18:56
API okay so this is my basic API then uh inside app settings uh I
19:02
API then uh inside app settings uh I
19:02
API then uh inside app settings uh I already have uh I already have
19:04
already have uh I already have
19:04
already have uh I already have configured one database but still I will
19:07
configured one database but still I will
19:07
configured one database but still I will show you how to configure the newly
19:09
show you how to configure the newly
19:09
show you how to configure the newly created database with this So currently
19:13
created database with this So currently
19:13
created database with this So currently uh let's move to the Azure
19:19
portal okay uh now you can see that
19:22
portal okay uh now you can see that
19:22
portal okay uh now you can see that inside uh fin ship database server a new
19:26
inside uh fin ship database server a new
19:26
inside uh fin ship database server a new database have been created
19:29
database have been created
19:29
database have been created uh let's close these
19:31
uh let's close these
19:31
uh let's close these notifications and now here you can see
19:33
notifications and now here you can see
19:33
notifications and now here you can see that this is my server name if I click
19:36
that this is my server name if I click
19:36
that this is my server name if I click on this button it will give me my uh
19:38
on this button it will give me my uh
19:38
on this button it will give me my uh connection strings but before that uh I
19:42
connection strings but before that uh I
19:42
connection strings but before that uh I have to configure uh my SQL Server
19:45
have to configure uh my SQL Server
19:45
have to configure uh my SQL Server networking so that I can access this uh
19:48
networking so that I can access this uh
19:48
networking so that I can access this uh from my local uh
19:58
inside uh my this database AE learn uh
20:02
inside uh my this database AE learn uh
20:02
inside uh my this database AE learn uh click on configure button I already have
20:04
click on configure button I already have
20:05
click on configure button I already have added uh my IP addresses here but still
20:07
added uh my IP addresses here but still
20:07
added uh my IP addresses here but still I will show you how you can do that uh
20:10
I will show you how you can do that uh
20:10
I will show you how you can do that uh one option is that you can add your
20:12
one option is that you can add your
20:12
one option is that you can add your client IP address so basically when you
20:14
client IP address so basically when you
20:14
client IP address so basically when you add this rule uh Microsoft Azure will
20:17
add this rule uh Microsoft Azure will
20:17
add this rule uh Microsoft Azure will allow this IP address to access this
20:20
allow this IP address to access this
20:20
allow this IP address to access this database so this is my uh computer
20:24
database so this is my uh computer
20:24
database so this is my uh computer public IP address so currently uh this
20:26
public IP address so currently uh this
20:26
public IP address so currently uh this will be only accessible to uh system so
20:29
will be only accessible to uh system so
20:29
will be only accessible to uh system so let's save
20:33
this then if I uh move to SQL
20:37
this then if I uh move to SQL
20:37
this then if I uh move to SQL database and after selecting my database
20:41
database and after selecting my database
20:41
database and after selecting my database uh click on show database connection
20:42
uh click on show database connection
20:42
uh click on show database connection string and here I can copy my connection
20:46
string and here I can copy my connection
20:46
string and here I can copy my connection string so you can see that uh connection
20:48
string so you can see that uh connection
20:48
string so you can see that uh connection strings are available for uh different
20:51
strings are available for uh different
20:51
strings are available for uh different uh operators or different SDK so
20:54
uh operators or different SDK so
20:54
uh operators or different SDK so basically I'm uh using just like
20:56
basically I'm uh using just like
20:57
basically I'm uh using just like Microsoft so I will use ad . net SQL
20:59
Microsoft so I will use ad . net SQL
20:59
Microsoft so I will use ad . net SQL authentification
21:01
authentification okay so let's copy uh this connection
21:04
okay so let's copy uh this connection
21:04
okay so let's copy uh this connection string and go to my
21:06
string and go to my code and let's uh rename
21:11
this okay uh so basically this is my
21:17
this okay uh so basically this is my
21:17
this okay uh so basically this is my connection string name and my connection
21:20
connection string name and my connection
21:20
connection string name and my connection string name currently I'm saying
21:22
string name currently I'm saying
21:22
string name currently I'm saying friendship lab or I can say it a learn
21:26
friendship lab or I can say it a learn
21:26
friendship lab or I can say it a learn okay uh then
21:29
okay uh then all other settings are already inside my
21:32
all other settings are already inside my
21:32
all other settings are already inside my connection string uh but I need to uh
21:35
connection string uh but I need to uh
21:35
connection string uh but I need to uh put my password Here uh so let me uh
21:40
put my password Here uh so let me uh
21:40
put my password Here uh so let me uh write my password
21:47
here okay so now my uh connection string have
21:51
okay so now my uh connection string have
21:51
okay so now my uh connection string have been configured one other options or
21:55
been configured one other options or
21:55
been configured one other options or thing that I have forgot is I need to
21:58
thing that I have forgot is I need to
21:58
thing that I have forgot is I need to create a new uh table on my uh SQL
22:03
create a new uh table on my uh SQL
22:03
create a new uh table on my uh SQL Server
22:04
Server datab so let's uh do that first of all
22:09
datab so let's uh do that first of all
22:09
datab so let's uh do that first of all go to cury
22:10
go to cury editor and here you need to provide
22:14
editor and here you need to provide
22:14
editor and here you need to provide your credential so that you can connect
22:16
your credential so that you can connect
22:17
your credential so that you can connect with the
22:18
with the database I'm logging as an admin user
22:21
database I'm logging as an admin user
22:22
database I'm logging as an admin user okay so currently if I see currently
22:24
okay so currently if I see currently
22:24
okay so currently if I see currently there is no database available so I will
22:26
there is no database available so I will
22:26
there is no database available so I will create a newly a new database I will
22:28
create a newly a new database I will
22:28
create a newly a new database I will will say create table of employes and
22:31
will say create table of employes and
22:31
will say create table of employes and inside this I will create ID uh this
22:35
inside this I will create ID uh this
22:35
inside this I will create ID uh this will be basically unique
22:41
identifier and this one is also my
22:43
identifier and this one is also my
22:43
identifier and this one is also my memory key then I have
22:47
memory key then I have
22:47
memory key then I have name I will make it warar 100 and then I
22:51
name I will make it warar 100 and then I
22:51
name I will make it warar 100 and then I have
22:54
email okay so let's create the database
22:58
email okay so let's create the database
22:58
email okay so let's create the database oh sorry table if I refresh
23:02
oh sorry table if I refresh
23:02
oh sorry table if I refresh this so now you can see that a new uh
23:06
this so now you can see that a new uh
23:06
this so now you can see that a new uh table have been created uh if I uh
23:09
table have been created uh if I uh
23:09
table have been created uh if I uh select all the data from this table so
23:12
select all the data from this table so
23:12
select all the data from this table so currently no data is
23:15
currently no data is
23:15
currently no data is available okay so now let me
23:19
available okay so now let me
23:20
available okay so now let me uh insert uh data inside
23:29
this db. implies and I can directly put my values
23:33
and I can directly put my values
23:33
and I can directly put my values here uh let's put the
23:36
here uh let's put the
23:36
here uh let's put the name and then
23:40
email okay here I need to provide a
23:43
email okay here I need to provide a
23:43
email okay here I need to provide a unique identifier and I think so I
23:46
unique identifier and I think so I
23:46
unique identifier and I think so I already have inside my yeah this one
23:51
already have inside my yeah this one
23:51
already have inside my yeah this one okay I already have one in my uh
23:53
okay I already have one in my uh
23:53
okay I already have one in my uh clipboard so let's uh run this
23:58
clipboard so let's uh run this
23:58
clipboard so let's uh run this okay now if I uh select this okay now
24:02
okay now if I uh select this okay now
24:02
okay now if I uh select this okay now you can see that uh there is one record
24:04
you can see that uh there is one record
24:04
you can see that uh there is one record available in my employee table uh so now
24:08
available in my employee table uh so now
24:08
available in my employee table uh so now let's move to the code and access this
24:11
let's move to the code and access this
24:11
let's move to the code and access this inside as your
24:13
inside as your functions go to my functions and here
24:16
functions go to my functions and here
24:16
functions go to my functions and here now I need to available my connection
24:19
now I need to available my connection
24:19
now I need to available my connection string name basically a l and then here
24:23
string name basically a l and then here
24:23
string name basically a l and then here I need to provide the query s direct
24:25
I need to provide the query s direct
24:25
I need to provide the query s direct from db. implies
24:28
from db. implies okay so uh let's run this and see
24:33
okay so uh let's run this and see
24:33
okay so uh let's run this and see whether it is working or
24:41
not so aure function currently running
24:46
not so aure function currently running
24:46
not so aure function currently running and it is showing me in my console
24:47
and it is showing me in my console
24:47
and it is showing me in my console application if I click on get all
24:50
application if I click on get all
24:50
application if I click on get all button uh let's close all other extra
24:54
button uh let's close all other extra
24:54
button uh let's close all other extra windows and now you can see
24:56
windows and now you can see
24:56
windows and now you can see that newly uh created record is showing
25:01
that newly uh created record is showing
25:01
that newly uh created record is showing if I uh insert one more uh one more
25:04
if I uh insert one more uh one more
25:04
if I uh insert one more uh one more record here to show you let's change
25:07
record here to show you let's change
25:07
record here to show you let's change this primary
25:11
key and I will rename it
25:14
and I will rename it
25:14
and I will rename it to
25:16
to Omar and I will say it Omar gmail.com
25:20
Omar and I will say it Omar gmail.com
25:20
Omar and I will say it Omar gmail.com create another record okay uh now test
25:23
create another record okay uh now test
25:23
create another record okay uh now test it refresh okay now you can see that uh
25:27
it refresh okay now you can see that uh
25:27
it refresh okay now you can see that uh it is very easy to integrate with
25:30
it is very easy to integrate with
25:30
it is very easy to integrate with Microsoft SQL Server inside as your
25:33
Microsoft SQL Server inside as your
25:33
Microsoft SQL Server inside as your function you just have to use SQL input
25:36
function you just have to use SQL input
25:36
function you just have to use SQL input uh attribute and this will handle all
25:39
uh attribute and this will handle all
25:39
uh attribute and this will handle all the stuff for you so this was how to get
25:43
the stuff for you so this was how to get
25:43
the stuff for you so this was how to get uh the data of employes from SQL Server
25:48
uh the data of employes from SQL Server
25:48
uh the data of employes from SQL Server database next option is uh to create OPI
25:53
database next option is uh to create OPI
25:53
database next option is uh to create OPI basically uh
25:56
basically uh this this as you function is an HTTP
26:00
this this as you function is an HTTP
26:00
this this as you function is an HTTP trigger function and it is using
26:02
trigger function and it is using
26:02
trigger function and it is using authorization level as
26:04
authorization level as
26:04
authorization level as Anonymous and uh this will be using
26:07
Anonymous and uh this will be using
26:07
Anonymous and uh this will be using basically HTTP post method only I am
26:11
basically HTTP post method only I am
26:11
basically HTTP post method only I am giving uh I am getting the employe body
26:14
giving uh I am getting the employe body
26:14
giving uh I am getting the employe body from uh my request and then I
26:18
from uh my request and then I
26:18
from uh my request and then I am then I will be using this model to
26:22
am then I will be using this model to
26:22
am then I will be using this model to create a new employe
26:25
create a new employe
26:25
create a new employe okay so I already have created this
26:28
okay so I already have created this
26:29
okay so I already have created this model so let's uncomment this uh give it
26:33
model so let's uncomment this uh give it
26:33
model so let's uncomment this uh give it a proper name we can say that uh create
26:38
a proper name we can say that uh create
26:38
a proper name we can say that uh create emply response model okay so now here
26:42
emply response model okay so now here
26:42
emply response model okay so now here you can see that uh there are two
26:44
you can see that uh there are two
26:44
you can see that uh there are two options first of all I have imply uh
26:48
options first of all I have imply uh
26:48
options first of all I have imply uh property and this imply property is
26:50
property and this imply property is
26:50
property and this imply property is annotated with SQL output and in first
26:54
annotated with SQL output and in first
26:54
annotated with SQL output and in first parameter I have to provide the table
26:57
parameter I have to provide the table
26:57
parameter I have to provide the table name and in second parameter I have to
26:59
name and in second parameter I have to
26:59
name and in second parameter I have to provide the connection string
27:02
provide the connection string
27:03
provide the connection string name now what will happen whenever I
27:05
name now what will happen whenever I
27:05
name now what will happen whenever I will uh return this model as a response
27:08
will uh return this model as a response
27:08
will uh return this model as a response for aure function uh this contained SQL
27:12
for aure function uh this contained SQL
27:12
for aure function uh this contained SQL output so my data will be uh created or
27:15
output so my data will be uh created or
27:16
output so my data will be uh created or if ID exists then it will be updated
27:18
if ID exists then it will be updated
27:18
if ID exists then it will be updated automatically by this SQL output paret
27:22
automatically by this SQL output paret
27:22
automatically by this SQL output paret then I have HTTP response data uh so
27:25
then I have HTTP response data uh so
27:25
then I have HTTP response data uh so that I can return some response to the
27:28
that I can return some response to the
27:28
that I can return some response to the uh calling client of the API so let's
27:32
uh calling client of the API so let's
27:32
uh calling client of the API so let's update this model as
27:34
update this model as
27:34
update this model as well okay next I'm getting this as an
27:38
well okay next I'm getting this as an
27:38
well okay next I'm getting this as an input and I need to uh specify here from
27:42
input and I need to uh specify here from
27:42
input and I need to uh specify here from body basically I'm reading uh this from
27:46
body basically I'm reading uh this from
27:46
body basically I'm reading uh this from uh request body so I have to provide
27:49
uh request body so I have to provide
27:49
uh request body so I have to provide this Microsoft as your functions worker
27:56
do and then I have HTTP from body so now
28:02
do and then I have HTTP from body so now
28:02
do and then I have HTTP from body so now uh a your function will automatically
28:04
uh a your function will automatically
28:04
uh a your function will automatically map my body data to this
28:07
map my body data to this
28:07
map my body data to this object and as I am creating uh a new uh
28:11
object and as I am creating uh a new uh
28:11
object and as I am creating uh a new uh imply every time so uh I will generate a
28:15
imply every time so uh I will generate a
28:15
imply every time so uh I will generate a new grid a unique grid every time and
28:19
new grid a unique grid every time and
28:19
new grid a unique grid every time and for now I will uh get this name and
28:22
for now I will uh get this name and
28:23
for now I will uh get this name and email from the model uh let's put a
28:25
email from the model uh let's put a
28:25
email from the model uh let's put a breako here okay run this and meanwhile
28:30
breako here okay run this and meanwhile
28:30
breako here okay run this and meanwhile I will post I will open my post man so
28:33
I will post I will open my post man so
28:33
I will post I will open my post man so that I can make
28:40
this okay my function is running and
28:43
this okay my function is running and
28:43
this okay my function is running and this is the URL of my function so let's
28:47
this is the URL of my function so let's
28:47
this is the URL of my function so let's copy
28:49
copy this as this is an htic post request so
28:52
this as this is an htic post request so
28:52
this as this is an htic post request so I cannot hit from my browser uh I have
28:55
I cannot hit from my browser uh I have
28:55
I cannot hit from my browser uh I have to use
28:59
to use post man so let's paste it here and
29:01
post man so let's paste it here and
29:01
post man so let's paste it here and inside body select raw option then Json
29:05
inside body select raw option then Json
29:05
inside body select raw option then Json and inside us I need to provide uh
29:11
name name is uh basically
29:15
name name is uh basically
29:15
name name is uh basically safan and I also need to provide email
29:19
safan and I also need to provide email
29:19
safan and I also need to provide email and I will say safan at
29:23
and I will say safan at
29:23
and I will say safan at gmail uh let's hit this API okay uh my
29:28
gmail uh let's hit this API okay uh my
29:28
gmail uh let's hit this API okay uh my HTTP triggers function triggered and if
29:32
HTTP triggers function triggered and if
29:32
HTTP triggers function triggered and if I see the model I can read the values
29:34
I see the model I can read the values
29:34
I see the model I can read the values email and name is coming ID is not
29:36
email and name is coming ID is not
29:36
email and name is coming ID is not coming because I have not not CED from
29:39
coming because I have not not CED from
29:39
coming because I have not not CED from my body uh so let's continue this first
29:43
my body uh so let's continue this first
29:43
my body uh so let's continue this first of all I'm creating an okay response so
29:45
of all I'm creating an okay response so
29:45
of all I'm creating an okay response so that I can return this uh to the client
29:48
that I can return this uh to the client
29:48
that I can return this uh to the client then I am writing that response
29:50
then I am writing that response
29:50
then I am writing that response basically which was imply create
29:52
basically which was imply create
29:52
basically which was imply create successfully and here I'm passing my
29:54
successfully and here I'm passing my
29:54
successfully and here I'm passing my name and email with a new word so if if
29:58
name and email with a new word so if if
29:58
name and email with a new word so if if I click on
30:01
continue okay so now it is giving me 200
30:05
continue okay so now it is giving me 200
30:05
continue okay so now it is giving me 200 response which means imply have been
30:06
response which means imply have been
30:06
response which means imply have been created
30:08
created successfully now if I move to my get all
30:11
successfully now if I move to my get all
30:11
successfully now if I move to my get all API let's move it to postman as
30:15
API let's move it to postman as
30:15
API let's move it to postman as well okay if I run this so now you can
30:19
well okay if I run this so now you can
30:19
well okay if I run this so now you can see that uh a new record have been
30:22
see that uh a new record have been
30:22
see that uh a new record have been created inside my SQL Server
30:25
created inside my SQL Server
30:26
created inside my SQL Server database so this was how to create uh a
30:31
database so this was how to create uh a
30:31
database so this was how to create uh a new record inside SQL Server database or
30:33
new record inside SQL Server database or
30:33
new record inside SQL Server database or how to perform create operation uh then
30:36
how to perform create operation uh then
30:37
how to perform create operation uh then we have a delete function this delete
30:39
we have a delete function this delete
30:39
we have a delete function this delete function will basically take ID of an
30:42
function will basically take ID of an
30:42
function will basically take ID of an imply and then it will delete that ID
30:45
imply and then it will delete that ID
30:45
imply and then it will delete that ID from the database if that
30:48
from the database if that
30:48
from the database if that exist so uh in other functions I have
30:52
exist so uh in other functions I have
30:52
exist so uh in other functions I have show you how to use uh SQL
30:55
show you how to use uh SQL
30:55
show you how to use uh SQL input and SQL output uh binding
30:59
input and SQL output uh binding
30:59
input and SQL output uh binding attributes but now I will show you how
31:02
attributes but now I will show you how
31:02
attributes but now I will show you how to use directly ado.net with daer uh for
31:07
to use directly ado.net with daer uh for
31:07
to use directly ado.net with daer uh for connecting with SQL Server
31:10
connecting with SQL Server
31:10
connecting with SQL Server database okay so for using Meer you need
31:13
database okay so for using Meer you need
31:13
database okay so for using Meer you need to install it uh from nugget package
31:17
to install it uh from nugget package
31:17
to install it uh from nugget package manager you can use
31:19
manager you can use this I already have installed one so
31:23
this I already have installed one so
31:23
this I already have installed one so still let me show you so this package
31:25
still let me show you so this package
31:25
still let me show you so this package you have to install this package and
31:27
you have to install this package and
31:27
you have to install this package and then you can use it with Microsoft SQL
31:30
then you can use it with Microsoft SQL
31:30
then you can use it with Microsoft SQL connection instance uh first of all
31:33
connection instance uh first of all
31:33
connection instance uh first of all inside this I have an HTTP trigger with
31:37
inside this I have an HTTP trigger with
31:37
inside this I have an HTTP trigger with Anonymous uh and I will update this HTTP
31:41
Anonymous uh and I will update this HTTP
31:41
Anonymous uh and I will update this HTTP get to http delete and then my route is
31:44
get to http delete and then my route is
31:44
get to http delete and then my route is delete slash ID this ID will be binded
31:48
delete slash ID this ID will be binded
31:48
delete slash ID this ID will be binded with my GD and I will delete the record
31:52
with my GD and I will delete the record
31:52
with my GD and I will delete the record against Lord WID and inside my function
31:56
against Lord WID and inside my function
31:56
against Lord WID and inside my function first of all I am reading the connection
31:58
first of all I am reading the connection
31:58
first of all I am reading the connection string from my local
32:00
string from my local
32:00
string from my local Secrets uh
32:02
Secrets uh then I need to update this as well yes
32:05
then I need to update this as well yes
32:05
then I need to update this as well yes Lear uh then I'm creating a new SQL
32:09
Lear uh then I'm creating a new SQL
32:09
Lear uh then I'm creating a new SQL connection and inside this I'm passing
32:11
connection and inside this I'm passing
32:11
connection and inside this I'm passing my connection string and I'm uh using
32:14
my connection string and I'm uh using
32:14
my connection string and I'm uh using using parameter with this
32:17
using parameter with this
32:17
using parameter with this because it will dispose
32:19
because it will dispose
32:20
because it will dispose automatically uh that connection when I
32:22
automatically uh that connection when I
32:22
automatically uh that connection when I don't need when I'm using EX aing
32:28
this uh extension method is provided by
32:31
this uh extension method is provided by
32:31
this uh extension method is provided by depper uh so this me I'm using at the
32:34
depper uh so this me I'm using at the
32:34
depper uh so this me I'm using at the rate ID and this is basically
32:37
rate ID and this is basically
32:37
rate ID and this is basically parameterized cury and then I am uh
32:40
parameterized cury and then I am uh
32:40
parameterized cury and then I am uh passing these parameter inside an
32:42
passing these parameter inside an
32:42
passing these parameter inside an anonymous object uh parameterized curies
32:45
anonymous object uh parameterized curies
32:45
anonymous object uh parameterized curies are
32:46
are very important to use because uh it
32:49
very important to use because uh it
32:49
very important to use because uh it prevents SQL injection attacks on our
32:52
prevents SQL injection attacks on our
32:52
prevents SQL injection attacks on our system uh so uh let's run this and see
32:56
system uh so uh let's run this and see
32:56
system uh so uh let's run this and see whe it is working or not so I click on
33:02
whe it is working or not so I click on
33:02
whe it is working or not so I click on uh run
33:11
button okay uh so this is uh
33:17
button okay uh so this is uh
33:17
button okay uh so this is uh the API that I need to
33:20
the API that I need to
33:20
the API that I need to use and if I move
33:24
use and if I move to postman I need to put this in side
33:28
to postman I need to put this in side
33:28
to postman I need to put this in side URL and here I need to provide my ID
33:33
URL and here I need to provide my ID
33:33
URL and here I need to provide my ID okay so here it will come the gr that I
33:35
okay so here it will come the gr that I
33:35
okay so here it will come the gr that I want to delete for example I want to
33:37
want to delete for example I want to
33:37
want to delete for example I want to delete this record of
33:39
delete this record of
33:40
delete this record of mine so let's copy the
33:42
mine so let's copy the
33:42
mine so let's copy the ID let's past this after the end make
33:47
ID let's past this after the end make
33:47
ID let's past this after the end make this HTTP delete request and then click
33:51
this HTTP delete request and then click
33:51
this HTTP delete request and then click on send
33:53
on send button okay now if I continue here you
33:57
button okay now if I continue here you
33:57
button okay now if I continue here you can see see my connection string is
33:59
can see see my connection string is
33:59
can see see my connection string is coming uh then I have a new SQL Server
34:02
coming uh then I have a new SQL Server
34:02
coming uh then I have a new SQL Server Connection and then I'm executing that
34:04
Connection and then I'm executing that
34:05
Connection and then I'm executing that connection on SQL Server database and my
34:09
connection on SQL Server database and my
34:09
connection on SQL Server database and my I uh my employee deleted successfully so
34:12
I uh my employee deleted successfully so
34:12
I uh my employee deleted successfully so if I now run again the get all
34:16
if I now run again the get all
34:16
if I now run again the get all implies
34:17
implies function so now you can see that it is
34:20
function so now you can see that it is
34:20
function so now you can see that it is uh currently returning me only two
34:22
uh currently returning me only two
34:23
uh currently returning me only two records uh so this is how you can
34:26
records uh so this is how you can
34:26
records uh so this is how you can perform delete
34:28
perform delete operation uh using SQL Server inside a
34:31
operation uh using SQL Server inside a
34:31
operation uh using SQL Server inside a your
34:33
your functions uh one option uh that I need
34:37
functions uh one option uh that I need
34:37
functions uh one option uh that I need to implement is uh currently basically
34:39
to implement is uh currently basically
34:39
to implement is uh currently basically missing uh which is how to update record
34:43
missing uh which is how to update record
34:43
missing uh which is how to update record using a your function okay so uh I have
34:47
using a your function okay so uh I have
34:47
using a your function okay so uh I have to write code this for so let's start
34:49
to write code this for so let's start
34:49
to write code this for so let's start this first of all I will create a
34:52
this first of all I will create a
34:52
this first of all I will create a function and this function name will be
34:55
function and this function name will be
34:55
function and this function name will be update and then I need to create uh a
35:01
update and then I need to create uh a
35:01
update and then I need to create uh a new function
35:08
so B basically I'm using and this will be also
35:12
using and this will be also
35:12
using and this will be also create
35:21
response now first of all I need to
35:23
response now first of all I need to
35:23
response now first of all I need to provide itit
35:26
provide itit trigger and then inside this uh HTTP
35:30
trigger and then inside this uh HTTP
35:30
trigger and then inside this uh HTTP trigger I need to provide authorization
35:32
trigger I need to provide authorization
35:32
trigger I need to provide authorization level So currently it's Anonymous and
35:35
level So currently it's Anonymous and
35:35
level So currently it's Anonymous and then the HTTP method so for this I will
35:38
then the HTTP method so for this I will
35:38
then the HTTP method so for this I will be using put uh because I want to update
35:41
be using put uh because I want to update
35:41
be using put uh because I want to update the record and then I have HTTP request
35:45
the record and then I have HTTP request
35:45
the record and then I have HTTP request uh
35:49
data request uh then I need to uh read
35:54
data request uh then I need to uh read
35:54
data request uh then I need to uh read the new model that I want to update so
35:57
the new model that I want to update so
35:57
the new model that I want to update so so I will be basically using the same C
36:12
okay I pasted it at the wrong
36:17
okay I pasted it at the wrong
36:17
okay I pasted it at the wrong line so let's move it to this line okay
36:22
line so let's move it to this line okay
36:22
line so let's move it to this line okay so this is my uh Azure function with
36:26
so this is my uh Azure function with
36:26
so this is my uh Azure function with HTTP trigger uh that will update the
36:29
HTTP trigger uh that will update the
36:29
HTTP trigger uh that will update the data now uh I need to uh write the same
36:33
data now uh I need to uh write the same
36:33
data now uh I need to uh write the same code as I have inside my uh create
36:38
code as I have inside my uh create
36:38
code as I have inside my uh create method so I let's copy
36:41
method so I let's copy
36:41
method so I let's copy this and then here I will update the
36:44
this and then here I will update the
36:44
this and then here I will update the message which is I am showing to the
36:46
message which is I am showing to the
36:47
message which is I am showing to the client and now uh as I am updating the
36:50
client and now uh as I am updating the
36:50
client and now uh as I am updating the employer so I will not generate a new ID
36:54
employer so I will not generate a new ID
36:54
employer so I will not generate a new ID instead of that I will use the ID which
36:57
instead of that I will use the ID which
36:57
instead of that I will use the ID which is provided by uh the HTTP request
37:01
is provided by uh the HTTP request
37:01
is provided by uh the HTTP request body so this uh basically uh you will be
37:06
body so this uh basically uh you will be
37:06
body so this uh basically uh you will be confusing how this will update the data
37:09
confusing how this will update the data
37:09
confusing how this will update the data this SQL output basically provide us two
37:12
this SQL output basically provide us two
37:12
this SQL output basically provide us two options okay uh it provide
37:16
options okay uh it provide
37:16
options okay uh it provide us create and update uh so you can say
37:20
us create and update uh so you can say
37:20
us create and update uh so you can say that this provide us upser you can say
37:22
that this provide us upser you can say
37:22
that this provide us upser you can say create an instance of SQL output
37:24
create an instance of SQL output
37:24
create an instance of SQL output attribute which takes a list of rows and
37:26
attribute which takes a list of rows and
37:27
attribute which takes a list of rows and upser the to Target database upset means
37:30
upser the to Target database upset means
37:30
upser the to Target database upset means if the record does not exist it create
37:32
if the record does not exist it create
37:32
if the record does not exist it create that record and if that record exist it
37:36
that record and if that record exist it
37:36
that record and if that record exist it uh update that according to primary key
37:39
uh update that according to primary key
37:39
uh update that according to primary key so I can update its name to
37:44
so I can update its name to
37:44
so I can update its name to upside so that I can use it at uh both
37:50
upside so that I can use it at uh both
37:50
upside so that I can use it at uh both functions
37:52
functions okay uh let's run this and see whether
37:56
okay uh let's run this and see whether
37:56
okay uh let's run this and see whether it works or not so let's run this
38:00
it works or not so let's run this
38:00
it works or not so let's run this function there is one uh compiler
38:04
function there is one uh compiler
38:04
function there is one uh compiler error okay uh so basically when I was uh
38:10
error okay uh so basically when I was uh
38:10
error okay uh so basically when I was uh working on the above method I
38:12
working on the above method I
38:12
working on the above method I accidentally deleted this ID so that's
38:15
accidentally deleted this ID so that's
38:15
accidentally deleted this ID so that's why it's giving error so let's run it
38:17
why it's giving error so let's run it
38:17
why it's giving error so let's run it again
38:29
okay now you can see that my update
38:31
okay now you can see that my update
38:31
okay now you can see that my update function is running so let's copy
38:34
function is running so let's copy
38:34
function is running so let's copy this create a new Postman request this
38:38
this create a new Postman request this
38:38
this create a new Postman request this will be basically HTTP
38:42
port and inside body raw then select
38:47
port and inside body raw then select
38:47
port and inside body raw then select Json and here I will provide uh the ID
38:51
Json and here I will provide uh the ID
38:51
Json and here I will provide uh the ID of the emplo that I want to update the
38:53
of the emplo that I want to update the
38:54
of the emplo that I want to update the name of the
38:55
name of the emplo and email of the
38:59
emplo and email of the
38:59
emplo and email of the employee so let's copy an existing
39:04
employee so let's copy an existing
39:04
employee so let's copy an existing ID let me get uh the latest results so I
39:07
ID let me get uh the latest results so I
39:07
ID let me get uh the latest results so I have two records so I for example I want
39:09
have two records so I for example I want
39:09
have two records so I for example I want to update safan record so let's uh copy
39:14
to update safan record so let's uh copy
39:14
to update safan record so let's uh copy this ID
39:16
this ID here put it safan
39:22
y so I have changed in the name and then
39:27
y so I have changed in the name and then
39:27
y so I have changed in the name and then I have uh chain in the email if I run
39:30
I have uh chain in the email if I run
39:30
I have uh chain in the email if I run this
39:31
this request it hits my uh V Point inside V
39:36
request it hits my uh V Point inside V
39:36
request it hits my uh V Point inside V studio and if I uh check the model
39:40
studio and if I uh check the model
39:40
studio and if I uh check the model values here you can see that ID email
39:43
values here you can see that ID email
39:43
values here you can see that ID email and name is
39:45
and name is coming uh so continue this and hopefully
39:49
coming uh so continue this and hopefully
39:49
coming uh so continue this and hopefully this will observe the record inside
39:51
this will observe the record inside
39:51
this will observe the record inside database
39:56
continue and uh currently my request is
40:00
continue and uh currently my request is
40:00
continue and uh currently my request is running okay you can see that the status
40:03
running okay you can see that the status
40:03
running okay you can see that the status is 200 and the employee updated
40:05
is 200 and the employee updated
40:05
is 200 and the employee updated successfully if I again call the get API
40:09
successfully if I again call the get API
40:09
successfully if I again call the get API so now you can see that the name and
40:11
so now you can see that the name and
40:11
so now you can see that the name and email have been
40:13
email have been updated so uh this is how you can
40:16
updated so uh this is how you can
40:16
updated so uh this is how you can perform uh cud operations uh on SQL
40:20
perform uh cud operations uh on SQL
40:20
perform uh cud operations uh on SQL Server a your SQL Server database using
40:23
Server a your SQL Server database using
40:23
Server a your SQL Server database using Azure functions so these are two
40:25
Azure functions so these are two
40:26
Azure functions so these are two different techniques uh one is you can
40:28
different techniques uh one is you can
40:28
different techniques uh one is you can use uh as your SQL input and output
40:31
use uh as your SQL input and output
40:31
use uh as your SQL input and output parameter and the other one is you can
40:34
parameter and the other one is you can
40:34
parameter and the other one is you can use Ado do so you and there is one other
40:38
use Ado do so you and there is one other
40:38
use Ado do so you and there is one other option you can also use Entity framework
40:40
option you can also use Entity framework
40:40
option you can also use Entity framework core with as your functions so it
40:42
core with as your functions so it
40:43
core with as your functions so it totally depends on to you uh with which
40:46
totally depends on to you uh with which
40:46
totally depends on to you uh with which functionality you are working working
40:49
functionality you are working working
40:49
functionality you are working working and what is your
40:51
and what is your requirement
41:01
let's move uh to the studio yard
41:06
uh to the studio yard
41:06
uh to the studio yard and okay uh so that was it uh it was uh
41:13
and okay uh so that was it uh it was uh
41:13
and okay uh so that was it uh it was uh basically we see how we uh configured
41:17
basically we see how we uh configured
41:17
basically we see how we uh configured SQL Server database inside our Azure
41:20
SQL Server database inside our Azure
41:20
SQL Server database inside our Azure portal so this is here basically uh we
41:24
portal so this is here basically uh we
41:24
portal so this is here basically uh we see how we configured SQL Server
41:26
see how we configured SQL Server
41:26
see how we configured SQL Server database in and then how we created SQL
41:29
database in and then how we created SQL
41:29
database in and then how we created SQL database uh so that is uh the end of
41:35
database uh so that is uh the end of
41:35
database uh so that is uh the end of today uh episode 4 so thank you so much
41:39
today uh episode 4 so thank you so much
41:39
today uh episode 4 so thank you so much for being the part of cop Coral
41:41
for being the part of cop Coral
41:41
for being the part of cop Coral Islamabad chapter and if you are
41:44
Islamabad chapter and if you are
41:44
Islamabad chapter and if you are interested to learn more about as SQL uh
41:47
interested to learn more about as SQL uh
41:47
interested to learn more about as SQL uh so please subscribe to this show and you
41:51
so please subscribe to this show and you
41:51
so please subscribe to this show and you can watch a new episode every Saturday
41:54
can watch a new episode every Saturday
41:54
can watch a new episode every Saturday 9:00 a.m. uh thank you so much again and
41:57
9:00 a.m. uh thank you so much again and
41:57
9:00 a.m. uh thank you so much again and have a nice day bye
41:59
have a nice day bye [Music]