Wednesday, December 27, 2023

AZ-204 exam Resources

 Amazing Microsoft Resources

Here are some official Microsoft websites that you really should bookmark when studying for the AZ-204 exam:

Learning paths on MS Learn:

https://docs.microsoft.com/en-us/learn/certifications/exams/az-204#two-ways-to-prepare

Azure Code Samples:

https://azure.microsoft.com/en-us/resources/samples/?sort=0

Official Azure Documentation:

https://docs.microsoft.com/en-us/azure/

Official Microsoft Developer YouTube Channel

https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g

Azure REST API Browser

https://docs.microsoft.com/en-us/rest/api/?view=Azure


Microsoft Labs and Workshops - Practice is the key to success

Azure Citadel - Labs and Workshops

https://azurecitadel.com/

Microsoft Cloud Workshop - More labs and workshops

https://microsoftcloudworkshop.com/

Github AZ-204 from Microsoft Training

https://microsoftlearning.github.io/AZ-204-DevelopingSolutionsforMicrosoftAzure/


Practice test complement to this course available from Udemy.


Hands On Labs for AZ-204
AZ-204:

Microsoft has a Github page that contains labs for AZ-204:

https://github.com/MicrosoftLearning/AZ-204-DevelopingSolutionsforMicrosoftAzure

This gives you step-by-step instructions for creating resources in the Azure Portal, and even deploying sample code into web apps.

e.g.

Try this, and hopefully, this will enhance your skill level with Azure Development.

Since this is a Microsoft supported GitHub repository, I can't help debug any issues. But it should help you learn the topic.

Tuesday, December 19, 2023

Token-based authentication

Token-based authentication is a widely used approach to secure web APIs. It involves the client application sending a request to the authentication server with valid credentials. The authentication server responds with an access token that contains enough data to identify a particular user and has an expiry time. The client application then uses the token to access restricted resources in subsequent requests until the token is valid. If the access token is expired, the client application can request a new access token by using a refresh token 1.

In C#, you can implement token-based authentication in Web APIs using OAuth. OAuth is an open standard for token-based authentication and authorization on the internet 1. Here are some steps to implement token-based authentication in Web APIs using OAuth:

  1. Create an ASP.NET Web project in Visual Studio 2019.
  2. Add NuGet references like Microsoft.Owin.Host.SystemWebMicrosoft.Owin.Security.OAuth, and Microsoft.Owin.Cors.
  3. Create an ApiAuthorizationServerProvider.cs class file to provide credentials to access data depending on username, password, and roles 1.
  4. Use OAuth authentication to create a token-based authentication API 1.

You can also use HTTP authentication schemes (Basic & Bearer), API keys, or OpenID Connect for Web API authentication 1.


WEB API

 ASP Dot NET MVC 4 is REST-Based while Microsoft WEB API is RESTFul.

MVC supports only some of the above REST principles whereas WEB API supports all the above REST Principles.

MVC only supports the following from the REST API

  • We can access the resource using URI

  • It supports the HTTP verb to access the resource from server

  • It can return the results in the form of JSON, XML, that is the HTTPResponse.

However, at the same time in MVC

  • We can use the session

  • We can make it stateful

  • We can return video or image from the controller action method which basically violates the REST principles

That is why MVC is REST-Based whereas WEB API supports all the above principles and is RESTFul.