Using the latest version of the Azure CLI

In this blog post, I wanted to quickly cover how you can keep the Azure CLI up to date on your local system and within Azure. I use the Azure CLI as my go-to choice for writing deployment scripts in Azure. The reason you want to keep this up to date is for new additions as we all bug fixes for previous versions.

The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation.

Its super simple to keep this up to date and you can do this by opening a PowerShell or Bash script window and typing:-

az upgrade

But instead of doing this maybe you want to keep it up to date without having to keep checking, you can also do this by using the following command:-

az config set auto-upgrade.enable=yes

But even better yet you can keep the Azure CLI up to date without ever being prompted by using the following command:-

az config set auto-upgrade.prompt=no

And that’s it, no you no longer need to worry about am I using the latest version of the Azure CLI.

You can read more on this at the following URL: – https://docs.microsoft.com/en-us/cli/azure/update-azure-cli?WT.mc_id=AZ-MVP-5003451

Don’t forget to subscribe to my YouTube Channel.



Skylines Summer Sessions

Over the summer this past year, I and Richard Hooper were interviewing people around the world on Azure related content and it has been an absolute blast, it has been so much fun chatting to some very talented individuals who have a passion for their profession.

We talked about all things Azure and threw in some fun questions along the way. If you haven’t checked out the content its around 30 minutes per video and we have slides and demo’s galore.

Checkout the speakers and content -> SkyLines Summer Sessions

Huge thank you to the amazing people who work at Skylines Academy, Amy, Brette, and Nick – thanks for setting this up and organizing it.


Thomas Maurer talks to us about Azure Arc with a very cool demo.

Thomas Maurer

Richard Hooper talks to us about AKS with a very cool little demo.

Richard Hooper

Dwayne-Natwick talks to us about Virtual Machine Scale sets and Virtual Machine Availability Sets

Dwayne Natwick

Peter De Tender talks to us about Terraform on Azure.

Peter De Tender

Maarten Goet talks to us about Azure Sentinel.

Maarten Goet

Wesley Haakman talks to us about Cloud Solution Providers (CSPs) and Managed Service Providers (MSPs)

Wesley Haakman

Shannon Kuehn talks to us about Azure VMware Solution (AVS).

Shannon Kuehn

Joe Carlyle talks to us about Azure FireWall.

Joe Carlyle

April Edwards talks to us about A/B Testing in Azure.

April Edwards

Adam Bertram talks to us about PowerShell

Adam Bertram

Sarah Lean talks to us about Datacenter Migration & Azure Migrate

Sarah Lean

Sam Smith talks to us about common mistakes with DevOps.

Sarah Lean

Gwyneth Peña talks to us about her journey to becoming an Azure MVP and a Cloud Engineer.

Gwyneth Peña S.

Wim Matthyssen

Wim talks to us about Azure spend and how to take control.

Pete Gallagher

Pete talks to us about Azure IoT.

Michael Levan

Michael talks to us about using Octopus Deploy with Azure.



Review of the year

Wow what a year its been.

  • Started a new job as An Azure Architect @ Intercept
  • Gave workshops at work on GitHub Actions, Azure PaaS, and Azure Governance.
  • Renewed as an MVP
  • Helped 9 people become an MVP.
  • 53 User Group talks / took part in.
  • Helped Organise this year’s Festive Tech Calendar, Global Azure Bootcamp UK / Ireland, Skylines Summer Sessions.
  • Spoke at Scottish Summit.
  • Passed the following exams: –
    • AI-900 Azure AI Fundamentals.
    • DP-900 Azure Data Fundamentals
    • DP-200 Implementing an Azure Data Solution.
    • DP-201 Designing an Azure Data Solution.
    • AZ-104 Azure Administrator Associate.
  • Became a Microsoft Certified Trainer.
  • Started my own YouTube channel.
  • Started the CloudFamily Podcast with Richard Hooper – https://anchor.fm/cloudfamily
  • Blogging – made a conscious effort to slow down blogging to spend time on other things, still managed over 10,000 views each month.

Whats next I hear you ask.

  • Speaking at Scottish Summit 2021
  • Azure AI-100 Designing and Implementing an Azure AI Solution
  • DP-300 Administering Relational Databases on Microsoft Azure
  • PL-900: Microsoft Power Platform Fundamentals

I don’t have much more planned than that.

Thank you
I have way too many people to thank in 2020, honestly, I am very fortunate to know some amazing people from the communities, everyone I work with day to day, shout out to everyone who I speak with on Twitter, everyone involved in running User Groups, event organizers, etc.
I am grateful to each and every person who I speak to, I do my best to get back to everyone and help where I can. I have noticed that none of you sleep, most of you are up at silly hours of the night.

