Useful Azure Resources

Reading Time: 3 minutes

New to Azure

Learning resources

  • Microsoft Learn
    Microsoft Learn is a free, online training platform that provides interactive learning for Microsoft products and more.
  • Microsoft Docs
    The home for Microsoft documentation and learning for developers and technology professionals.
  • Free Azure E-books
    Deepen your understanding of cloud computing with analyst publications, guides, and infographics for technical professionals and business leaders.
  • Channel 9/Learn Live
    Presenting Microsoft Learn content Live. Every episode Microsoft choose a Learn module and work through it. They pull in guests to give you extra commentary from experts and sometimes even the engineers who built it. Join and ask questions, live!
  • Microsoft Trainer Community Channel
    Microsoft Trainer Community YouTube channel
  • Azure Friday
    Join Scott Hanselman, Donovan Brown, or Lara Rubbelke as they host the engineers who build Azure, demo it, answer questions, and share insights.
  • Azure Tuesday
    Corey Sanders answers your questions about Microsoft Azure – Virtual Machines, Web Sites, Mobile Services, Dev/Test etc. If you have a question, Corey will find the answer!
  • John Savill’s Technical Training
    A curated set of free learning videos from John Savill and other free resources to help you master Azure. (Not a Microsoft channel)


    Useful links

  • Azure global infrastructure experience
    A 3D interactive adventure to experience the reach of the sustainable, trusted infrastructure of Microsoft Azure’s cloud platform.
  • Azure Global Infrastructure
    Discover a new world of sustainable, trusted cloud infrastructure with Azure.
  • Azure Updates
    Get the latest updates on Azure products and features to meet your cloud investment needs. Subscribe to notifications to stay informed.
  • Azure Status
    View issues that might be impacting your services
  • Azure Blog
    Stay up to date with the latest Azure news via the Azure Blog
  • List of Azure Blogs
    A list of Azure Blogs owned by the technical community
  • Azure Community Support (Forums)
    Ask your Azure technical questions, find answers, and get Azure support provided by Microsoft engineers, community experts, and validated by customers. New to Q&A? See our get started article below.
  • Microsoft Azure YouTube channel
    Learn about the latest products & solutions, watch training demos, and discover technical insights relevant to you. Invent with purpose with Microsoft Azure.
  • Microsoft Azure Twitter
    The official Twitter account for Microsoft Azure. Follow for the latest news from the Azure team and community.
  • Azure Quickstart Templates
    Deploy Azure resources through the Azure Resource Manager with community contributed templates to get more done. Deploy, learn, fork and contribute back.
  • Microsoft Exam questions format
    Find out how Microsoft exams are structured
  • Azure Charts
    Live visual exploration environment for Azure Cloud + ecosystem (non-Microsoft site)
  • Azure Speed Test
    Measuring the latency from your web browser to the Blob Storage Service in each of the Microsoft Azure Data Centers. The latency times are indicative only, and do not represent the maximum performance achievable from Microsoft Azure. Use this website purely as a tool to gauge which Azure Data Center could be the best for your location. (Non-Microsoft site)
  • Azure SLA
    Service-level agreements (SLAs) describe Microsoft’s commitments for uptime and connectivity
  • Azure Calculator
    Calculate your estimated hourly or monthly costs for using Azure.
  • Azure Architecture Center
    Guidance for architecting solutions on Azure using established patterns and practices.
  • Cloud Adoption Framework
    Proven guidance and best practices that help you confidently adopt the cloud and achieve business outcomes.
  • Microsoft Azure Well-Architected Framework
    The Azure Well-Architected Framework is a set of guiding tenets that can be used to improve the quality of a workload.
  • Practice Tests Official Microsoft Practice Tests are offered by MeasureUp and can help you be prepared on test day.

It takes dedication to earn a new Microsoft skill or certification. After you’ve passed a certification exam or completed your training and are ready to put your new skills to work, be sure to celebrate your achievements with your network.

Note: This is a personal blog. Views are mine and not that of my employer.

A new chapter, I’m joining Microsoft!

Reading Time: 3 minutes

I am very excited to announce that I am joining Microsoft as an Azure Technical Trainer on 21st February 2022! I received the news in November 2021 and I’m still in shock today, a dream come true!

