To end this hello world sample we're gonna
be a bit more straightened about our security
here.
So what we're gonna do is we're gonna
manage user secrets so we can store the
secrets in a secret location.
This is beyond the scope of the video
how user secrets in general works in .NET,
but let's just put them in here.
Endpoint equals our endpoint here.
And I'm using user secrets.
You could use environment variables, you could use
keyboards, all depending on what you normally feel
is the correct way of securing your things.
But I just want to have it in
here as well so you don't leave your
keys in clear text because that's an absolute
no-no in 2026.
So we just put them in here and
then we write a little bit of code
in order to get hold of them.
So we're doing a configuration manager and adding
our secrets here which is our programme and
building an configuration manager.
And that way we can say config get
the endpoint we know it's okay config API
key and we will check if it still
works.
So now our code is free of secrets
and of course we now need to go
up in in my case go up and
delete the key because I've exposed the secret
key.
So I will delete it and create a
new one for the following lectures.
And up in Azure I would need to
go to operate.
I would need to go to admin.
I would need to go to the parent
resource of that project and manage it in
Azure portal which I've done up here.
I will go to resource management go to
keys and endpoints.
And here I would be able to regenerate
the keys so they would not be exposed.
So now we went from doing the absolute
worst thing you can do putting API keys
and stuff into your code to actually having
it secure.
Now again I need to regenerate some new
ones and put them in instead of what
we saw in here but these are invalid
now.
The endpoint as such is not a secret
but I tend to put it here as
well or into some application.JSON so it's
not in code because then it's easier to
replace.
But that is the end of the hello
world.
Now we will go back into a bit
more learning mode and looking into much more
advanced things like more providers, more ways of
doing chat and so on.
Going back to the four key concepts of
AI.