Keep your code clean with Unit Test

After day by day, week by week, month to month headache to setup Unit Test, I decide to use some useful tools to give me more readable Unit Test. I decide to use XUnit, Moq, and Autofac. The XUnit as the main tools to run the unit test. I use Moq to help me test my code without real execution of my third parties dependencies. Why Autofac? Hemm… Not have specific reason of that, but I use great tools like Autofac.Extras.Moq, this library help me to have “Dependency Injection” to my unit test, it will bring my code more cleaner…


You should look this!

We can learn more from Microsoft Learn! Microsoft Learn is free resources to learn most of technology aspects. We can learn about Azure AD, Git, Github, Data Science, Data Analyst, etc.

You can check from this resources about Azure AD:

Microsoft Learn Page

My Microsoft Learn Page Dashboard

Infographics

https://www.instagram.com/p/CMNL0tLhT97/


Monitor your apps!

Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

If you want to know more Azure App Insight, please visit the documentation here.

Why I write this? Yeah, to remember what I’ve learned. This article only summary from this module.

Note: Hemm… Because some features from Azure very quick to changes, somehow the guide from that module not relevant again. This article also maybe not relevant after some months!

Step by Step

Prepare your apps!

In this article, we use NetCore. So we can install the library Microsoft.ApplicationInsights.AspNetCore

The repositories come from here, you also can deploy from there!

Easy setup!

I just add this one line to ConfigureServices after install the library/nuget

services.AddApplicationInsightsTelemetry();

Check…


What is App Center? https://visualstudio.microsoft.com/app-center/

In short, Visual Studio App Center a.k.a App Center, tools that helps for build, test, deploy and monitor iOS, Android, Windows, and macOS apps. :)

I just tried to integrate my existing Android App for monitoring. It’s easy to implement. Here is the sample dashboard.

Monitoring

Great experience to see this.

Quite easy to integrate also, you will be guided at the first page.


Why my logs not shown?

I will assume you are already have deployed the applications at Azure Web App, but it show nothing at Log Stream. Here is the Log stream looks.

Log stream

Log stream menu under Monitoring section.

When you have warning about the App Service logs not activated, you come to the right place. You need to go App Service logs menu under Monitoring section.


What are my mistakes that make me failed AZ-500 exam?

Photo by Brett Jordan on Unsplash

In case you don’t know what is AZ-500, please check this link.

In short, AZ-500 the exams that check your skills and knowledge about Security Technologies that you can utilize at Microsoft Azure. Big pictures that tested in this exam quite small than another exams (in my opinion).

  • Manage identity and access (30–35%)
  • Implement platform protection (15–20%)
  • Manage security operations (25–30%)
  • Secure data and applications (20–25%)

Ok, why I write this article? To motivate you and not do same mistake as I took. You should know, I failed this exam for first take. I believe it will happened to me…


Containerize Flask and Deploy to Azure App Service

Photo by Richy Great on Unsplash

Note: The main focus is not about to build the Flask App, but guide you to setup CI/CD into your existing Flask App and some recommendation to deploy it.

Flask

I will not bring to much how you build web from Flask. I will give some main aspects from Flask and how we containerize them. Your project may have different structure with me but actually it will not really different. Please see my repo here for the last result.

Feel free to use my repositories or just follow the tutorial from Flask: https://flask.palletsprojects.com/en/1.1.x/tutorial/

We have same structure, which the main project…


Photo by Green Chameleon on Unsplash

I really happy because I can passed the exam of AZ-204. If you still don’t know what is AZ-204, I hope you can check this link. In short, this certification, will test your knowledge to develop software/apps that will use Azure Resources. It’s many aspects/materials like VM (Virtual Machines), Web App, etc. I can’t write too much here, because you will be bored when I write long post.

What resources that I used?

I use some sites to help me learn the materials.

  1. Microsoft Learn. Ah, this site really helpful, I can use the sandbox so will help me to understand more deeply in technical…

Convert PDF to JPEGs

Photo by William Hook on Unsplash

Background

I have though to build an application that automated my task. I usually do screen capture use print page as pdf after that convert it into images. I use print page because need the full pages. I know, why I’m not decided to find/create extension for that browser. I want this because I want not too specific browser. My solution should work for another task too. It’s good when I can cut some tasks.

My previous task is

  1. Print as PDF
  2. Open the PDF use GIMP
  3. Export as JPEG

The task will more complicated when I need convert much PDF…


ML Course at Dicoding

Learning Machine Learning Development — Belajar Pengembangan Machine Learning, I very like this course. What I get from this course mostly what Tensorflow Certification test. It’s about NLP (Natural Language Processing), Time Series, and Image Classification. How great the course! In case you want to know the course, please visit on here, this course taught at Bahasa Indonesia, so if you use English, better to try another course that related, but this course very worth if you use Bahasa Indonesia and this is the best.

Belajar Pengembangan Machine Learning

I want to tell, what the criteria that you need to achieve to finish this…

Bervianto Leo Pratama

Backend Developer — Focus at Microservices and Cloud Computing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store