Showing posts with label hello. Show all posts
Showing posts with label hello. Show all posts

Wednesday, February 4, 2026

Cortana Analytics Building a recommendations model in 5 minutes!

hello everyone my name is Luis Cabrera
and I work in the azure machine learning
organization but today we're going to
cook ourselves our recommendations model
one of the missions of Cortana analytics
is to in a sense democratize machine
learning we want to make sure machine
learning is available to everyone not
just to data scientists but also to
developers we want to make sure that
everyone has the capabilities to harness
the power of machine learning one way in
which were doing that is by providing to
you what we call machine learning api's
this machine learning api's are
completed services that you can find
today in the Cortana analytics gallery
these are already baked they use machine
learning capabilities but you do not
need to be a data scientist in order to
use them
today we're going to be talking about
one specific API called the
recommendations API let me start with a
story when I was a kid and I wanted to
watch a cook a cooking show in my native
country of Guatemala there were only two
channels that I could watch at any time
so my probability of getting the best
channel at any time was about fifty
percent and that was great but today my
children you know if you have a service
like xbox you really have over a hundred
thousand streaming options to prick from
which makes it very very hard to find
the content that you need so actually
for the Xbox we built recommendations
engine and in order desire to
democratize or to bring to the world
this capabilities we put these
capabilities together in the
recommendations API so let's get cooking
what you aren't going to need to create
a recommendations model is some catalog
data these are like the the items that
you want to sell for instance or that
you want to recommend you will need some
usage data which represent the previous
transactions that you have seen in your
application or you or your retail site
for instance so you mix these two pieces
together I will show you what these
files look like you you mix them in this
beautiful recommendations builder you
let it bake for a few minutes and then
you are ready to serve in your favorite
website or mobile application okay so
let's get cooking here so first of all I
am going to gallery dot Cortana
analytics com where I can see several
machine learning related resources for
you including machine learning AP ice so
if i click on machine learning api's it
will show me a catalog of different API
study we have available for you for
instance we have faced api's text
analytics computer business API etc but
today we're interested in the
recommendations API so I'm going to
select that one where you can now you
can see a description of the service
links to documentation and and so forth
you will notice that you can also sign
up for the service I have already signed
up so I am NOT going to do it right now
but I have to tell you that you actually
are able to sign up for ten thousand
three transactions per month enough for
you to be able to play with the service
and once you have signed up for the
service you can use the recommendations
UI which is in beta right now and i
actually have already opened the service
which is right here once you are in the
in the recommendations you I you can
create new projects let me create a new
project i will call it connect and this
project is going to be my container
where i can add the usage the catalogue
files and where i can later train my
model so it just created the the model
and step-by-step it asks me to add a
catalog file so i actually have a
catalog file that with transactions from
from the microsoft store actually so i
am going to use my catalog from the
microsoft store as you can see it was
able to upload the catalog now the
question that you may have is what does
that catalog actually look like let me
show you so that catalog has a very
simple format it shows you that there is
a items the identifier for each of the
items in the next row it will give you a
description of the items and then a
description of what type of item is in
my catalog so in this case these are all
items from the microsoft store for
instance so you know i want to be able
to recommend to a customer when they are
buying one product what other type of
product will make sense for them to to
purchase as well it will allow them to
discover those items faster as well so i
need information on metadata about my
catalog and then i also need information
about each of the transactions
in in column a here I have the actual
identifier for users and in in column B
here i have the identifier for
particular products so for instance in
in the first row here I know that person
with id3 BFF DC blah blah blah but item
QR 2000 11 which may be a piece of
software or a piece of hardware for
instance so the system is able to take
the the catalog and then the usage files
and I will just add a usage file here
and you can see that it's starting to
upload the usage file as well so so once
it has both of these pieces of
information it can crunch the
information to create a recommendations
model for you I should point out that
usage files should be less than 200
megabytes in size and if you have more
than 200 megabytes of information you
are allowed to upload several files okay
so once once you have the catalog and
usage file you can actually create a new
build the the first file uploaded and I
am in the process of uploading a second
first once the files have uploaded to
the system you can create a new build
and you can pick a type of build we have
two types of builds recommendations and
frequently bought together we also have
a ranking bill but that's an advanced
feature that you can check in the
documentation for it now so let's say
that we want a recommendations build and
then all I will have to do here is is
click build and then this is going to
take about 30 minutes
okay so after the 30 minutes we are able
to see our build and we can actually
score it so in this case I have to tell
you that I do that images and you don't
see how i am adding the images but when
you select an item you will be able to
see the recommendations for that item so
in this case we have Mike Wazowski the
Infinity figure and you can see the the
recommendations for that item right here
are all that infinity figures which
makes sense you know if a child by its
design and they may want to buy the
other ones as well so if someone on the
other hand were to buy a game like
Assassin's Creed which is a more mature
game we will expect to get
recommendations that are a little bit
more mature right so sage Anarchy Reigns
men in black fuse which makes sense
right these are other games for xbox 360
which people purchase when they when
they purchase the assassins creed game
so in this case you can see how as I
pass one item to the recommendations
engine it is able to return to me all
their items now this is all great and
you already have a model by now but I
have to tell you that if you go to to
the gallery you are also able to
download the coals to do exactly what we
did in that you I it's actually pretty
simple and I'll walk you through it this
is this is actually the exact code that
you download in the sample so all you
need to do is just like with it in the
UI you need to create a model which is
what we're doing there on the only
create model call then you need to
import a catalog and a usage file which
which are the selected lines right there
once you have imported those lines you
want to trigger a build which is done in
the in the next line
so you want to build a model you pass at
the model ID and then the rest of the
code really is in a tight loop just
waiting for that bill to be completed
once the build is completed you you need
to update the model to use that build ID
or that build as the default build this
will allow you in the future to have
several bills and then select which one
is the one that that your model should
be returning recommendations from so it
was actually very simple and you notice
how we were able to use the UI to create
a recommendation sending but you can
also automate it in code as well I
should point out that you can retrain
the model as you get new usage data as
well I should point out that there is
other related content that you may be
interested in we actually gave a
presentation on intelligent retail
scenarios at the Cortana analytics
workshop and it's on channel 9 so this
is the link and you can find me at Lewis
Scott microsoft com and that's my
twitter tag as well
thank you so much and it has been a
pleasure spending some time cooking with
you