I am very grateful to Microsoft for the opportunity and look forward to joining a great team of awesome people. A massive shoutout and thankyou to Peter de Tender for the support and encouragement through the process.

Working for Microsoft is a great opportunity, a new challenge, I’m stepping out of my comfort zone, the opportunity to continue learning, sharing knowledge, meeting new people, and most importantly I hope to make a difference “to empower every person and every organization on the planet to achieve more”

I would like to thank my family, friends and members of the Technical Community (aka CloudFamily) on Twitter (You know who you are). Thank you very much for the support.

The Covid pandemic has been devastating for all of us, however, the Technical Community have been amazing, coming together virtually to support each other at a difficult time. A vast number of amazing virtual user groups, podcasts, blogs, courses and YouTube content has been created throughout the pandemic to help support the tech community. Keep up the great work.

I would also like to thank the individuals who reached out to nominate me for the MVP award. Thank you Shabaz Daar for the nomination which due to me accepting a position at Microsoft had to be halted. Thankyou Gregor Suttie, John Lunn and Elan Shudnow for reaching out. I really appreciate your support and you believing that I was worthy for such an amazing award, it means a lot.

As my journey with Microsoft begins, I hope to make a positive impact going forward. I will also continue to make an effort to get to know more awesome individuals in the community. I will also continue publishing technical content on my blog Cloud Build and interviews on the Azure Crazy website. I will be continuing to work on the Bradford Cloud User Group co founded with my friends Shabaz Darr and Mohammed Sajid. Thankyou both for your support.

What about Daisy Corporate Services?

Leaving the Daisy family after 15 years was not an easy decision. I am extremely lucky to have worked with amazing people over the years, great managers who have always pushed me to succeed. I have always said, what makes Daisy great is the culture, the people, the support and being able to progress within the company. Thankyou very much for all the support and opportunities you have provided me since I joined the company. I leave with many great memories.

Today was emotional, as I visited the office to say goodbye, hand over my kit, and door access pass which I have held onto for over 15 years. I look no where near the young Imran I was over 15 years ago. πŸ™‚

A quick selfie outside Daisy House with my friend and manager David Robinson, whilst battling with strong winds and rain, but we got there. Thanks Dave πŸ™‚

I’ve lost my hair and gone grey over the years, whilst Dave still looks the same. I never managed to find out what his secret was. πŸ™‚
Thanks for being a supportive colleague, friend and manager. I wish you nothing but success.

Time to sign out. I wish Daisy and the team all the best for the future.

Part 9: Terraform with Azure – Deploy a VNET and Subnet

Reading Time: 5 minutes

My journey learning Terraform to deploy workloads in Microsoft Azure continues. If you missed the previous posts, please visit the links below.

Part 1: Terraform with Azure – How to install Terraform
Part 2: Terraform with Azure – How to install Azure cli
Part 3: Terraform with Azure – How to Install Visual Studio Code
Part 4: Terraform with Azure – How to install Azure Terraform Plugin in Visual Studio Code
Part 5: Terraform with Azure – Install Git and initialise repository
Part 6: Terraform with Azure – Deploy resources in Azure
Part 7: Terraform with Azure – Deploy a variables file in Terraform
Part 8: Terraform with Azure – Deploy terraform.tfvars file

In this blog post I will go through the process of deploying a VNET, Subnet and a NSG in Azure.

Reminder:
Terraform documentation is great to get started with deploying resources in Microsoft Azure. Check out the following Terraform link for sample code – Docs overview | Terraform Registry

Let’s get started,

  1. Access the Terraform Registry website and locate virtual network – Terraform Virtual Network
  2. Below is the sample code provided by Terraform (link provided in step 1 above). I don’t require the resource group block as I have created one as part of my previous blog post, therefore, it has been removed from the code below.
resource "azurerm_network_security_group" "example" {
  name                = "example-security-group"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_virtual_network" "example" {
  name                = "example-network"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["10.0.0.0/16"]
  dns_servers         = ["10.0.0.4", "10.0.0.5"]

  subnet {
    name           = "subnet1"
    address_prefix = "10.0.1.0/24"
  }

  subnet {
    name           = "subnet2"
    address_prefix = "10.0.2.0/24"
    security_group = azurerm_network_security_group.example.id
  }

  tags = {
    environment = "Production"
  }
}

