Azure API Management

  • Discoverability
  • Better documentation
  • Security Gateway
  • Throttling- Quotas
  • Caching
  • API Router
  • API Facade
  • Analysis, Health – AppInsight
  • API – Lifecycle Management
  • Versioning

Untitled

We can write c# code snippets @{context.Request}

Capture

API Manager in VNet.

Frond end is application gateway.

APIManagerInVNet.PNG

Learning Resources:

https://channel9.msdn.com/Blogs/Azure/Azure-API-Management-Overview?ocid=player

 

GIT

Git is a distributed version control. TFS is a centralized version control.

Lets say if TFS data is corrupted or backup are gone. Entire History is gone. Even if the developers has local copy. From Local copy’s there is no way of retrieving the History. Where as with Git if the server version is gone. If any developer has the copy we can copy that server. It’s a full clone of data in local.

  • As it is a full clone we can check the history with out internet.
  • We can commit changes locally. In TFS we can’t commit changes locally we need internet connection to commit changes.

Check-in/Checkout  — Push/Pull

Git data transport commands

Ref : https://stackoverflow.com/questions/2745076/what-are-the-differences-between-git-commit-and-git-push

https://git-scm.com/about/distributed

SHA- Hash for a text/file, TREE, Change set,

Branch : Points to a change set. Which will have trees and references to blobs

HEAD : Is a pointer to branch.

Checkout: Move Head to different branch and update working area.

Merge & Rebase. Merge Preserve history, Rebase wipes out history.

Grabage collection

Capture

Git Clone : To copy all the content from remote server to local server.

Fetch –> Merge –> Push

Fork is a clone on cloud. Our own version of original in remote machine. From that we can clone to local machine.

How Git Works By Paolo Perrotta

Course Completion Certificate

OO Design principles & Patterns

Reference to this content is Head First Design patterns book.

Uncle Bob : These are the 3 important characteristics of a bad design that should be avoided.

  1. Rigidity: Hard to change, change effect multiple parts of the system.
  2. Fragile: Change in one place break stuff in another place.
  3. Immobility: Hard to reuse in other applications. Because it’s can’t be entangled from an application.

SOLID

S – Single Responsibility

O – Open close principle

L –

Strategy

  • One constant in software development is? CHANGE. Change is inevitable. Any application must grow and change or die.
  • Design principle – Identify the aspects of your application that vary and separate them from what stays the same.
  • Design principle – Program to an interface not to implementation.
  • Design principle – Prefer composition over inheritance. Has-A is better than Is-A

Definition: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy let the algorithms vary independently from the client that uses it.

Observer

Decorator

Factory

  • Try to minimize using the new keyword. new means it’s a concrete class and it is more fragile and less flexible.

Singleton

Command

Adapter and Facade

Template Method Pattern

Builder

Powershell

This MVA Powershell course is awesome. Both instructors explained in details.

Notes:-

  • Verb-Noun
  • Tab for auto completion
  • cmdlets vs modules.
  • Powershell Object model
    • Get-Service “WwanSvc” | Get-Member
    • TypeName: System.ServiceProcess.ServiceController
    • Get-Service “WwanSvc” | select -ExpandProperty Name | Get-Member
    • TypeName: System.String
  • Get-Help *command*
  • help “*command*” -examples, -details , -full, -online, -showwindow
  • Get-Service
  • Get-Service | where -Property name -like “*w*”
  • Get-Service | where -Property name -like “*wSearch” | Get-Member
  • Get-Service | where -Property status -eq “running”
  • Get-Service | where -Property status -eq “running” | Select-Object -Property status, name | Format-Table
  • 1,2,3 | %{ write-host $_ } $_ to get the current iteam in iteration
  • Pipeline cmdlets cmdlet1 | cmdlet2 .  ByValue, ByPropertyName

Remoting :

  • Enter-PSSession Server01
  • Exit -PSSession
  • Invoke-Command -ComputerName Server01, Server02 -ScriptBlock {Get-UICulture}
  • Invoke-Command -ComputerName Server01, Server02 -FilePath c:\Scripts\DiskCollect.ps1 — LocalPath we are running this script.

Scripts

.\mkazuretraining-Script.ps1

Modules

Before we execute any cmdlets respective module need to be imported.

Import-Module

Get-Command -Module Azure

 

 

 

 

 

How to Prepare for Azure 07-532 Certification. Week 1

I have been preparing for Azure certification from few months. So far it’s all random there is no SOLID step by step procedure and course for it. So I started a training batch for it.

I think the prerequisites before we start learning azure is PowerShell.

This week I started learning/refreshing PowerShell. Microsoft virtual academy

Getting started with Microsoft PowerShell.

https://mva.microsoft.com/en-US/training-courses/getting-started-with-microsoft-powershell-8276?l=r54IrOWy_2304984382

Before I start I have a lot of questions on PowerShell. It’s good to start with questions and why? why? why?

What is the scripting environment?
How to run the scripting.
How to debug the script.
I know c# and OOP. How scripting is comparable to c#.

What are the things we can do with Powershell?

 

 

 

 

 

 

 

 

Architected Multitenant Saas Application using NoSql-DocumentDB(CosmosDB), AzureBlob Storage, Azure Functions, Asp.Net Identity, Google OAuth, Mailgun & SendGrid.

After a long time I am back to blogging. Was very busy with lot of things.

I recently worked on Architecture and development of  Multitenant Saas Application using DocumentDB, Azure Functions, Azure Blob, Asp.Net Identity, Azure Functions, OAuth, DNS Setup. I will  publish the design soon….

 

I learned a lot from this project.

 

 

 

 

 

 

Http Cache, .Net Core http cache for Static Resources

Learn http cache basics in this link.

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=en

Keywords: Etag, Last modified, If non match(304 Not modified). All these are handled  by  Microsoft.AspNetCore.StaticFiles Middleware.

To server static content in .Net Core Application,  StaticFile Middleware need to added.

https://docs.asp.net/en/latest/fundamentals/static-files.html

Cache control header: we need to explicitly setup our own cache control policy at startup.


 app.UseStaticFiles();

 app.UseStaticFiles(new StaticFileOptions()
 {
  OnPrepareResponse = (context) =>
   {
     context.Context.Response.Headers["Cache-Control"] = "no-cache, no-store";
     context.Context.Response.Headers["Pragma"] = "no-cache";
     context.Context.Response.Headers["Expires"] = "-1";
  }
 });