Cryptography 101 with .NET Core

Boni Robert hi hello Robert how are you
good how are you I'm doing so good let's
see if oh I don't know yep just working
out this keyboard thing sorry about um
so cryptography 101 with dotnet core
what do you got yes a lot of school
stuff school stuff great um do you want
to go ahead and share your screen oh
well why don't you introduce yourself
first sorry what do you work on so I
work full-time on an e-commerce website
and author and do a lot of conference
speaking and happy about it so if we
like Robert there's plenty of content
out there to go find there should be
cryptography cool cool okay um so would
you like to go ahead and share your
screen and we can dive in yes we know
when you can see it okay I'll let you
know when we can see that let's see
we're having some interesting Skype
delays I see that let's see the camera
he's melting yeah
I think he was attempting to share his
desktop and Skype might have crashed a
bit just a little bit we're getting some
very interesting melting graphics though
everyone's saying to switch to teams
okay we'll go ahead and restart Skype
really quick and I'll just entertain and
delay which is my main job happy years
here in the studio with me we'll
probably switch that's his hand will
probably switch off throughout our
interviews and whatnot Oh looks like we
have Robert back but naturally as soon
as I switch to the screen share uh it
crashes again okay
just switching back to me on camera so
we're gonna figure out this in a second
oh I think I see Robert again okay
Robert can you share your screen I think
I saw it for a sec okay that's me on
Roberts screen and now I can press the
live share and it's repeating it because
all it sees is name sharing Skype and
maybe minimize Skype and then we'll be
able to see hey there we go
okay now we can see your screen Robert
awesome okay whew that was fun I did
that we took them through the matrix
there for a second okay all right 101
with.net core the principles will talk
about cryptography you can use any
platforms they're very familiar
algorithms and things that you can take
advantage of but we're gonna focus on
the implementations and done that core
so a little bit about myself is said
Microsoft MVP part of the ASP insiders
plural site author progress developer
expert in Fiddler that's my Twitter
handle so let's get started so some
background cryptography is the science
of keeping messages secure
why do you want cryptography there's
really four different things most people
think about it for confidentiality so
you're trying to protect data from being
read so you just have something you
don't want people to see that's what
most people think of when they think of
cryptography
there's also integrity and so integrity
is where I want to verify the data top
of your screen we just like seeing all
of your slides better yes okay so we've
got authentication where you want to
identify and validate who a user is and
we're also going to have non-repudiation
so a sender can't deny later that he
sent a given message this is all in the
system dot security dot cryptography
namespace that's where all these classes
will come from and most important thing
if you get nothing else out of this talk
don't try to write your own cryptography
I mean this stuff is well vetted a lot
of people have seen it a lot of people
use it it's built into the framework for
us already take advantage of what's
built in don't try to write your own so
first thing we'll look at is hashing so
the idea with a hash function is you
have a one-way function so it's easy to
compute in one direction but
significantly harder to reverse so hash
functions going to convert a variable
length input into a fixed length it
creates what you could call a data
fingerprint or a digest and it's okay to
see it so if I have data that I don't
care that somebody and I don't need to
hide it from them it's okay for them to
see but I don't want it to be tampered
with
that's the integrity that we talked
about earlier that's where a hash
function is useful so as you see on the
left-hand side I've got some basic
content and I can run a hash on it and
it's going to create this data
fingerprint or digest on the right hand
side that
the hash if I make even a single
character change to the data that's on
the left-hand side I'll get a vastly
different hash so the ideas I can use it
run a hash against the data see that the
hashes match so I can see that things
haven't been tampered with so let's take
a look at a demo for hash functions
don't know what's happening there okay
so the pattern will be very familiar
here for all the cryptography that we
use in dotnet so I'll spend a little bit
of time on this one
but I start with some initial plaintext
so I've just got a string here that
stores in this case this is a simple
demonstration of hashing I'm gonna use
the sha-512 class to do the hashes
that's part of the shot to family the
sha-1 md5 s all of those are not
considered safe anymore so you should
use a sha to functions I'm going to use
sha-512 and what I'm gonna do on this
line you'll see is very familiar with
all the other cryptography will do I
have my string and I need to convert it
into a byte array so I can use the
cryptographic functions they just all
operate on byte arrays so the first
thing I'm gonna do is I'm going to call
the get bytes so I past get bytes the
plaintext string there's lots of
different ways I could choose to encode
this utf-8 is a pretty common encoding
scheme to take strings so I'm going to
convert that do the utf-8 encoding and
then I'm gonna simply call the compute
hash function and as you can see from
the comments I'm gonna get back a byte
array here that's got 512 bits that's
just because I use sha-512 now I want to
display that on the screen so I'm
actually gonna use the bit converter
class there's lots of different ways to
do this I'll show you later how we can
use base64 encoding there's times where
I want to be able to use the hash on a
query string and such so I want to use
characters that aren't going to conflict
with other things on my url so in this
case
I just call the big converter I say I
wanted to go to string and as you can
see up above here it's going to give me
back something that looks like this
so I'm just gonna strip out all the
dashes I just end up with a basic
display so let's look at what that looks
like so you can see here here's my
initial string and then what it hashes
to here so in the example if I go back
you can see even if I were to go change
this if I uncommented that and had a
much larger string the actual hash will
be a fixed size it's just based on what
the hash is so that's basic hashing if
we have some time later we'll talk about
where you might want to use some of
these techniques like I said it's common
if you go to download from a given site
they often list their hash so they'll
say here's a sha-256 etc that way you
know after you download it you could run
the same algorithm it's going to do a
hash even though it's a huge file it'll
be a really small hash and you'll be
able to compare and say that's what the
site said they had that's what I had
after I downloaded it so I know that
nobody's tampered with that so that's a
good use of hashing now we'll get into
what most people expect for cryptography
and that's encryption and decryption
there's gonna be two different kinds so
we'll talk about symmetric algorithms
first and they're symmetric because the
encryption and the decryption are going
to use the same secret key so we're
going to have a secret to share between
the two partners that want to exchange
data and we need to keep that key secret
so if we follow along in the diagram on
the left-hand side I've got the
plaintext that's what I want to encrypt
I'm gonna run my encryption algorithm
with a secret key the result is the
ciphertext that's just the encrypted
stuff I want to send the person
receiving the data will do the
decryption and they're going to use the
exact same secret key that's why it's
called symmetric and if they do that
they're going to get back to the
original plaintext
so the primary attack against this as
far as if people are gonna try to break
this they either are gonna try to
determine what the secret key is and if
they couldn't intercept that or
otherwise determine what it is they're
gonna try brute force key search they're
just going to try all the different
possible keys so the main problem with
this it's really fast it's used a lot
but the key distribution is difficult so
we'll talk later about situations where
I need to share with somebody on the
internet that I haven't otherwise come
in contact with it's hard to give them
the secret key because how would you
give it to them ahead of time in a
secure manner so they'll be places for
symmetric like we said there's a couple
main classes built-in to.net and we're
gonna focus on the primary one that most
people use today is AES encryption so US
government a lot of others this is just
the common symmetric algorithm that
everybody's using in dotnet the
symmetric algorithms are called block
ciphers so they're gonna take my string
and break it up into individual blocks
and encrypt each block one at a time
that's why it's called a block cipher
there's a couple different modes that
you can use ECB or CBC I won't get into
all the details of these but basically
if we use CBC which we recommend that
you use when you encrypt the first block
of the data it wants to add more
randomization into the symmetric
algorithm so it wants to take some
random data from the first block you
encrypt it's going to use the result of
that as input into the next block that
it encrypts so essentially there's a
some extra random that's done each time
it's encrypting blocks of your original
data so the question for that then
becomes how do they get random data for
the very first block that you're going
to use that uses what's called an
initialization vector so the idea with
that again it's just some random data
that's going to be used to seed the
first block for your encryption it
doesn't need to be a secret so you'll
see when we look at the diagram that I'm
going to
transmitted that along with and I'm
never gonna reuse it I'm just it's
always gonna be unique for each set of
data that's all that's important so
let's take a look at a demo of symmetric
algorithms so I've got a web page we'll
look at the page first so I come out
here and type in some random plain text
I can hit n crypt we'll see that it
created the cipher text but it also gave
me the initialization vector so that's
what was used to seed the first block of
this encryption so I need to send both
of these two things I'm going to send
the cipher text and this initialization
vector again now that the cipher text is
encrypted it's safe for me to just send
both of these pieces again the IV it's
fine if that's visible to people if I
hit decrypt we'll see that I get back
the original plaintext like you'd expect
so let's look at how this is implemented
so when I do a post I happen to be using
razor pages and so again you can use
this console wherever you want I'm going
to give sample code at the end that has
a lot of examples of practical ways to
use cryptography in an asp.net website
so that's why I chose to host it in here
but the first thing I'm going to do is
I'm going to actually create an AES
cipher so we'll go up and look at what
that looks like it's pretty
straightforward I just use that class
and say create and I listed on the
right-hand side what some of those
defaults will be I'm gonna set the
padding mode so for the padding mode
it's fine to use the default I like to
use this padding mode because what it
does is you take your original string
you're going to break it into blocks
that very last block isn't gonna
magically be the right size you know 128
bits so the algorithm needs to pad out
the rest of that block by using this
isoh padding mode it's going to put
random data and the rest of that block
which again it just helps with
cryptography to be able to use more ran
data when you're doing things so I like
to use that for the padding mode I left
this in here if you want to test later
if you do a padding mode of zero and you
use the wrong mode every time you
encrypt the same piece of data it will
always end up with the same encrypted
cipher text by using these other
defaults even if I encrypt the word yes
20 times every time it's going to turn
out having something different because
of the mode that we're using with CBC
uses that initialization vector to get
the original random text to use I'm
doing this only for a demo I'm setting
the key so obviously it's not a good
decision to store my key directly in the
code when I could have a lot of time
today to talk about ways to store keys
securely but for the demo code to be
able to give it to you I wanted you to
be able to see you can just generate
some random bits and that's what I did
to create that key so now what I have
I've got the actual AES cipher as we saw
before when I did the cipher it created
some initialization data it created that
first block of random data to use for
encryption I wanted to be able to show
that on the page and so I did a
conversion to base64 it so that when I
displayed it back in the webpage you
would actually see it in a visible form
because it started as a byte array to do
the actual encryption I create an
encrypted then do the utf-8 encoding
that I did before that takes my
plaintext string and converts it into a
byte array and then I call this
transform final block which does the
actual encryption and then I chose in
this case again to use base64 encoding
so that I could display it on the screen
as a string decryption is similar I
create the same cipher I do kind of the
reverse and then here I'm doing the
create decryptor so again the main point
is just you look very quickly this is a
well-established algorithm that lots of
people use that's highly secure and it
really doesn't take much net code at all
to be able to take advantage of it
correctly to do mine
Crypton so that is symmetric talk about
asymmetric so the idea with asymmetric
is you're going to the two partners are
going to create their own public/private
key pair and they're not the same that's
why they call it asymmetric so in this
case if I want to send to someone else
I'm going to get their public key I'll
take the plaintext I'm going to use the
encryption using their public key once I
do that I've got cypher text and the
advantage of asymmetric is because I use
their public key the only thing that can
decrypt this now is their private key so
obviously the receiver is going to hold
on to their private key make sure nobody
learns that but they're free to give out
their public key wherever they want
you'll see it on people's blogs you'll
see it in email signatures anybody then
can take that public key to encryption
knowing that only the person who has the
private key can do the decryption and
get back to where they started problem
with asymmetric so it's great because
it's easy to distribute keys especially
with people that you haven't even worked
with before so for instance you came to
my blog you'd be able to get my public
key we wouldn't need to talk in advance
for you to be able to send me things
that are encrypted the bad news is it's
about a thousand times slower than
symmetric algorithms so you'll often see
in practice like HTTPS and TLS they
actually use a symmetric to encrypt a
session symmetric key so in other words
they generate a random symmetric key
they will exchange that symmetric key
using a symmetric encryption so that
they can safely do that and then they
continue again some of the very popular
classes will talk and focus it on the
RSA class so we'll do a quick demo on
that so very similar to what we saw
before I'm going to create I'll show you
the page quick I can type in some text
do an encryption and then I'll do the
decrypt get back to where I started so
very similar I'm going to create a
cipher like I did before
in this case I just used RSA I have
created a set of public private keys
that I have stored in this variable so
now what I can do is take the plaintext
I'll do my utf-8 again to do the
encoding to get it into a byte array
I'll call the encryption method which
uses RSA and the public key from that
keychain and then I will base64 it so I
can show it on the screen
Mme and a similar thing for decryption
so again you'll see it's very simple to
do this I've got examples in the code
for how you can create RSA keys so later
on you can see how to create keys for
both asymmetric and symmetric by using
some of these other classes and pages
but basically that's how easy it is to
do encryption when you're using dotnet
core so talk quickly about digital
signatures and this provides both
integrity and non-repudiation the idea
is I'm going to hash the contents of a
message and then I'm gonna sign that
hash with my private key by default it
doesn't provide confidentiality but I'm
going to show you in the diagram how you
can do that as well
so if we follow along here I've got some
plain text I'm going to encrypt it using
a symmetric just like I did before
I'll use the receivers public key to do
encryption
I'll get ciphertext I'll use hashing to
compute a hash once I have the hash I'll
sign it with my private key and that
will become my signature so now when I
send the cipher text the person will be
able to use the receivers private key to
decrypt it they'll be able to use my
public key to prove that I'm the person
who signed it so again they have
non-repudiation we've got integrity and
we have confidentiality all in one big
approach here as far as using this in
dotnet core a couple cool things that
are coming with dotnet core 3.0 we now
will have authenticated encryption for
the first time so we talked about AES
encryption before and we've talked about
hashing this combines the two of them so
that I can come do the encryption send
it to you and not only will you know
that you can decrypt it but you'll also
be able to use the hash to verify that
it hasn't been tampered with so there's
two new classes that come in net core 3
oh like you said this is the first time
we've had access to authenticated
encryption so that's cool
they've also got an expanded list of
cryptographic key formats that we can
import an export compared to what we had
in the past
so in summary don't write your own
encryption use trusted algorithms and
implementations use hashing when you
want to validate integrity of data or to
prove that you both know the same secret
and then generally with encryption you
want to use symmetric algorithms because
they perform so much better unless you
have special needs for a symmetric set
things such as digital signatures you
need to do key exchanges etc and again
know your threats choose the proper
countermeasure so you need to know what
you're trying to do whether it's
confidentiality or non-repudiation
will help guide what the right type of
algorithm and approach will be when
you're doing down at core some quick
resources I have a Pluralsight course
that's an introduction to cryptography
and net so it goes through the same
contents and a lot more detail with a
lot of practical examples using done
that framework in that case here's four
very good books that talk about
cryptography so if you're interested in
how AES actually functions or how RSA
works and all the math and and the
technical background you can look at
those if you want to get background just
on the history of different uses of
cryptography what people did how it got
broken both of these books are excellent
books for that and that's my Twitter
that's an email address we can reach me
that's where I have the slides and the
code available and we can either do some
questions or I can show a couple
examples if we have a little time
okay thank you so much so a bit of can
you hear me all right actually
oh sorry can you hear me all right
Robert okay we'll see if this works um
we need to switch off our mics because
there is an echo that we haven't solved
yet because half of the team needs to
sleep at some point that's the fun of
doing 24 hour livestream so I will
forward you the questions Robert and
then I will let's see thank you and hey
there we go okay and then I will be able
to unmute you and then I'll mute myself
so we avoid the echo okay so here we go
so in general people really appreciate
the advice about not writing your own
hash functions do you have any more to
say on that topic no I think like I said
it's nice that we have open-source
trusted well deployed well tested
hashing and cryptography you know the
encryption asymmetric all of that stuff
built into the framework I just a lot of
people have said that they can write
their own cryptography and they think
that by writing their own algorithm and
keeping it secret that they'll be able
to do a better job and be able to
encrypt stuff and virtually every time
that's been tried that's a lot of times
when people go on an audit and and look
at specific issues with breaches and
such they find that people do things
like that
take advantage of the stuff that's built
into the framework just don't try to
write your own if you really want to be
a cryptographer go to a place where you
have other cryptographers work together
on things like dotnet core and have
other people that can help review it
because it's it's complicated stuff to
create hopefully we've seen that it's
easy to use yes that would be the power
of teamwork I like it a lot it's always
good to have other people checking your
work okay so normally when one is using
an encryption or decryption it's ID
not to store the encrypted cipher text
on the database but just the encrypted
hash no good example would be if you
don't so for example on passwords you
traditionally would store hashes you
don't need to reverse that data to get
their original password you'll take the
new password they type you'll hash it
you'll compare it to a hash that works
in that situation when you're storing
data that you need to be able to get
back and retrieve and actually see the
value of you're going to have to
actually use encryption in which case
you'll want to use decryption as well
I've got some examples in the sample
code you can look at a good example of a
public website that needs to take data
you could put a public private key put
the public key only on your web server
so if anybody got it who cares encrypt
stuff on the front end using the public
key stored encrypted in the backend and
then the only system that needs to
decrypt it and use it has the private
key but it's fine
I mean if you need to get the data back
you need to be able to decrypt it so you
have to use encryption it's fine to
store that in the database passwords are
an example of I don't really need to
back it up and see it I just need to
make sure it's the same and that's why
they use hashes for that great ok sorry
I have to like now tight for buttons
while we transfer so when it was just a
general question what is the best place
to store the encryption key very end of
that sorry I know ok I'm trying to ask
again but I have to switch all of the
buttons ok what sorry what is the best
place to store the encryption key that's
a long very long answer depending on
what you have access to what kind of
system you have I tend to like the
example I just went through if I've got
a public-facing web server I generally
treat that web server like it's
compromisable you know at any time I
could have a zero-day exploit things
like that so I really don't want to have
a key stored on that machine that's
where I think storing the public key
makes a lot of sense
so if I use asymmetric put a public key
on there I can even put that in my code
if I want it doesn't matter because if
anybody sees that it doesn't help them
only on my internal behind the firewall
system what I actually have the private
key that could do that decryption
there's as your key vault there's other
techniques depending on what your
deployment environment is how paranoid
you are what your threat models are how
people attack you etc but in general I
like doing the public key if it's a
website all right well thank you so much
for joining us Robert that was very
interesting next up we have John what is
John going to be talking about Xavier
John is gonna be talking about xamarin
and modern Android applications so we're
gonna hang up here on Robert and we're
gonna call him right up so it's stick to
and Kendra now gonna switch because like
we gotta take breaks from Dino dive and
we'll go from there
all right thanks so much thanks so much
Robert all right