3. I will replace some of the code so it fits with what what I am doing, such as to include my existing resource group, location (UK South) and to make use of additional variables.

I’ll work through each block of code starting with the Network Security Group (NSG)

  • Line 2: I replace “example”, with “demo”
  • Line 3: I create a variable in my variables.tf file and include the value in my terraform.tfvars file. I then replace “example-security-group” with my newly created variable.
  • Line 4: I use an existing variable I created in a previous blog post
  • Line 5: I use an existing variable I created in a previous blog post
1. #Create Network Security Group (NSG)
2. resource "azurerm_network_security_group" "demo" {
3. name                = var.nsg_name
4.  location            = resource_group_location
5.  resource_group_name = resource_group_name
}

Below are screenshots of my variables.tf and terraform.tfvars file

4. Save changes. I move onto the next block of code I copied from the Terraform website. The virtual network (VNET),

  • Line 2: Replace “example” with “demo”
  • Line 3: Create a variable for network name, I replace “example network” with var.network_name
  • Line 4: I use my existing resource group location variable
  • Line 5: I use my existing resource group name variable
  • Line 7: I remove dns_server as I won’t need these for now
  • Line 10: I replace the name “subnet1” with a newly created variable var.subnet_name
  • Line 12: I replace “azurerm_network_security_group.example.id” replacing example.id with demo.id
1.# Create virtual network and address space IP address
2: resource "azurerm_virtual_network" "demo" {
3: name                = var.network_name
4: location            = var.resource_group_location
5: resource_group_name = var.resource_group_name
6: address_space       = ["10.0.0.0/16"]
7: dns_servers         = ["10.0.0.4", "10.0.0.5"]
8:  
9:  subnet {
10:  name           = var.subnet_name
11: address_prefix = "10.0.1.0/24"
12. security_group = azurerm_network_security_group.demo.id

5. I’ll make use of tags, so add a tag named demo

tags = {
    environment = "demo"
  }
}

My variables.tf and terraform.tfvars file below,

6. Before continuing I’ll commit the changes to Git. Note that Git is not a requirement to deploy resources in Azure, but a great versioning tool that is popular. I covered Git in previous blog posts. Continue to step 7 if you do not wish to commit changes to the local Git repository.

  • Execute the command below
git stage .
  • To confirm the files have been staged, type the command below and press enter,
git status
  • Type a short but meaningful description of your choice
git commit -m "Added VNET Subnet and NSG"
  • Finally, the below command to list your commits
git log --oneline

7. Save. Next i run terraform validate to check for errors

Looks good

8. Next, I run terraform plan and the output is shown below,

9. Click save. Next, I run terraform apply, review and then type ‘yes’ to allow Terraform to continue.

10. I log into the Azure Portal and access my resource group, I have a new Virtual Network and Network Security Group located in region UK South.

I click on the new virtual network demo-vnet1, click subnets, and I see my subnet.

I click on demo_subnetA and can see my NSG (ng1demo) attached to demo_subnetA

Finally, here is my tag. I used the name demo

That’s it for now

I hope the journey has been useful to allow you to get started with Terraform.

Thanks for following

Part 8: Terraform with Azure – Deploy terraform.tfvars file

Reading Time: 5 minutes

My journey learning Terraform to allow me to deploy workloads into Microsoft Azure continues. If you missed the previous posts, please visit the links below.

Part 1: Terraform with Azure – How to install Terraform
Part 2: Terraform with Azure – How to install Azure cli
Part 3: Terraform with Azure – How to Install Visual Studio Code
Part 4: Terraform with Azure – How to install Azure Terraform Plugin in Visual Studio Code
Part 5: Terraform with Azure – Install Git and initialise repository
Part 6: Terraform with Azure – Deploy resources in Azure
Part 7: Terraform with Azure – Deploy a variables file in Terraform

Did you know:
A sub directory in Terraform is known as a module. Terraform will only process the *.tf files located in the folder where you run the command terraform plan. If you would like to include configuration from sub directories, then you use the module syntax. For example, If I have a sub directory named networking, which contains my azure network configuration, I can import the networking directory into my working config directory by specifying the below command. We’ll cover more on this as we move on.

module "my_network" {
  source = "./networking"
}

In this blog post I go through the process of compiling a .tfvars file, but before I continue,

What is a .tfvars file?

This is a confusing topic as terraform.tfvars and variables.tf serve a similar role, as in both are variable files. However, a tfvars file stores the default values from a variables.tf file and allows you to override values if required. Still a little confusing, right? Let’s try to work this out by discussing why we would use a tfvars files.

You could create tfvars files to deploy into multiple environments such as prod.tfvars and dev.tfvars. Therefore, the .tf files would hold the default settings that are common among all configurations but the tfvars files could hold different values. Another example of when you could make use of a tfvars file is for applications which have their own unique settings.

Something else to note, Terraform will automatically load the variables from a tfvars file if it’s named terraform.tfvars or *.auto.tfvars and placed in the same directory as your Terraform configuration file. If you wish to execute different named tfvars files, such as, prod.tfvars, staging.tfvars, test.tfvars etc, you can specify a custom tfvars file using the command line parameter -var-file and then specify the path to a variable file. I have specified examples below,

terraform plan -var-file="prod.tfvars"

or 

terraform plan -var-file="app1.tfvars"

So custom named tfvars files can be called upon based on the platform you are deploying to.

Let’s get started from where we left in Part 7. We removed the default values from the variables.tf file, this action resulted in terraform prompting for values when we executed the command terraform plan.

  1. Create a new file named terraform.tfvars

  2. I have loaded both variables.tf and the newly created terraform.tfvars file in a split screen as seen below.

3. In the previous blog post, I removed the default values. For the purpose of this demo, I have hashed the default values as per the screen shot above. If you removed the default values from the variables.tf file, your file will look similar to the one below.

variable "resource_group_name" {
   type = string
  description = "Azure Resource Group Name"
}

variable "resource_group_location" {
   type = string
  description = "Azure Resource Group location"
}

4. I will now copy the text resource_group_name and resource_group_location to the newly created terraform.tfvars file.

5. Next, I input the values for the variables I have copied to the terraform.tfvars file.

My terraform.tfvars file code below,

resource_group_name = "RG-DEMO-PROD1"
resource_group_location = "UK South"


6. Save changes. Next we run terraform plan. Terraform should no longer prompt us to input default values, instead Terraform will automatically recognise the terraform.tfvars file and apply the values. We named the file terraform.tfvars, therefore, the file will be loaded automatically.

Note:
If there was a requirement to run a different named tfvars file such as prod.tfvars, you would specify a command after terraform -plan

Example,

terraform plan -var-file="prod.tfvars"

Type terraform plan -h for a list of available commands

Back to deploying our resource group using the terraform.tfvars file, let’s give it a go. The results are as expected. Terraform has recognised the terraform.tfvars file and not prompted us to insert values manually.

Note:
A terraform.tfstate.backup file is created automatically in case the state file is lost or corrupted and simplifies recovery if needed.


7. So we executed terraform plan and the output shows that our tfvars file was successfully picked up and the values processed by Terraform. Next, we run terraform apply. Review and input ‘yes’

Let’s visit the Azure Portal. The resource group was created successfully.

8. Next, I would like to override a value within the tfvars file, for example, I want to create a resource group but with a name different to the one specified in the terraform.tfvars file. As per the below, my resource group is RG-DEMO-PROD1 and variable name is resource_group_name.

resource_group_name = "RG-DEMO-PROD1"
resource_group_location = "UK South"

9. I type the command below to override the tfvars file for variable resource_group_name. I specify the resource group NEW-RG.

terraform plan -var "resource_group_name=NEW-RG"

10. The result, Terraform reports that the resource group I created earlier will be replaced with the new resource group specified in the command I executed. The old group will be destroyed. I won’t be applying the command below as I only wanted to try out the variable over ride command.


Access the next blog post for part 9, where I deploy a VNET, Subnet, NSG and a tag in Azure. Part 9: Terraform with Azure – Deploy a VNET and Subnet

Thanks for following