Category: Best Practices

Azure App Service

Troubleshooting App Services in Azure

In this blog post, I wanted to cover how to go about troubleshooting an App Service in Aure which is a web app with a SQL server backend whereby users have reported issues with the slow performance of the website.

The first thinh I tend to look at is the backend store, in this case, Azure SQL Server and we have some really great tooling we can use to troubleshoot perforamce issues with Azure SQL.

The first port of call was to open up the Azure Portal and go to the Resource Group with the issues and click on the SQL Server database and head to the Intelligent Performance section on the left-hand menu as highlight below: –

Performance Overview
This currently has a recommendations area that suggests adding 5 different Indexes which are all set as HIGH impact.

Indexes can sometimes cause adverse effects so it’s recommended to look at the suggestions, copy the script from the recommendations and consider if this Index will indeed help with the performance of queries.

Query Performance Insight
The second area I look at is query performance insight and from here we can see the average CPU, Data IO, Log IO on the SQL Server database across the last 24 Hours as an average. We also get an insight into what queries are running and taking the longest time to complete.

I changed the graph above to show the last 7 days and I can see CPU is maxed out at 100% for a long period within the last 7 days as seen below:-

Long Running Queries
This area identifies queries which are taking a long time to complete and always worth checking on this regularly.
The following is a screen shot of long running queries within the database for the past week. To find this information select the database instance in the portal and then select Query Performance Insight and select Long running queries, then I chose custom and changed the time period to Past week.

We can see above the yellow query is the database query which has the longest duration this past week, you can click on the yellow area and it will show you the details of the query which is a long running query.

Automatic Tuning

Azure SQL Database built-in intelligence automatically tunes your databases to optimize performance. What can automatic tuning do for you?

  • Automated performance tuning of databases
  • Automated verification of performance gains
  • Automated rollback and self-correction
  • Tuning history
  • Tuning action Transact-SQL (T-SQL) scripts for manual deployments
  • Proactive workload performance monitoring
  • Scale out capability on hundreds of thousands of databases
  • Positive impact to DevOps resources and the total cost of ownership

I would recommend that FVN turn this on and leave it like the following:-

This means that Azure will tune the indexes using built in intelligence and create indexes when it thinks you need them based on usage patterns. A word of caution here as these recommendations aren’t always correct so please bare this in mind.

Log Analytics
I always recommend adding the Azure SQL Analytics workspace solution to the subscription and this gives us further insight into the SQL Server in Azure. Once you turn this on you need to wait sometime before it can gather a decent amount of data.

The screen shot below shows us the type of information we can get from it, this screen shot was taken not long after being turned on so if you wait some time it will have much more useful details:-

From here we can get more information about deadlocks, timeouts, etc.


Now lets take a look at the website which is in an App Service in Azure and see what tool we can use to help us troubleshoot issues with the performance.

I always recommned adding Application Insights into Azure for resources when possible, and here if we click on the App Insights for the web app we can instantly get soe basic info. If you click on the Application Dashboard as seen below we get a high level vue of whats going on in our App Service.

The Application dashboard for a typical web app might look something like this: –

Ok, so let’s now do some further investigation into our app service issues. This time I chose the App Service itself and then I chose Diagnose and solve problems from the left-hand menu. This feature is underused in my opinion and is very useful indeed, not sure if many people have looked at it but it can be pretty helpful with recommendations and also pointing out some things that you may want to think about remediating.

Once in the Diagnose and solve problems area I usually click on Availability and Performance within the Troubleshooting categories section and if you do, you’ll see something like this: –

In the image above we can see that we have some App Performance issues to go and investigate. Clicking into the App Performance section we get in-depth details about the Performance and we get Observations that say things like Slow Request Execution with details of the web page, average latency, total execution time, etc. The detail here is very helpful in tracking down potential issues in the code, or the configuration of your web application. There are a number of options to check within each section of the 6 troubleshooting categories, an example is shown below for the Availbility and Performance section: –

Summary
In summary, there are a number of really awesome tools to aid us with troubleshooting App Service perormance issues, go check them out the next time your web app is running poorly.



Think of the next person

I have been lucky enough to work with one manager who was very good at being disciplined and I wanted to share with you some of my learnings and talk about some stuff I have seen of late which really isn’t helpful and how easy they are to remediate.