Debugging with step filters on a project level

hello everyone I'm Isadora and I'm an
engineer in the visual studio debugger
team Microsoft and my main focus is
really hot reload and c-sharp but I
always doing a lot of random things
around C plus plus as well and for this
demo I'm going to Showcase what other
amazing developers on my team have been
working on as well which is native step
filtering but on a project level so for
this demo what I have here is I am GUI
which is an amazing open source library
that really just help you to display
stuff as an immediate UI helper here
what I have is one of the almost
documentation really where they have all
these examples on how to use their API
and what you can do with it so for
example here I can do some custom
renderings or I can do something which
is very very useful which is just
displaying tables and making them
resizable and doing different things
around it
so let's say that I'm using this open
source library and I want to see what it
does
so as a user here what I can do is
actually close this repo get started
with this demo and just just try
different things around
so the first thing that I'm going to
show here especially for this demo is uh
that's the tables so let's say that I
open here and then I'm going to find out
whatever this function does
so my first step is ADD butter is just a
step into it and see what it does
and you can see that I have this really
not expected view that I ended up in the
Constructor for I'm back because of
course I'm creating a vector somewhere
here in this call okay so what I can do
is just come here and then step into
begin table again
and then here again I'm creating the
string so I'm the Constructor for this
ring and not really what I expected to
be so I can just try again and then
finally I'm actually where I want to be
which is the some beginning table calls
and then I can just go further here
but as you can see this experience
cannot be very welcome for people who
are just onboarding your new project or
just trying to understand something
because it can be quite overwhelming
you're hitting a lot of this different
constructures and specific
implementation details of your project
also as a shout out before I can
continue one workaround that you can do
for this particular situation is that
you can actually right click and then
step into specific and then pick
whatever function you want to actually
step here so if I do beginning table you
can see that I have the same thing as
before and then I can go here and do
crazy stuff with it
but anyway there is something even
fancier that you can do and I'm going to
show you what it is
so first step here I'm going to pause
and then I'm going to open the solution
Explorer and there is this one neat file
that I want to copy which is called that
step filter
so I'm going to copy here this project
and now that it needs it needs to be
under source with the project similar to
Netflix for example if you ever use that
and then here what I did they actually
have this in the imq repo
and you might even argue that it can
always use netstat filters before Visual
Studio but you can see here even
instructions you have to copy into a
particular documents folder path
so again for new users just onboarding
in your project this can be quite
overwhelming that one of the steps is
just copying random files are around
your machine but now with 176 digital
Studio we provide a nice way that you
can simply have this in your project
other version control and then if you
click to debug again it's going to pick
up this exact file and just for the
specifics you can see here that it's
actually specifying the name for ivac 2
and I'm string and an action for not
stepping into it and I even added
something else just for myself that I
didn't want to stop anymore on any of
the overloading plus operators or any of
overloading operators really so I just
added two notes that into those and this
works very nicely so if I have here
again my demo and then again I can just
open the same beginning table and this
time I won't do anything fancy I'm just
simply going to step into again
and then you can see I'm actually what I
want to be and I didn't need to do
anything all I had to do was just call
and this file would already be here in
this report and I can have a much more
pleasant voting experience and this is
it I hope you learned something from it
and if you want more follow-up
information there's the Twitter handle
for PS debugger that I highly recommend