Highlights this year
This one is easy, helping people who are passionate about helping others is something I will take time out of my day to help people with.

Summary
Next year, more of the same, helping people get started, sharing people’s content as it’s tough to create content and people spend a lot of time on this.
I’d like to see events that focus on newcomers to our communities and highlight their work.

Its been a horrid year for everyone, keep safe and keep your chin up and a smile on your face as much as you can.

Gregor



Azure Logic App Api call save a file to Blob Storage

I wanted to see how easy it would be to create a Logic App to call an API and return data from it and then translate the contents into a CSV file, any excuse to learn something new and play with Logic Apps, which is not something I have done a lot of, to be honest.

So my goal was to pick an api, call it using a GET request, grab the json from the Api and then convert this to a csv file and then create a file on blob storage. In this blog post I will show you how I went about it.

I want my Logic App to do this each month and grab the data from the api and create a new blob so lets take a look at the end result and go through it step by step.

So we have 5 steps to accomplish this task.

Recurrence – this is just going to run the logic app on a schedule, so I am running this once each month.
HTTP – here is where I give it the API URL which in my case is https://geocatalogus.nl/api/3/action/datastore_search?resource_id=ecbe6732-5a6b-4858-84db-b03c410ff7aa
and I set the Request type to GET.
Parse JSON – Here I grab the JSON response from the HTTP step above and then parse it by supplying an example of the body from the JSON returned in the HTTP step. This looks like so:-

The Body (green part in the screen shot) is taken from the Dynamic Content where I just typed Body and then clicked on it.
Create CSV Table – now I want to interrogate the Parsed JSON from above and find the part of the JSON I am interested in and for this API I want the part called record which is the data I am interested in.


Again I clicked on the From part above and chose Dynamic content which lists the parts of the JSON returned and from there I chose records, I left the Columns as Automatic and thats all I needed to do here.
Create Blob – Now I want to create a new blob in Azure Storage soI chose that for my last step and gave it the connection details to my Azure Storage Blob container like so:-

I run the Logic App and it calls the API within the HTTP step, parses the returned JSON from the API, I then use the Create CSV Table step to format the data and then save the output from that step by using a Create Blob step.

And that is all there is to it, I did this just to learn something new and remind myself how cool Logic Apps are and how easy they are to use.

Don’t forget to subscribe to my YouTube Channel.



Windows Docker containers

At work, I was trying to take a C++ ISAPI DLL project and see if I can get it running in a windows container. In this blog post, I will cover my findings when working with Windows Containers – for anyone who doesn’t know there is no GUI so my blog post will cover how to do some steps using PowerShell. The end goal here is to containerize a Windows IIS legacy web app and move it to AKS without re-writing it.


I had never used Docker on a real project until now so had barely used it (please bear this in mind), please note there may and probably is a better way to do some of the following, I have written this to give you a starter for 10 if you need to work with a windows container and might need to do some legacy work.

The following are some tips on how to do stuff using windows containers and what I have been learning the last 2 weeks.

You have the option to use all manner of Windows Containers, for the work I was doing I was using the following: –

FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2016

SHELL ["powershell"]
COPY SetupGregor.ps1 .
RUN powershell -File .\SetupGregor.ps1
COPY Setup C:/Setup

RUN reg import .\odbcinistuff.reg
RUN Start-Process -FilePath msodbcsql.msi -ArgumentList "IACCEPTMSSQLCMDLNUTILSLICENSETERMS=YES"

RUN Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters'  -Name PoolThreadLimit -Value 512 -Type DWord

# Install windows features
RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
     Install-WindowsFeature Web-Asp-Net45 ; \
     Install-WindowsFeature Web-Static-Content ; \
     Install-WindowsFeature Web-Http-Errors ; \
     Install-WindowsFeature Web-Default-Doc ; \
     Install-WindowsFeature Web-ISAPI-Filter ; \
     Install-WindowsFeature Web-Stat-Compression ; \
     Install-WindowsFeature Web-ISAPI-Ext ; \
     Install-WindowsFeature Web-ISAPI-Filter 

# IIS stuff
RUN Install-WindowsFeature Web-Mgmt-Service; \
New-ItemProperty -Path HKLM:\software\microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force; \
Set-Service -Name wmsvc -StartupType automatic; 

# Add user for Remote IIS Manager Login
RUN net user iisadmin <putyourpasswordhere> /ADD; \
net localgroup administrators iisadmin /add;