So what is IT industry discipline, well it’s not something you read much about or will find in books, for example, it’s just something you pick up as you progress in your career and is much easier to pick examples of what not to do and then have a way to make things better.

Making things better should always be at the back of your mind in the IT industry, how can we make things better. I have a developer background so most of what I will talk about will cover some basic stuff yet I still see it on almost every project that I come across.

If you think about the above paragraph of making things better here is a good rule of thumb, imagine the next person who comes along has even less knowledge about whatever the thing is your doing, how can you help make their lives a little bit easier?

Here is a list of some examples

  • Don’t leave server folders lying around like New Folder, New Folder(1) – instead, have a proper naming convention and stick to it (think of the next person coming along).
  • Don’t leave crap lying around with xxx appended to the start or have DELETEME items lying around anywhere – instead source code everything and delete the rest (think of the next person coming along).
  • Don’t leave old deployments lying around instead archive them off, or have a process to delete the last x number of deployments (think of the next person coming along).
  • Don’t have one person having vital knowledge about a system in their head, document it, and share with as many people deemed reasonable – instead document everything, yes everything, there I said it, we all have things we should have documented yet we don’t (think of the next person coming along).
  • Don’t let people leave your company without doing a proper handover – companies have on-boarding processes, where is your off-boarding process? (think of the next person coming along).
  • Don’t move to the Cloud and suddenly we don’t have any diagrams – instead diagram your architecture and keep it up to date, have a process in place to check this diagram is still valid (think of the next person coming along).

The above is much more than technical debt, everyone has technical debt but this is about thinking about the next person.

We can improve, we should improve processes today not tomorrow or next week. Small improvements over time make a big difference.

I am going to be adding to this blog post over time as more things come to me but for now, think of the next person each time you do something on a project or when its related to work – go that little bit extra and before you know it you’ll enjoy working on the project when the processes in place are right.

Don’t forget to subscribe to my YouTube Channel.




Azure Tips n Tricks

I have had a fair bit of time recently and spent most of my time learning the content I wanted to learn, nice to have that time right?

I have been going through the Azure Tips n Tricks website and videos created by Michael Crump, you can follow Michael on Twitter and please also check out his twitch stream which is a lot of fun.

There are currently around 260+ blog posts and videos which cover a number of Azure tips and tricks and I reckon everyone will learn something by checking them out, I have learned a tonne of new things already.

Here are a list of some of my favorites so far: –

Plenty more to go through, but I do recommend everyone has a look at them as you will absolutely learn something new.



Azure DevOps Best Practice Template Project

I wanna show you how you can take an existing Azure DevOps project and use this as a template for any new project within Azure DevOps. So let’s say you create a brand new project within Azure DevOps and set up a default Wiki and add a dashboard etc. (think of your ideal DevOps project setup).

Ok, now that you have this in place you can actually export the entire project – why might you want to do that I hear you ask?

This is so we can effectively clone this best practice project and use, again and again, heck you can even source control the template if you so wish.

So how do you export your best practice website template with you lovely custom process flow, wiki, etc in place? – this is where the following link comes in handy.

https://vstsdemodata.visualstudio.com/AzureDevOpsDemoGenerator/_wiki/wikis/AzureDevOpsGenerator.wiki/58/Build-your-own-template

From this above link check the part that says Building a new custom template and you’ll see a link that is basically this:-

https://azuredevopsdemogenerator.azurewebsites.net/?enableextractor=true

Log in and then look for the link top right that says Build your own template

Now select the Organization you want to use and select the project you wish to use as the best practice template project.

Ignore the error about query items, seems to be a bug, Click Generate Artifacts and you should now have a zip file containing several JSON files.

So now we have the project template JSON files exported how do we create a new project based on this zip file? – well, unfortunately, you need to use the AzureDevopsDemoGenerator tool again.

Log back into the AzureDevopsGenerator and click on the ‘choose template‘ button as seen below:-

and then click Private and then choose your zip file which is the file you exported.

Now fill in the last screen like the screen below and boom!

You now have a new Azure DevOps project which is based on your best practice project like so.


Please give this a try and let me know your thoughts on how useful this is for ya – enjoy!

Gregor



European Cloud Conference

The European Cloud Conference will take place on October 27-29, 2020 in Nice, France and is Europe’s leading Independent Microsoft Azure Conference.