Deep Diagnostics for Web Apps with Application Insights

hello i am rahul Bogoria a product
manager on the visual studio application
insights team in today's increasingly
complex world of software having access
to the most relevant data that can help
you detect and fix production problems
as well as make future business
decisions is crucial for your
applications to succeed application
insights is a preview service in the
Microsoft Azure portal which can
definitely help you succeed
with deep Diagnostics and analytics
capabilities for any of your web apps
and services in this video I am going to
give you an overview tour of application
insights and discuss how you can detect
triage and diagnose real-world problems
for your web apps and services we will
visit the azure portal and I will take
you through a deep Diagnostics
experience with application insights for
a fully configured production app we
will discuss how quickly you can get
started on any web platform and in the
end we will cover the resources so that
you can learn more about the service and
get started today
application insights is an end-to-end
solution where telemetry data is
collected at every tier sent to the
cloud for processing and storage and
made available in a powerful and
interactive experience in Azure portal
we can talk about this in terms of three
key pillars firstly application insights
gives you a comprehensive view across
your entire application stack with deep
performance and diagnostics telemetry
available out of the box which you can
support with any custom data using our
open source SDKs secondly it provides a
set of powerful exploration tools
enabling you to quickly identify and
diagnose issues SS customer impact and
prioritize accordingly thirdly
application insights makes telemetry an
integral part of your development
process bridging pre and post production
testing and monitoring and providing
integrated experiences with Visual
Studio visual studio team services
and as your Diagnostics application
insights provides you with deep insights
and analytics enabling you to easily
detect and diagnose issues and
prioritize them based on their impact in
a typical detect triage diagnosed
scenario it provides a suite of
capabilities that you can take advantage
of to detect issues you can set up
synthetic availability tests pinging
your site at regular intervals from
points around the globe you can set up
elaborate multi-step web tests to
monitor resources and availability of
your back-end services and you can
monitor real user response times and
failure rates with threshold based
alerts notifying you in real time once
an issue is detected you need to assess
the impact and triage the situation with
information on real user impact and
affected requests it makes it easy to
prioritize fixes if 1% of all HTTP
requests fail that might not sound too
bad until you discover it's click here
to pay button that's failing so once you
are ready to diagnose the problem you
can go deep and analyze your data in
different ways slicing and dicing
acquiring logs and ultimately getting to
the line of code that requires fixing
all this correlated with any contextual
information required around request
performance counters remote dependencies
etc so let's check this out with the
demo here we are in the Microsoft Azure
portal where the application and site
service is hosted I'll click on one
asp.net application that I have been
running for quite some time
this application is hosted on an azure
VM and in one single look I can monitor
how my application is performing both
from client side as well as server side
I can also see how many failures are
occurring that I might want to care
about I can drill down into any of these
charts and metrics to get more details
and more context about these so let's
have a look I'll click on the server
response time chart and get more details
about that particular chart
I can see the server response time data
split across different continents and I
can get a sense of what's the average
response time looking like similarly I
can get details around the dependency
duration what's the typical request
pattern how many dependency calls are
made and so on if I go down the blade I
can get details around the slowest
requests that my site was generating and
some of these I might want to drill down
and explore further to diagnose the
issue similarly I can click on the
browser page load performance and get
more details from the client side on
what was the response time there how
many page views occurred and get a split
on the client performance around client
processing time send request time
receiving response time and so on I can
get a sense of the slowest page loads
which might be interesting for me to
figure out and diagnose further similar
to this I can click on field requests
and get more details about the failures
occurring for my application now these
failures can be occurring anywhere these
may be in your code in the back-end
service these might be in the
dependencies that you are calling for
example you are doing a database called
you are calling a web service some as
your storage requests so the issue can
happen anywhere and with application
insights you can track all of them very
easily now in this particular chart I
can get a sense that out of all the
failed requests that occurred in the
last 24 hours
there is a split of 304 occurring on
Internet Explorer 3 on Chrome and I can
get some insights and patterns from that
I can see that a total of seven
dependency errors have occurred and the
typical exception rate has been around
50 exceptions per hour which is a bit
high for my application and I would want
to figure out what's going wrong so once
I come down I can get a sense of which
are the most popular errors so I can see
that 98% of my errors are happening in
some report requests whereas only around
1.5 percent are occurring in a customer
create scenario while that is low from
my purse
that's a more important scenario that I
would want to resolve earlier so I click
on that to get a more instance level
detail on that particular issue now for
this particular error I can get each
individual instance on when that
exception occurred I can get a sense of
the real user impact as well so I can
see that there were five failures but
only two real users were impacted so in
a real situation this will give you an
idea about how many actual users got
impacted by some production issue with
which you can either take a
prioritization decision or impact your
communication methods so let us click on
one particular instance of this
exception and see what details we can
find to diagnose and solve the problem
so once the blade opens I can see
details around that particular failed
eQuest I can see what was the response
time what was the exact URL what was the
response code when did it occur and all
the different things I can get the
entire exception and I can click on it
to see the details around the exception
message as well as the entire call stack
now with this call stack I can easily go
to the exact page where the exception
was occurring and be able to drill down
the problem coming back I can see all
the remote dependencies that this
particular request was calling now with
application insights all these
dependencies are being monitored out of
the box without you having to write a
single line of code so in this
particular request there were multiple
database calls and one of them failed at
the end and that was the exact issue
with which this request failed now if I
want to diagnose that I just have to
click and get more details around that
failed dependency call I can see the
details that it's a sequel dependency I
can have the sequel statement where the
problem occurred as well as a dependency
call stack to be able to help me figure
out who I need to approach another thing
which is very important when you are
diagnosing a real production issue is to
figure out how the user could have
reached that particular point in the
product where they hid that issue and
that is where all telemetry for this you
session helps you a lot since
application insights is collecting all
the different data points from across
your application stack so we are able to
capture oil dependency calls all these
traces that you are sending all requests
that are generated even user pageviews
exceptions and any custom
instrumentation that you would have sent
from the SDK now with application
insights you can get a timeline based
view of when the from the point that the
user started a particular session what
exactly did they do so they came to the
home page a couple of log messages were
captured a dependency was called so on
and so forth till the point they hit an
exception and exited the scenario now
with this information it empowers you as
a developer to retrace or reproduce that
entire failure sequence and be able to
solve that situation much better now
let's come back to our overview page out
of all these metrics and properties that
we are just seeing here you can set up
alerts on top of any of them now these
alerts you can set up your own flexible
thresholds and say that if something
goes beyond or below a particular
threshold you can immediately get a
real-time email alert as an example I
have an alert setup here which says if
my CPU go the usage goes more than 10% I
want to be immediately alerted with an
email similarly you can set up alerts on
any custom metric any out-of-the-box
metric that application insights is
collecting for you we talked about
availability tests you can set up URL
ping tests and multi step web tests
right from the azure portal and all of
these web tests can be run in a regular
duration typically five minutes or so
and you have an option of around 16
global points of presence with which you
can test your data and once a failure
occurs you can click on a particular
failure you can get a geographically
distributed view and you can see what
has been the average response time for a
from a particular location and get more
and more details that you would wish to
diagnose further similar to this if
I am interested I can trade down further
into performance counters as well things
like IO memory process CPU and so on and
even get some basic usage and session
level details around how many active
users I have what are the most popular
pageviews how many sessions have
occurred and so on
with application insights you get this
entire interactive experience on the
azure portal but you also can export the
data directly to an azure blob storage
on top of which you can write your own
custom processing engine and they also
have articles available with which you
can set up an export to power bi to
excel to sequel and so on essentially
allowing you to further process and
correlate with any other data sources we
just saw how easy it is to detect triage
and diagnose issues in real time with
application insights it is equally easy
to get started for any web app or
service that you want to monitor if you
have access to code and can instrument
and redeploy the application you can get
the full suite of telemetry data
including basic usage and session
telemetry application insights comes as
part of Visual Studio for asp.net
developers integrates with the
Diagnostics hub in Visual Studio and
provides flexibility to search
production monitoring data right from
the ID you can also add our plugin to
eclipse for Java apps or use the
JavaScript snippet to monitor browser
side telemetry in HTML Javascript
websites if you want to monitor an
application already in production and do
not want to redeploy you can still get
the standard performance telemetry by
installing status monitor agent on your
is server or even with Azure extensions
for as your VMs or as your app services
to reiterate all our SDKs are open
sourced on github and available for most
of the popular web platforms with which
you can get started today and that wraps
up a quick overview of application
insights please consult these resources
for more information
and do look for other connect videos
diving deep into ALM and develop
scenarios we are looking forward to your
feedback and we hope it helps you to be
successful and much more productive
thanks for watching