COPY Setup/LogMonitor.exe c:/LogMonitor
COPY Setup/LogMonitorConfig.json c:/LogMonitor

CMD Write-Host IIS Started... ; \
    while ($true) { Start-Sleep -Seconds 3600 }

The above are just samples of whats possible, lets cover them one by one below.

  • FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2016 – here I am saying use the windowsservercore-ltsc2016 windows image.
  • SHELL [“powershell”] – here since I am using a windows container I want to use the PowerShell shell.
  • COPY SetupGregor.ps1 . – here I just copy a single file into my container.
  • RUN powershell -File .\SetupGregor.ps1 – here I am running a powershell file.
  • COPY Setup C:/Setup – here I am copying a full folder into the container.
  • RUN reg import .\odbcinistuff.reg – here I exported a registry file from a test server so that I can import this into my container and use it to setup ODBC System DSN’s that I needed.
  • RUN Start-Process -FilePath msodbcsql.msi -ArgumentList “IACCEPTMSSQLCMDLNUTILSLICENSETERMS=YES” – here I am running an msi silently in my container to install ODBC sql drivers
  • RUN Set-ItemProperty -path ‘HKLM:\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters’  -Name PoolThreadLimit -Value 512 -Type DWord – here is a sample on how to set a new registry key inside my windows container.
  • RUN Install-WindowsFeature NET-Framework-45-ASPNET; – yep you guessed it I’m installing windows features in my windows container.
  • RUN Install-WindowsFeature Web-Mgmt-Service; \
    New-ItemProperty -Path HKLM:\software\microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force; \ – here I am setting up the ability to connect remotely into IIS running on my container – this helps enormously when you can see the IIS settings etc from outside your windows container.
  • Set-Service -Name wmsvc -StartupType automatic; – here I make sure the service starts automatically.
  • RUN net user iisadmin <putyourpasswordhere> /ADD; \net localgroup administrators iisadmin /add; – here I create a user I can use to connect into IIS on the container – I also run the app pool using this account.
  • COPY Setup/LogMonitor.exe c:/LogMonitor
    COPY Setup/LogMonitorConfig.json c:/LogMonitor – here I am copying LogMonitor (https://github.com/microsoft/windows-container-tools/tree/master/LogMonitor) This is an opensource .exe which you can use to monitor logs like IIS and the event viewer etc, its a C++ project which I have built, in case
    you don’t have the tooling handy – you can find that here – https://github.com/gsuttie/LogMonitor
  • CMD Write-Host IIS Started… ; \
     while ($true) { Start-Sleep -Seconds 3600 } – here I keep the windows container running as long as IIS is running, if you stop IIS the container will shut down (restart the app-pool instead if you need to make changes, saves you having to restart the container.)

Buld your container using a Dockerfile like the one above:-

docker image build --tag win2016GregorsDemo .

Start your Docker image

Docker run --name remoteiisGregor -d -p 8000:80 win2016GregorsDemo 

It will start up instantly then you can get the ipaddres like so

 docker inspect --format '{{ .NetworkSettings.Networks.nat.IPAddress }}' remoteiisGregor 

Now you can connect to IIS on the container from your local desktop

Add in the IP Address and then when asked for a username and password, the username is in the Dockerfile.

Username: IISadmin
Password: ********* (whatever you add in the dockerfile)

And viola – you should now be able to connect to IIS running inside a windows container.

Now to check settings within the container you can connect to the container doing the following:-

Docker ps -a

This will give you the containerId like the following:-

Now you can grab the first 3 letters of the container id and type this

Docker exec -it 32d powershell

And now you can connect to the container with a powershell shell windows and check folders, run commands etc.

Summary
You may ask why? – Whay am I doing this, well when a customer asks if they can go to AKS with an existing solution and it needs to run on windows containers, I thought yeah let;s get it working.

This is brief blog post which doesnt go into huge detail, if you have questions please just ask, I dont have much time under my belt with Docker but I learned a lot and figure out a number of things.



Create Serverless event Sept 30th

As part of Serverless September there is a very cool event happening on September 30th (starting at 08:00 am Pacific Daylight time) to which I would like to draw your attention.

As you can read above it a one of a kind live event, and who doesnt like a live event right?.

Some of the brightest minds come together to present to you on a number of sessions throughout the day.

If you haven’t looked at anything serverless before, or haven’t kept up to date with what’s new then this is your chance for one day to ramp up your learning by learning from the best.

There are sessions on all sorts serverless related including: –

OSS
Developer hacks
Serverless Best Practices
Low-code Serverless Applications
Serverless Security

Check out the list of speakers which include:-

Simon Cotin
Allison Kunz
Linda Nichols
Dona Sarkar
Jennifer Davis
Marie Hoeger
Gwyneth Peña S
Lian Li
Floor Drees
Nitya Narasimhan

Check out the website for much more detail at: –https://createserverless2020.splashthat.com/

Go Sign up now and let you’e friends and colleagues know about it too.

Thanks Gregor!.



Immutable storage for Azure Storage Blobs

If you have storage blobs containing things like backups or files then Azure now has Immutable storage available for Azure Storage Blobs generally available in all public regions.

Immutable means that it is unable to change or be changed and this means that if a customer has let’s say a backup then they can store this unchanged which for some companies is very nice to have.

To take advantage or to test out immutable storage lets go through what we need to do to test it out.

  • First of all, create a storage account.
  • Click on Containers and create a new container, give it a name and choose Private (no anonymous access).
  • Once created click on the name of your new container and then upload some files.
  • Once you have uploaded some files click on Access Policy on the left-hand side, notice we have 2 sections, Stored access policies and Immutable blob storage, under Immutable blob storage, select Add policy.
  • We now have 2 options to choose from
    • Time-based retention
    • Legal hold

Time-based retention allows us to add a number of days value between 1 day and 400 years, this also makes the files immutable.

Note:- You cannot change this value to 0 at any time. Once the interval you add expires – Upon the expiration of the retention interval, the data will continue to be in a non-modifiable state but can be deleted. Retention policy changes may require some time to take effect. 5 edits are permitted to the policy.

Legal hold retention means you add a tag to the blob container – each legal hold policy needs to be associated with 1 or more tags. Tags are used as a name identifier, such as a case ID, to categorize and view records.

You cannot delete or modify any files with the container whilst there is either a Time-based retention policy or a Legal hold policy, however if you delete the legal hold policy you can then delete or modify files with the container.
With Time-based retention, you can allow additionally protected appends and change the retention interval.
Time-based retentions need to be locked in order to be active and to add a lock click on the 3 dots and choose Lock policy.

Note:- Once you apply the lock you cannot delete the lock and just before you click save on applying the lock you will see the following reminder:-

Summary
I can see some people having the need to keep backups and have them immutable for a number of legal reasons and this new feature will be very handy for them.

Don’t forget to subscribe to my YouTube Channel.



Azure Certification Prep

Hi folks, this blog post comes to you as part of the Azure Back to School community event ran by Dwayne Natwick.

Many thanks to Dwayne for allowing me to take part.

You can read more about the event on the official website

I am talking to you today about Azure Certification Prep, let’s not waste any more time and dive right in.

Whether your starting your Azure certification journey or along ways down the road the first thing you need to do is some homework on the exams:-

  • Which exam is the right one for you at this time?
  • Have you read the official exam page from Microsoft?
  • Have you read up on any changes about the exam that may have taken place?

I always suggest people start with the AZ-900 Azure fundamentals exam and this is for everyone, including experienced Azure users. This exam will set you up for the following if you are new to the exams or haven’t done any exams in a while:-

  • Learn to study (learn to take notes and try to remember the content you’ve read)
  • Get you into the habit of reading, trying to recall information, sitting practice tests.
  • There is also the no small feat of booking the actual exam and sitting it, lots of people put this off and dread exams.

Skills Measured
This area is key to your success in the actual exam, the content in this section is in essence what Microsoft will be testing you on, ensure you are comfortable with all of this content before taking the exam. Exams are usually broken down into 4 maybe areas and you’ll see a percentage scoring next to each section. An example of this would be the AZ-900 exam which has the following:-

Describe Cloud Concepts (15-20%)

This means that 15-20% of your exam will be on this subject area, some exams have areas as much as 35-45% so this is the area you want to be very sharp on as lots of questions will be around this area.

Advice
Whilst studying you tend to get a feel for how it is going, I would advise you try some practice tests and try to gauge from them if your ready or not. Book your exam as this will then help concentrate your mind and ensure you study, nothing like an exam deadline coming up to make you want to read the content, learn and pass your exam.

So a this point we have checked out the official exam guide, we know what topics we are going to be tested on, lets assume we are sitting the exams at home, we have to know what to expect when sitting an exam from home.

Sitting an exam in your house

There are some rules which you need to adhere to when taking an exam from your office / home and some of these are as follows: –

  • There is no bit of paper allowed for taking notes so if you need to take notes then there is a way to do this on-screen within the test, get familiar as you may need this.
  • No one is allowed to enter the room at any time during your exam, and you cant leave either.
  • You’re not allowed to read the exam questions out loud, cover your face or leave the webcam perimeter box for any reason, if you do you’re very likely to fail.
  • You have to take photos of your identification and the desk your siting at, behind where you are sitting, to the left, and to the right of where you are sitting.
  • The rules are there for people to read so be sure you know what you can and cannot do otherwise you run the risk of an instant failure which would not be fun.

Advice
Ensure your pc / laptop is charged, arrive 30 minutes early and go through your identification steps as soon as you can as it can be a little unsettling at times and you don’t want to be flustered before the exam begins.

Learning Resources
I always go in search of good learning resources for an exam and I always start off with Microsoft Learn. Here you will find learning paths for your exam and you can go through them at your own pace, make sure not to miss these as they really are excellent.

My favorite Learning Resources

Practice Tests
Whilst studying I always think its a good idea to do some knowledge checks, you may read some content week 1 and forget it week 2, practice tests help reinforce my learning and help me recall things I need to know for each exam. I have used practice tests from several different places and here are some of the people who have good training as well as good practice tests:-

Advice

  • Don’t start studying and then put it off would be my advice, you’re likely to forget some of what you learned.
  • Book the exam 2 weeks out and then this will focus your mind.
  • Read the questions carefully even in the practice tests.
  • No exam question has answers which are wildly wrong, Microsoft don’t do this anymore so you wont be able to rule lets say 2 from 4 answers right away for being wildly wrong with regards to the question.
  • Take the exam once your fairly confident you know what the answers to most of the questions, you wont get them all right but try to wait till your at least some what confident in your knowledge.
  • ALWAYS check the official exam page in case the skills measure area has been updated – exams are updated regularly and you don’t want caught out.

Wrap Up
No one likes sitting exams, but just think of the amount of things you have learned, and don’t be afraid to fail an exam, I have failed 3 and it just made me more determined to pass the next time and learn what I didn’t know the first time around.

If you need advice about anything exam related, please do reach out on twitter.

Don’t forget to subscribe to my YouTube Channel.



GitHub Actions 101

In this blog post series I am going to cover my journey to learning about GitHub Actions.

To get started with learning about GitHub Actions lets start by describing what they are.


So what exactly are GitHub Actions?

“GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

GitHub Actions help you automate your software development workflows in the same place you store code and collaborate on pull requests and issues. You can write individual tasks, called actions, and combine them to create a custom workflow.

You can write your own actions to use in your workflow or share the actions you build with the GitHub community

Workflows are custom automated processes that you can set up in your repository to build, test, package, release, or deploy any code project on GitHub.


To get started with learning about GitHub Actions lets start off by listing some of the best resources I have come across for getting started.

Don’t forget to checkout my YouTube Channel.



A New Adventure

I’m very excited to share with you the news that I have accepted a position as an Azure Architect at a company in the Netherlands called Intercept.

Intercept has very recently been awarded Microsoft Partner of the Year 2020 in the Netherlands beating off strong competition from 18 other companies.

Intercept are Microsoft Azure Management Elite Partners and Gold Partners in 7 areas at present which is pretty impressive.

I start my new role on September 1st, I will be working in and around Azure daily and that is what I want to be doing, so to say I am excited is an understatement.

During Covid-19 I was furloughed due to a customer not being able to support remote workers and during this time a great number of people from Twitter and LinkedIn reached out to me asking if I would be interested in working with them. I thank each and every one of you as being furloughed was not much fun but to be asked if I would like to work with you and your companies, that was neat, to say the least.

I interviewed at a number of companies and had numerous fantastic offers given to me but ultimately my new role ticked more boxes than the rest and I couldn’t say no.

The job role as well as the people I had spoken to at Intercept were the deciding factors for me.

Again thank you to everyone who reached out to me, you have no idea how much I appreciated it, beers are on me if we manage to meet in person, going forward.

So I look forward to rolling my sleeves up again and changing career direction ever so slightly. I am a renewed Azure MVP and that’s where I want to be working and learning day to day. I cannot wait to get started and helping people even more in the future.

November 2017 I set myself a goal of becoming an Azure Architect and gaining as much knowledge as I could with Azure – the exams have helped and I look forward to using Azure daily.

I remind myself that I am less than 3 years into my journey, I have a blog, YouTube channel, 11 Azure certification badges as below and I all whilst being a development manager of 10+ people and not using Azure daily.

All it takes is hard work, goals, determination and you can do anything.

Don’t forget to subscribe to my YouTube Channel and you can find me on twitter @gregor_suttie.


Tags: