ShareBlog






         Another Azure site

September 15, 2017

Debug Azure code in PRODUCTION without affecting users

Filed under: Uncategorized @ 6:48 pm

If you have not heard of Azure Snapshot debugger, part of Application Insights, it is well worth your time to become acquainted with it.  It allows you to view a debug session of a production instance in the browser as well as download the information into Visual Studio for more debugging.

This week’s Azure Friday is about it and they walk you through an example of how to debug an issue in production code.  In addition there is an excellent MSDN article about it as well.  Even though the article is geared towards .Net Core, Snapshot debugger also works with .Net.

This is going to be a very useful tool to add to your debugging arsenal.

 

 

Get your credentials in Azure without knowing the credentials

Filed under: Uncategorized @ 11:36 am

Microsoft just released a preview of the Azure AD Managed Service Identity (MSI) feature.  What this will allow you to do is to completely stop having to store credentials either in code (which is a MAJOR no-no) , in your config file (slightly better), or anywhere else.  Azure will generate a “bootstrap identity” which can then be used to access other Azure features to get information.  If you need to store a password for a 3rd party system, you could place it in the Azure Key Vault and use MSI to get access to the Key Vault without having to save the Key Vault access codes anywhere.

Just another way Microsoft is making Azure more and more secure.

For more information check out the Microsoft Azure blog posting.

August 30, 2017

Azure Blog storage events in preview

Filed under: Uncategorized @ 11:09 am

Edit:  You need to opt-in to this and Microsoft is only letting a few tenants in at a time. Go to this site for more information.

In a continuation of the announcement of the Azure Event Grid, Azure Blob storage now has storage events in preview.  Azure Blob storage will trigger events when a blob is added or deleted (no word on any other events like blob modification) and right now it is only available for the US West Central location with more locations coming soon.

Read the full announcement here

August 29, 2017

Big difference between on-premises and cloud development

Filed under: Uncategorized @ 12:02 pm

In an interview I had recently (been doing that a lot lately trying to find a good job) I had one person ask me “What do you feel is the biggest difference between developing for on-premises and the cloud?”   That one caught me a bit off guard as I have never really considered it before.  Is it the fact that you have so many readily available services to use?  The fact that you can scale out your code quickly and easily? The fact that you can make it instantly available to everyone in the world? The tools involved?  I was thinking of all those items when it the answer came to me in a flash.  It isn’t any of those things (at least in my opinion).  It is how you handle errors.

When you are on-premises you do everything you can to make sure that your program will not stop for any reason.  This starts with the hardware.  Your server will most likely have multiple power supplies, each of those plugged into a different circuit, RAID enabled hard disks, and more to keep the machine up and running.  Then it is up to you, as a developer, to make sure the program does not crash when encountering an error by checking inputs and uses of Try/Catch blocks (in C#).

It is different in the cloud.  First, you have no idea what the hardware configuration is for the server.  Does it have multiple power supplies?  Maybe and then again maybe not.  There is a saying I keep hearing when talking about cloud hardware:  “Cloud servers are treated more like cattle than pets.”  Meaning if one server has an issue it is just replaced.  It can be sent somewhere else to be fixed but as far as the cloud provider is concerned it is easier to replace it than fix it right there and then (I should note I do not care for this saying.  Growing up in Dairy country I know how important the cows are). In any case, if a machine has an issue there is no consideration as to what the server is doing, it will be shut down and replaced.  If your code is running then it dies (it is always a good idea to make sure you have at least 2 copies of your software running for just such a reason).

There are plenty of other issues that can happen in the cloud that may not happen on-premises.  You may not be able to access your SQL server due to network issues.  Granted, this can happen on-premises but at least you have a phone number that you can call and someone to yell at 🙂   You may also be running on a shared server and the other applications start taking up too much CPU or network bandwidth.  In any event, cloud applications need to be able to die and restart gracefully which is something that most on-premises applications are not written to do.  Of course, you still want to check your inputs and catch errors but you need to decide if an error is severe enough to just start over or continue.

Edit: As I was writing this I noticed that Jeffrey Richter release a video series called Architecting Distributed Cloud Applications which discusses a lot of the same topics

August 23, 2017

Microsoft announces Archive Blob storage

Filed under: Uncategorized @ 3:21 pm

Microsoft announced today the public preview of Azure Archive Blob storage. This gives you a way to cheaply store documents that you need to keep, perhaps for legal reasons, but you are fairly certain you will not need to look at often, if at all. The actual pricing has not yet been released but seeing how Cool Blob storage costs $0.01/GB/month, it is sure to less than that.

I know that one place I worked has a large room full of documentation that probably no one will ever read (unless there is an audit in which case the auditor usually just checks to make sure the document is actually there).  Imagine scanning all those documents and then putting them into Archive Blob storage.  This will free up the room for other tasks not to mention saving money on printing and binders.  Setup Azure Search to index the Archived Blobs and then you can easily search for keywords if an audit ever occurs.  With a 99% availability SLA, accessing the data should never be an issue.

As part of the announcement, Microsoft also stated that you can change the level of the Blob (Hot, Cold, or Archive) without having to move the Blob to a different account.  In addition this can be done using .NET, Python, or Node.js with Java  and portal support coming soon.   By allowing .Net access you can easily write a function or logic app that checks the last modified date or some tag on the document and change its level according automatically.

Check out Microsoft’s Azure blog post for more information as well as how to sign up for this public preview.

August 22, 2017

See what is coming next for the Azure Portal

Filed under: Uncategorized @ 4:18 pm

It goes without saying that if you are using Azure you are aware of the Azure portal and can access it via https://portal.azure.com. However, did you know that you can see what is coming soon to the Azure portal by going to https://preview.portal.azure.com ?  This gives you a chance to check out the newest features before they arrive.  Everything else in the portal is the same and you can have both the preview and regular portals open at the same time.

Scott Hanselman has a video showcasing some of the newest features you can expect soon (as of writing this of course).  Check out the video here

 

August 16, 2017

Azure Event Grids in Preview now

Filed under: Uncategorized @ 4:50 pm

Azure Event Grid was just released into preview today.  What this does is enable Azure applications to become more reactive.  Rather than polling to see if something has been done, Azure Event Grid can ping your program when it gets an event letting it know that something has occurred.  There is a great tutorial on how to setup a logic app to respond to Azure VM changes.  Go to the link at the bottom of this page to find it.

Right now there is limited support for publishers and handlers but the goal is to eventually allow any Azure app to send or receive events.  As stated in the announcement page: “We are working to deliver many more event sources and destinations later this year, including Azure Active Directory, API Management, IoT Hub, Service Bus, Azure Data Lake Store, Azure Cosmos DB, Azure Data Factory, and Storage Queues.”  Also notice that one of the handlers is webhooks meaning that your applications can respond to these events today!While Azure Event Grid is in preview , the first 100,000 operations per month are FREE and then it is just $0.30 per million operations.

Take a look at the Azure Event Grid announcement page for more information and an introduction video.

August 13, 2017

64bit Visual Studio Code is now available!

Filed under: Uncategorized @ 3:45 pm

The July 2017 update for Visual Studio Code is now available and one of the best new features, in my opinion, is the new 64bit version of VS Code!  You are using VS Code, right?  If not, why not?  It is a great free editor.  Granted it does not have all the features of Visual Studio 2017 but did I mention it was free?  I use it for all of my Angular development projects and if I need to look at some JSON value that was returned it is a lot faster to bring this up than the full blown Visual Studio.  Don’t get me wrong, I still use Visual Studio a lot, especially for my C# development!  But Visual Studio is a full blown Integrated Development Environment  (IDE) while VS Code it just an editor (although with all the add-ins coming out it is becoming more and more like an IDE).

Just like everything else in the world, the right tool for the right job.  As I said, I find VS code works best for my Angular development needs and Visual Studio works best for all my .Net development.

In any case, head out to the July 2017 update announcement page to see what is new and improved in VS Code and if you have not tried it, give it a shot.

August 7, 2017

CAP Theorem

Filed under: Uncategorized @ 6:06 pm

In continuing my discussion of cloud design patterns, this post talks about the CAP theorem (also known as Brewer’s theorem after the computer scientist, Eric Brewer, who coined it) which is about distributed systems. While this is not 100% a cloud design pattern it is very unlikely that any system designed for the cloud can avoid this theorem.

What the theorem states is that a distributed system is comprised of Consistency, Availability, and Partition tolerance.  Out of the three, you can only guarantee two (much like the consultant’s joke “On-time, On-budget, working: choose any two). However it then goes on to say that since no system is safe from network failures you have to choose Partition tolerance as one of your choices so this leaves you with Availability or Consistency.

Now this does not mean that you always have to choose between Availability or Consistency.  This only means that if there is a network failure then you need to choose.  Keep in mind that there is no right or wrong answer. It really depends on the system.  Can you live with being able to access the system and have the data updated at some future point (also known as eventual consistency) or do you have to know that if you access the system the data you enter will immediately be updated.

Here are some real world examples to help you understand this a bit better.  When you access Facebook to enter a new update you almost always get access to it but your post may take a little while to show up.  This is because Facebook choose availability over Consistency in this case (in all honestly I am not 100% sure this is the case but it fits the profile).  You know you have accessed Facebook because it accepted your post and you know that your post will show up at some point in time, usually in a few seconds.

Now on the other hand think about purchasing stock online.  If you purchase 100 shares of Microsoft at X dollars you need to KNOW that the transaction went through completely.  You can imagine what would happen if various people stated that they bought the stock but only one person’s transaction was actually recorded.  This is choosing Consistency over Availability (granted you also always need to be able to access your stock portfolio all the time but work with me here).

So which do you choose when?  There is no hard and fast rule.  It will depend on the system and the data that it is working with.  My personal opinion is that you will see more and more systems choosing Availability. Think about it this way, are you more annoyed when your Facebook posts show up a minute later or when you cannot access Facebook at all?

When I was first presented with CAP I choose Consistency over Availability but as I read more about it and thought it I usually choose Availability over Consistency and rely on eventual consistency.  Actually when I was first presented with CAP it was during an interview and that is NOT when you want to first hear about it 🙂  I am actually embarrassed that I had not heard of it before but live and learn!

Hope this helps someone avoid the same embarrassment that I ran into learning about CAP the hard way.

 

 

July 22, 2017

Cloud patterns in plain English

Filed under: Uncategorized @ 3:00 pm

I was having a discussion with some people after a geeky meetup the other night and we started talking about design patterns for the cloud. A couple of people mentioned that they were a bit confused on some of them due to not understanding the concept behind the pattern. This post is to help alleviate that confusion. It lists the pattern, the definition from the Microsoft Cloud Design Patterns site (https://docs.microsoft.com/en-us/azure/architecture/patterns/), and then, hopefully, a real world example of what the pattern means (some of which will be better than others).

 

Ambassador

Create helper services that send network requests on behalf of a consumer service or application.

Back in the days when communication across the oceans was long process Ambassadors spoke for the nation. They were not the entire nation but they represented the nation and acted on the nation’s behalf

Anti-Corruption Layer

Implement a façade or adapter layer between a modern application and a legacy system.

When I am visiting my niece and her kids I need my niece to interpret what her kids are saying due to their use of slang I don’t understand (funny thing is they say the same thing). My niece is acting as the “Anti-Corruption Layer” by translating what is being said.

Backends for Frontends

Create separate backend services to be consumed by specific frontend applications or interfaces.

If you go to the grocery store there are multiple check-out lanes. Each cashier can be considered a backend for the frontend (the check-out line). Taken a bit further the self-checkout line could be considered one example while the other lines with cashiers could be considered a separate example.

Bulkhead

Isolate elements of an application into pools so that if one fails, the others will continue to function.

You ever watch movies of submarines or ships that get hit by a torpedo or hit a rock? There are people closing those big doors and spin a wheel to lock them so that the water in one room does not continue into the rest of the ship. Those are bulkheads.

Cache-Aside

Load data on demand into a cache from a data store

If you have a Ebook reader with a small amount of memory you can store a limited number of books in the reader and the rest you will need to download from the store to read. In this case the reader is the cache. You can get to the books quickly to read them rather than having to download the book from the store.

Circuit Breaker

Handle faults that might take a variable amount of time to fix when connecting to a remote service or resource.

The electric circuit breaker in your house (hence the name). It is designed to flip, which stops the flow of electricity, if too much current passes through it.

CQRS

Segregate operations that read data from operations that update data by using separate interfaces.

You can compare this to the lines at a movie theater. There is one line where you have to select the movie and purchase your ticket (which is comparable to the update interface) and other line to print out the ticket you bought online (which is comparable to the read interface).

Compensating Transaction

Undo the work performed by a series of steps, which together define an eventually consistent operation.

If you are going on vacation there are a lot of steps to take. Find a good spot, book hotel, buy new bathing suit, book place to board the dog, get time off from work (yes, you should probably due that first but bear with me). You then find out that your boss has rejected your time off request. So now you need to undo all the steps: cancel reservation for dog boarding, return bathing suit, cancel hotel, etc.

Competing Consumers

Enable multiple concurrent consumers to process messages received on the same messaging channel.

Have you seen pictures of the old phone switchboards? There would many ladies answering the calls and connecting them to the right place. That way there would not a lot of people waiting for one person to connect them to the right place.

Compute Resource Consolidation

Consolidate multiple tasks or operations into a single computational unit

Rather than making individual trips in the car to go grocery shopping, pick up some flowers, buy a new bathing suit, and go to the doctors you combine them all into one trip.

Event Sourcing

Use an append-only store to record the full series of events that describe actions taken on data in a domain.

A recipe doesn’t just tell you what the final product should look and taste like. No, it tells you each step you took to get to that final product. You did step 1 and then step 2, step 3, and so on to get to the fried chicken.

External Configuration Store

Move configuration information out of the application deployment package to a centralized location.interface) and a

This is much like having devices get their configuration from the internet rather than having to set them up. Any time you plug in a USB device it can go out to the internet to get the information it needs to setup rather than having you do it. Do you remember having to install the drivers from a floppy disk?

Federated Identity

Delegate authentication to an external identity provider.

Your driver’s license. People take it that the issuing state has done all the needed checks and that you are who you say you are.

Gatekeeper

Protect applications and services by using a dedicated host instance that acts as a broker between clients and the application or service, validates and sanitizes requests, and passes requests and data between them.

A door that goes into a room where there is another door to leave, but it requires a different key to open the second door.

Gateway Aggregation

Use a gateway to aggregate multiple individual requests into a single request.

Say you have a friend serving in the military and around Christmas time everyone wants to send them a present. Rather than having everyone send a present separately you put all the presents in one big box and send just that one. When the box arrives the soldier unpacks the individual presents

Gateway
Offloading

Offload shared or specialized service functionality to a gateway proxy.

In ancient times everyone was a farmer, hunter, builder, etc. Then people started to specialize. You could go the farm down to the road and trade some extra meat you hunted for your vegetables. By offloading the need for everyone to be able to do everything allowed for specialization.

Gateway Routing

Route requests to multiple services using a single endpoint.

Think of this as a mall. There are multiple stores inside a mall but you only need to go one place to get to all of them.

Health Endpoint Monitoring

Implement functional checks in an application that external tools can access through exposed endpoints at regular intervals.

For me, this is like calling your aging parents frequently to make sure they are feeling alright.

Index Table

Create indexes over the fields in data stores that are frequently referenced by queries.

If you have a lot of songs on your Ipod you want to be able to find them in different ways. For example, maybe you want them sorted alphabetically, by genre, by artist, etc. Each way you sort them is a different index so you can find the songs easily different ways.

Leader Election

Coordinate the actions performed by a collection of collaborating task instances in a distributed application by electing one instance as the leader that assumes responsibility for managing the other instances.

Democracy. We elect a person to act as our leader whether it be mayor, governor, or president.

Materialized View

Generate prepopulated views over the data in one or more data stores when the data isn’t ideally formatted for required query operations.

A newspaper would be a good example. Rather than going out and grabbing each story that we want to see, the newspaper presents them in one place formatted to make it easier to read

Pipes and
Filters

Break down a task that performs complex processing into a series of separate elements that can be reused.

Growing up each kid had their own set of chores to do in order to keep the house clean. If you say that keeping the house clean is the complex task it can be broken down into the individual chores that can be done separately and at different times (or when your mother screamed at you to do them) with some occurring more than others (you do the dishes every night but vacuum maybe every third day or so)

Priority Queue

Prioritize requests sent to services so that requests with a higher priority are received and processed more quickly than those with a lower priority.

You ever pay for the VIP line at an event? You get in faster than the other people in the regular line.

Queue-Based Load
Leveling

Use a queue that acts as a buffer between a task and a service that it invokes in order to smooth intermittent heavy loads.

This can be thought of as a to-do list that you work on from top to bottom. You add new tasks to the bottom of the list and take them off (cross them out) at the top. So rather than stressing about everything that needs to get done you can put them on the list (queue) and handle them one at a time

Retry

Enable an application to handle anticipated, temporary failures when it tries to connect to a service or network resource by transparently retrying an operation that’s previously failed.

You call someone and it doesn’t go through (either a busy signal or you go to voicemail) so you call again.

Scheduler Agent Supervisor

Coordinate a set of actions across a distributed set of services and other remote resources.

The vacation example that I used for the “Compensating Transaction” works here as well with the difference being that Mom acts as a supervisor and the kids are the agents that actually perform the tasks. Mom assigns the tasks to the kids and keeps track of who has done what. If one of the kids fails at the assigned task (for example cannot find a good hotel) then Mom will ask them try to again and will determine when it is time to give up and cancel everything.

Sharding

Divide a data store into a set of horizontal partitions or shards.

If you have a large number of DVDs (or songs on your Ipod) you can break them up alphabetically, by genre, by star or other ways so that instead of one huge collection you have smaller collections making it easy to manage them.

Sidecar

Deploy components of an application into a separate process or container to provide isolation and encapsulation.

This is also called a sidekick pattern and I like it better since it makes it easier to understand. A superhero’s sidekick (think of Batman’s Robin) is there to support the superhero (Batman) and provide additional features (more Batarangs or a diversion).

Static Content Hosting

Deploy static content to a cloud-based storage service that can deliver them directly to the client.

Most restaurants don’t print out their menus for each person. Rather, since they do not change much, they can print out the menus beforehand and have them available (static content). If there are daily updates those can be written on a chalkboard (dynamic content)

Strangler

Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services.

Imagine you buy an old house and want to fix it up. You may update the plumbing first the electric sometime later, followed by the floors a bit later, and so on.

Throttling

Control the consumption of resources used by an instance of an application, an individual tenant, or an entire service.

Every parent has told their child that was learning to drive “You are going too fast”. The parent is throttling the speed of the car; controlling how fast it can go.

Valet Key

Use a token or key that provides clients with restricted direct access to a specific resource or service.

The valet key that comes with some cars. It can open the doors and start the car but not open the trunk.

Next Page »

© 2017 ShareBlog   Provided by WPMU DEV -The WordPress Experts   Hosted by Microsoft MVPs