Code like Mads

hello my name is Mads Kristensen and
I've been asked to show you how I use
Visual Studio so let's just jump right
in and take a look and let's start with
the tool windows that I have visible and
here at the bottom I have Error List and
I have the output window I always have
those two down there sometimes
additional windows will get down there
but I usually close them out for when
I'm done with them and over on the right
side I dock test Explorer solution
Explorer and team Explorer and they're
sitting over here always in this order
so that I can very easily get to the
things I need to do and I don't have too
much clutter so I like to keep things a
little bit night neat and clean and
here's an example of that so let's say
that I want to see the properties of a
file so I'm gonna hit f4 and my
properties window I actually open next
to my solution Explorer and I do that
because I don't usually that often and
when I do it's usually just to set a
single property or two and then close it
down again and so I don't want it to be
like permanent anywhere I like to have
it right here and then I just close it
out when I'm done with it and that's how
I do that so pretty nice and clean I'd
say I just have the standard toolbar up
here with one addition is that I've
added the manage extensions button right
here so I have easy access to my
extensions so let's take a look at the
options here so one thing that I have
done here is that I've removed some
check boxes so if you look at or
checkmarks rather so if we zoom in here
we can see that I don't want to reopen
documents and solution load and I don't
want to restore solution explorer
hierarchy state on solution load so
those are actually checked by default
and they have been for since forever
it's rather new that we have these two
check boxes
so that we can get rid of this default
behavior and let me just show you what
it is that these two settings help with
so let's just expand visual studio and
open some documents here and I'm gonna
close the solution so now now I want to
over the solution again and we're
probably used to opening a solution in a
visual studio automatically restore the
state that we were in the last time we
had the solution open so let's just do
that and we can see here that solution
Explorer does not keep the state
nothing is expanded everything's
collapsed and it did not open those
documents that were open before so
there's a couple of benefits to doing
this
one is that it's faster so the you know
time to solution open has reduced it so
I get a better performance out of it but
the main reason I do it is actually to
keep keep things a little simpler and to
reduce noise for myself so it's really
rare that I want to work on the same
file next time I open the solution and I
usually don't want to have the folders
open and you know multiple projects open
to the exact same state the next time I
work on the project which could be the
next day or the next month or even the
next year so for me that's just that's a
lot of sense to keep things clean this
way I use a lot of extensions too let's
take a look so I'm going to open the
extension manager and I got a whole
bunch here all sorts of things too much
stuff to go through some of them are
small some of them are bigger let me
give you an example of a small extension
I'm gonna zoom in here you know
sometimes you zoom in you're gonna show
your colleagues or whatever what's on
your screen you zoom into better so that
everyone can better see but now you want
to get back to a hundred percent and so
you can try to control and then mouse
wheel in and out until you hit a hundred
percent which can be hard to hit
sometimes so I have an extension that
just resets my zoom low
so control 0-0 puts everything back to a
hundred percent or whatever my default
is so I can set my default to be 100% or
to be hundred ten percent which is what
some people do not really a big thing
but it's just something I've come to
rely on and that's an example of a small
little feature another one that I use
actually quite frequently both when I do
web development asp.net and so on and
also when I write custom Visual Studio
extensions is the ability to optimize
and compress image files so they take up
as little space oh sorry a little weight
as possible
and so I have an extension called image
optimizer and that extensions allows me
to right-click any folder or a project
or solution what I'm doing here and I
can then optimize for best quality or
for best compression so best quality
means it will optimize a little bit so
you can't there's going to be no
difference in the quality of the images
they're going to look the same to the
human eye the next one here is for best
compression which compresses much much
harder so it makes the files a lot
smaller on disk not their dimensions
like width and height they stay the same
just on disk and there could be a
visible difference like you could see
the quality go down a little bit but
usually not and so this is actually the
one I always use I optimize for best
compression so if I click that some
processes kick in all run in the
background a bright background threats I
can see exactly what happened and I've
reduced the size of my images between
you know 3% and 11% so that's that's
quite a lot to do
just from a right-click and these are
images that I already optimized once
before but recently I updated the
algorithm to compress even better and so
I was able to squeeze more how do these
images so that's my setup I hope this
was interesting to some of you thanks
for watching