Book your tickets for this amazing Azure conference and make sure to sign up for the mailing list so you don’t miss out on any news.

The conference will be Europe’s first annual conference dedicated exclusively to Microsoft Azure.

So who should attend? – If you’re a technology leader or have an interest across any area within Azure this is the go-to event for you. If your a Developer, work in Operations, Infrastructure or DevOps, manager, security expert or even at C-Level management then this is the conference you need to attend in 2020.


8 Full day Expert Azure Tutorials have been announced

Azure Security Best Practices

Mustafa Toroman, MVP, MCT
Authority Partners, Bosnia And Herzegovina

Top 3 Highlights of Attending your this Tutorial:

  • Learn about Identity in cloud
  • Network security
  • Data protection

Level: 400
Topic: Security
Category: IT Pro


Kubernetes on Azure

Vishwas Lele, MVP, Microsoft Regional Director
Ais, United States

Top 3 Highlights of Attending this European Cloud Conference 2020 Tutorial:

  • Learn about Key Kubernetes Concepts
  • Deep dive into AKS
  • Learn how AKS integrates with other Azure services

Level: 400
Topic: Azure Migrations
Category: Developers


Azure Messaging – From 0 to 100 in One Day

Sean Feldman, MVP
Particular Software, Canada


Top 3 Highlights of Attending this European Cloud Conference 2020 Tutorial:

  • Balanced tutorial between theory and hands on exercises
  • Practical Azure messaging knowledge distilled in one day
  • Learn from an Azure Messaging expert and MVP

Level: 400
Topic: Messaging
Category: Developers



Azure Virtual Machines 101

Vladimir Stefanovic,
AZURE MVP,
MCT REGIONAL LEAD
Superadmins, Serbia



Aleksandar Nikolic, MVP
M.O.3.A.K. IT Consulting, Serbia

Top 3 Highlights of Attending this European Cloud Conference 2020 Tutorial:

  • Azure VM Deep Dive
  • Azure VMSS Deep Dive
  • Designing VMs Architecture

Level: 300
Topic: Cloud Compute
Category: IT Pro


Low-Code Cloud App Development and App Modernization

Paul Swider, AZURE MVP
Realactivity, LLC, United States

Top 3 Highlights of Attending this Tutorial:

  • Learn the value of low-code when migrating business apps to Azure
  • See how Power Apps can be used as part of an Azure App Modernization strategy
  • End to end demos of integration with Azure Services.

Level: 300
Topic: Cloud Compute
Category: Developers


A Day of Customer Identity Implementation with Azure Active Directory B2C

John Garland, MVP, MCT
Wintellect, United States

Top 3 Highlights of Attending this European Cloud Conference 2020 Tutorial:

  • Learn how to use Azure AD B2C to provide secure authentication for your application
  • Go beyond the basics and see how you can customize Azure AD B2C to match both your identity needs as well as your brand
  • Learn how to use Custom Policies in Azure AD B2C to enable advanced identity experiences

Level: 300
Topic: Identity & Access
Category: Developers


Getting Gremlins to Improve Your Data

Chad Green, MVP
Scholarrx, United States

Top 3 Highlights of Attending this European Cloud Conference 2020 Tutorial:

  • Understand the basics of graph databases
  • Get hands-on experience setting up, configuring, and optimizing a graph database
  • Get hands-on experience working with graph databases in your applications

Level: 300
Topic: AI
Category: Developers


Monitoring Solutions in Azure

Magnus Martensson, MVP, MICROSOFT REGIONAL DIRECTOR
Loftysoft, Sweden

Level: 300
Topic: Azure Management
Category: Developers & IT Professionals


Book your place now to attend.

You can find out more information about the venue and also make sure to check out the faqs.



AzureCharts.com

I have been familiar with Azurecharts.com long before it was mentioned on twitter by Mark Russinovich who you are all hopefully following on twitter.

The site is written by Alexey Polkovnikov and is one I keep coming back to and always point people to. There is a lot of very useful links on here.

The site has a number of features that I wanted to cover and you can read about what it can be used for in the about page.

The main concept is that you can go here and see what is new in each area of Azure right down to the actual azure service itself and this is continually updated for you.

I wanted to cover the areas which I think are incredibly useful that you may have missed within the site, so lets dive right in.

Highlights
Highlights allow you to choose a job role and it will highlight the azure services most likely to be of interest for that role.

Overview
The overview lists all of the Azure services and you can click on each to be taken to the relevant azure docs page to learn more.

SLA
The SLA section shows you the SLA (service level agreement for Azure services which has an SLA.

Status
This screen shows us which services are Generally Available or in Preview.

Timeline
This screen shows us the timeline for when we can expect to see the feature rolled out to the particular region show for the service.

Regions
This screen allows us to compare services by region, and will shows us the timeline and the status for the service you click on.

Presence
Presence shows us how many regions the service you click on is present within and can show future availability stats for some services.

Solutions
Solutions are where you can choose a service and then from the drop-down at the top make a choice and it will take you to the docs for the selection you make – so for example, if I select the Azure Cosmos DB service I can then choose from the solutions drop down like so: –

Stories
Stories are where you can select an azure service and read customer stories on how they implemented the service and has some very interesting ideas and usages of the technology.

Fun
Within the fun screen there is an azure quiz and an azure menu covering starters, main dishes, and desserts, go take a look.

Summary
In summary, this is a great site with a tonne of useful information and one to share with your team or on twitter, etc. – huge thanks to Alexey for putting this together and keeping it up to date.



Azure Resource GitHub Repository

I have started a GitHub repository for a place to put the following so that the community can benefit from resources I have came across from the community.

I’m looking for others to contribute to this so that the community has a place to find helpful info – please take a look, add your study guides, useful links and more in here and help grow the useful resources we come across.

If you have an Azure Exam Study guide let me know and I’ll add a link to it from the Exam folder to your blog or create a quick pull request.

If you have any useful Azure Resources which aren’t listed then please either let me know or create a quick pull request.

I’m gong to be adding to this over time throughout the year, I’m looking for contributors so we can grow this out to be something useful to a lot of people.

Link to the GitHub Repository:- https://github.com/gsuttie/AzureResources




Azure Best Practices

The following is a list of the best practices I have found in 18 months of learning and using Azure (not including the community blogs of course), I know best practice isn’t a great term but here are the links anyway, enjoy!

p.s. I’ll keep updating this so check back in a month or 2 🙂



Azure Devops – Add your build status badges to your Wiki

Its always a good idea on your project to keep your project documentation up to date, I personally like to make use of the Wiki inside Azure Devops, we use Azure Devops almost exclusively at work now.

On the wiki we have a page which documents the Azure Builds and Release pipelines, so that people can get an idea of what the individual builds are for and explain the steps within the Release pipelines, for the most part this is really straightforward, but for new people joining the team it just makes life easier to have this kind of thing written down and explained.

On that note I wanted to show you how to add the status badges for each build to your Wiki, it took me a wee while to find this so I thought I’d blog it because I’ll forget and so other people can see how to do it.

An example of the kind of thing I am talking about is below: –

So how do you find the Markdown for the badges so that you can add this to your wiki or elsewhere?

If you browse to your build(s) for your projects, click on the 3 ellipses on the right hand side, next to the Edit and Queue buttons and then choose Status Badge

Then you need to select the text next to Markdown, and then just paste this into your wiki page.

Hopefully someone finds this useful, bye for now.



Azure Devops – Release Gates

In this blog post I want to talk to you about release gates within Azure Devops, release gates can be useful if you want to add in some further pipeline checks to stop the release going ahead.

Nothing better than an example so here is how to set up gated releases using Azure Devops.


Example

This example shows how you can add in a release gate so that the release wont go ahead and deploy if say there are still open bug tasks within the Azure Board for the current sprint.

Once you have a release, first, click on the lightning bolt on the stage as seen below, and then enable the Gates are on the right hand side.

One this had been selected choose Add and then select Query Work Items, for this I have created a Shared Query where I created a shared query to show me if there are any bugs which are sitting as Approved (which I’m using as open but not started as yet), I don’t want the release to go ahead if there are any bugs in the Approved status.


Note:- In order to create a new query within Azure Devops on the left hand side select Boards, queries and then select new query.

An example query would look something like the following


Fill out the screen below like below and I set the upper threshold to 0.

To recap, I want my release to fail the gate so that the release wont go ahead because I have open bugs within my Azure Board for this particular project.

There are a number of different types of release gates you can use and here is a screen shot of the ones available to use at this time.

I hope you find this useful, if you have any questions please leave feedback.