Creating an Azure Resource Group using PowerShell

At the beginning of my recent post about creating an Azure files backup using Azure Resource Manager (ARM) and the Azure portal I detailed how to create an Azure Resource Group. This is of course not the only way that you can create an Azure Resource Group, you can also use PowerShell.

Before you use PowerShell make sure you have read my article:

Connecting to Azure Resource Manager via PowerShell

and you follow the steps outline to connect to your Azure Resource Manager account.

image

If we look at the Azure portal we see there is currently only one Resource Group called CIA.

image

Once connected to the Azure tenant with PowerShell run the command:

new-azurermresourcegroup –name “name” –location “data-center”

where you need to enter the desired “name” and “datacenter” here I have chosen to create a new Azure Resource group called cia2 located in the Australia East data center (“australiaeast”).

image

Once the command has completed successfully, if you now return to Azure portal and refresh the Resource Group display you should see a new Azure Resource Group has been created as shown above with the name you selected (here cia2)

You can now use this Azure Resource Group to put all sorts of resources into. I’ll cover more on how to do that specifically with PowerShell in an upcoming article, however, that’s how easy it is to create an Azure Resource Group using PowerShell.

Creating a Basic LAN in Azure

I’ve just uploaded a video presentation I gave a while back on creating a basics LAN in Azure. The process uses the Azure Service Manager portal to do this in a ‘classic’ cloud deployment. Note, this is not the same as with the Azure Resource Manager (ARM). I’ll be doing something around that soon.

Hopefully, this will give you a basic idea of what’s involved in creating a LAN in Azure.

Connecting to Azure Resource Manager via PowerShell

There is no doubt PowerShell is the premier way to configure and manage things like Azure. However, there has always been a challenge actually connecting to the environment to get the ball rolling.

The first thing that you need to do to connect to Azure Resource Manager via the command line is ensure that you have PowerShell 5 installed and configured for Azure Resource Manager. This previous article of mine:

Life is far easier with PowerShell 5

which will show you how to not only configure your PowerShell environment on a Windows 2012 R2 server but also install the modules required to access Azure Resource Manager.

image

Once you have launched the PowerShell environment enter the following commands to load the ‘classic’ Azure Service Manager and the newer Azure Resource Manager modules into the session:

import-module azure

import-module azurerm

image

You’ll now need to login to your Azure account and in this case you’ll login to the Azure Resource Manager account using the command:

login-azurermaccount

Typically a dialog will now appear asking you to enter your Azure account login and password.

image

When this has been successfully completed you should details of the account echoed back to you as shown above.

image

If you also want to access the ‘classic’ Azure Service Manager account issue the command:

add-azureaccount

You may need to login again with your Azure account details.

Once complete you’ll again be echoed back the details of that account as shown above.

image

We will continue to work with the newer Azure Resource Manager here. So if you now issue the command:

get-azurermsubscription

You will see the details of the Resource Manager subscription as shown above. The important thing here is typically the subscription name (here ‘Azure Pass’). You’ll typically need to refer to the subscription by name when using PowerShell commands for Azure.

image

The recommendation way to do this easily is to issue the command:

$subscription=get-azurermsubscription

This will store the results of the get-azuresubscription command in a variable called $subscription.

To extract the actual name of the subscription and store it in a variable issue the command:

$subscriptionnname = $subscription.subscriptionname

In this case, the command will store the string ‘Azure Pass’ into a variable called $subscriptionname that can be used later throughout the script.

image

You can then issue the command:

select-azurermsubscription –subscriptionname $subscriptionname

To select the Azure Resource Manager subscription to work with (remembering that it is possible to have multiple different subscriptions inside a single Azure tenant).

You should see the Azure Resource Manager account details echoed back to you as shown above.

image

If you also want to target the older Azure Service Manager subscription then you should issues similar commands:

$subscriptionold = get-azuresubscription

$subscriptionnameold = $subscriptionold.subscriptionname

select-azuresubscription –subscriptionname $subscriptionnameold

as shown above.

Now you can work with you Azure tenant and PowerShell commands for both Azure Resource Manager and the older Azure Service Manager if required.

As you can appreciate with scripting and PowerShell there is lot more we can do to improve the connection experience and I’ll look to detail that in the future but this should at least get you started.

Life is far easier with PowerShell 5

PowerShell is a scripting language that allows you to control and automate a whole lot of technology. It is really the premier administration tool for managing Office 365 and Azure. Unfortunately, because of its ‘programming’ nature many IT Professionals have avoided it.

One of the issues with PowerShell has been configuring the environment to allow access to everything you need. Typically, you needed to download and install separate modules to allow commands to be execute for Office 365 service and Azure. PowerShell 5 has overcome that problem by allowing you to download and install these modules directly from the PowerShell command line.

Thus, you need to firstly have PowerShell 5.0 on your machine. PowerShell 5 is included with the latest versions of Windows 10 but unfortunately it isn’t currently installed by default on Windows Server 2012 R2. This means if you want to use PowerShell version 5 on a server you’ll typically need to firstly download and install it.

image

For a Windows Server 2012 R2 you’ll need to download and install the Windows Management Framework 5,0 which you can find here:

https://www.microsoft.com/en-us/download/details.aspx?id=50395

image

When executed it will scan the machine to determine what updates need to be installed.

image

You’ll then be promoted to install any updates.

image

After these updates have been installed you may need to be reboot the machine.

image

To download and install the Azure module for PowerShell simply open a new PowerShell command prompt now and type:

install-module azure

You maybe be prompted to install the NuGet provider. Enter Y here to accept this.

image

You may also be prompted that you are installing from an untrusted repository. Again, select Y here to continue.

image

You should now see the module package being downloaded and installed as shown above.

When complete you’ll be returned to the command prompt.

image

To install the Azure Resource Manager module now type:

install-module azurerm

You should again see this module being downloaded and installed as shown above.

You’ll again be returned to the command prompt when complete.

image

Now if you issue the command:

get-module –listavailable

You will see all the see all the PowerShell modules that are available to you. In the above example you can see both the Azure and AzureRM modules are listed as available.

image

If you now issue the command:

$psversiontable.psversion

You will see the version of PowerShell installed (here version 5 as expected).

That’s a lot easier than it ever used to be with PowerShell and another reason why you should be using the latest version!

Restoring files and folders with Azure backup

In previous articles I’ve covered how to set up Azure files and folders backup as well as how to actually backup data. I’ll now show you how to recover data backed up using Azure Backup for files and folders.

image

Launch the Microsoft Azure Backup program. In the top right reselect Recover Data.

image

The Recover Data Wizard will now launch. You’ll firstly need to select whether you are restoring files from the current location or whether you are on a different server.

image

If you are on a different server you will need the Azure Recovery Vault credentials for verification as shown above. For information about obtaining those see the previous article.

Select Next to continue.

image

You can now either browse or search for the files you wish to restore. In this case Browse is selected.

Press the Next button to continue.

image

You’ll now need to select a point in time from which to restore your files. In this case there is only one option.

Select Next to continue.

image

Locate the files you wish to restore by placing a check mark next to them.

Press the Next button to continue.

image

You now need to determine where the files will be restored to. In this they will be restored to an alternate location (the desktop). You also need to determine whether you wish to keep any duplicate copies and whether to restore the permissions to those files.

Select the Next button to continue once you have made your selections.

image

You will now receive confirmation of the restore process as shown above. If everything is in order select Recover.

image

The restore process will now commence. The amount of time to restore will depend on factors such as bandwidth and the amount of data you have chosen to restore.

When the restore process is complete you will receive the above notification. Select Close to continue.

image

If you now look in the backup software console you should see a successful backup job has completed and there is information in the Last Recovery area in the lower right as shown above.

image

If you select the View details link under this Last Recovery area you will see a summary of the recover job as shown above.

image

You should also now see your recovered files as shown above.

The important thing to remember is that you can restore data from Azure File backup to any machine, you’ll simply need to have the Vault credentials if you perform this on a machine that wasn’t the original source.

You can use Azure File backup to not only backup servers but also workstations running operating systems such as Windows 10. You can also backup multiple machine to a single Azure Recovery vault if you choose. This makes Azure Files backup a quick and easy method to schedule continual backups to the cloud.

Backup files and folders using Azure

In a previous post I detailed how to set up an Azure Recovery Service Vault using Azure Resource Manager and then installing the Azure files backup client. In this article I’m going to walk through how to actually setup and run a backup to Azure for your files and folders.

image

Run the Microsoft Azure Backup software on the machine to be backed up. If you haven’t configured this yet, read my previous article on setting all this up.

With the Microsoft Azure Backup software running as shown above, select Schedule Backup in the top right.

image

The above dialog will appear. Select Next to continue.

image

You are now taken to a dialog where you need to select the files and folders from the current machine.

Select the Add Items button to select the items you wish to backup.

image

This will then pop up a file explorer like that shown above. Select the locations you wish to backup and press the OK button.

image

You should now see the backup locations you selected  displayed in the top window as shown above. You can also use the Exclusion Settings if you want to filter what is backed up from the locations selected.

When complete, select the Next button to continue.

image

You’ll then be prompted to schedule how often you wish to backup your locations. The most backups you can currently perform is three per day.

Once you have made you selection select Next to continue.

image

You are now prompted to enter the retention policy settings. This determines which backups are retained and for how long.

When you have made your selection press Next to continue.

image

Given that the initial backup of the locations can be quite large you are now presented with the option to perform the initial backup offline to local storage. If your Azure datacenter supports the option, you can then ship this local back to Microsoft so it seed any future backups.

Details on this process can be found here:

Offline backup workflow in Azure Backup

If you leave the option set to Automatically over the network, the backup data will be sent across the Internet to Azure.

Press the Next to continue.

image

You will now see a confirmation screen.

Select Finish to complete the configuration.

image

You will now see the backup schedule being created.

image

and you should receive confirmation that it has been successful.

Select Close to continue.

image

The backup will now run automatically in the background based on the settings you configured. However, if you wish to wish to manually run a backup at any time select the Back Up Now link in the top right.

image

This will launch a dialog as shown above asking you to confirm running a backup.

Select the Back Up button to continue.

image

The backup will now commence by taking a snap shot of the drive.

image

You should then see data being transferred by the program as shown above.

image

When the backup has completed you will receive the above message. Select the Close button to return to the backup software console

image

If you now look at the console you should see a successful backup job has completed.

image

If you select the View details link you will see a summary of the backup job as shown above.

The backups will continue to run on the configured automated schedule. You can of course re-run a manual backup at any point.

In an upcoming post I’ll detail how you restore data from this Azure backup.

Using Azure Resource Manager when backing up files

A while back I wrote an article about how to use Azure file backup. You’ll find that article here:

Azure desktop backup

That was using the older Azure Service Management (ASM) or ‘classic’ deployment. However, now the newer Azure Resource Manager (ARM) is available. That means that if you are looking to do anything in Azure you should now be using ARM. So here’s how you do Azure file backup with ARM via the portal.

image

Start by logging to Azure portal:

https://portal.azure.com

image

The first you’ll need to do is generally create a Resource Group in which the backup vault can live. An Azure Resource Group is simply a container for a range of Azure services. To create or view a Resource Group select the Resource groups item from the menu on the left.

image

In this case you’ll see there are no existing Resources Groups so select the Add button at the top of the page.

image

Give the new Resource Group a name, select the Azure subscription you wish it tied to and finally a region for the Resource Group.

Select Create when complete.

image

You’ll then typically see a notification that the Resource Group has been created as shown above.

image

If you return to the list of Resource groups and refresh the page you should see the item you just created.

Close all the open blades and return to the desktop canvas.

image

Select the Browse button at the bottom of the menu on the left. This will display a further menu listing all the available Azure services. From this list locate and select Recovery Service vault.

image

Most likely a vault will not already exist so select the Add button in the top left to create a new vault or container to put backup data into.

image

Give the vault a name, select the Azure subscription you wish to use as well as the Resource Group previously created. You can create a new Resource Group here as well if you wish but best practice is to create the Resource Group prior. You can also select the location for this vault.

When complete, select the Create button.

image

You’ll receive a notification that deployment of the new vault has commenced.

image

After a few moments the vault deployment will complete.

 image

If you now return to the list of Recovery Services vaults and refresh the list you should see the item you just created as shown above.

Select the new Recovery Services vault to continue.

image

Select the Backup icon at the top of the page.

image

This will commence a wizard. In the Backup Goal blade select On-premises for the option Where is your workload running? Then place a check in Files and Folders for the option What do you want to backup?

image

A message box will then appear below your selections. Select this.

image

Exactly as before, you’ll need to download and install the Azure backup software onto the destination. Part of this installation will also require the connection to the Azure Recovery vault so you’ll also need to download the vault credentials to be used during this configuration.

Select the Download Agent for Windows Server or Windows Client on the machine you intent to backup.

Once the file has downloaded, run it.

image

Select the locations for the installation and then select Next.

image

Enter any proxy information and select Next to continue.

image

Select software update option and then Next to continue.

image

Select the Install button.

image

The installation process will proceed.

image

Select the Proceed to Registration button to continue.

image

Ensure you have downloaded the vault credentials and saved them to the same machine you are installing the backup client on.

image

Browse to location of the downloaded vault credentials and select them. They will be verified and if all is good you should see the vault details appear in the dialog as shown above.

Select Next to continue.

image

Enter a passphrase to protect the data being backed up in the vault. This is effectively the encryption key for the data. If you lose or forget this then you won’t be able to restore the data.

Best practice is to use the Generate Passphrase button to create a complex passphrase. You then need to save that file with the passphrase somewhere. Ensure you copy this file to ANOTHER location so it is not only found on the machine being backed up. Because if the backed up machine fails you want to have this passphrase retrievable so you can restore.

Select Finish when complete.

image

The process should complete without error. If there is an error simply press the Back button and repeat the registration process again.

Ensure that the Launch the Azure Recovery Services Agent option is checked and select the Close button.

image

You should now see the Microsoft Azure Backup console displayed as shown above.

You can now configure the backup of files and folders from this machine to the Azure Recovery vault as normal and outlined in the original article. I’ll cover this process again in more detail in an upcoming post.

The important thing here is that the Azure Recovery vault has now been configured with the Azure Resource Manager which is the preferred method you should use going forward with Azure.

Why IT today is like coffee

One of the common things I hear from many IT Professionals today is how ‘hard’ everything is when it comes to IT. “Why can’t it be easier?” they typically bemoan. “Why are they so many choices?”. Here’s my explanation starting with two analogies.

The first analogy is coffee. I’ll almost guarantee today that if you go to you local haunt and ask for just ‘coffee’ you won’t get anything. Why? Because simply asking for ‘coffee’ is not enough. You need to specific what size of coffee (small, regular or large). You’ll need to specify what type of coffee (long black, short back, cappuccino, latte, etc). You’ll also probably have to specify if you want milk and what type (full cream or reduced fat). There is also a good chance that you’ll also need to specify whether you want sugar and so on and so on. So even for something as ‘simple’ as buying a cup of coffee a fair amount of work needs to be done up front.

The benefit is that you, and every coffee customer, can now get EXACTLY the coffee they want. If there wasn’t that choice then everyone would be swilling Nescafe. It is also clear that the places that sell custom coffees far outweigh those places selling generic Nescafe right? Why? Because todays market is all about tailoring the product to the exact need of the customer not about giving them a generic product and hoping they’ll come back.

The second analogy is messaging. A few decades ago the only way that you could communicate with someone was either by talking with them face to face or by sending a letter (or perhaps a telegram). Then the telephone came along and you could call anyone (provided they were at home or in an office). Then mobile phones appeared and now you can call anyone anywhere. However, the mobile phone opened the door to the mobile Internet and social media. So today, just stop and think about how many ways you could communicate with someone? There’s email, Facebook, Twitter, Instagram, Skype, Snapchat, Google Plus, and so on and so on.

As we all know with messaging, different channel work better for different people. Millennials typical never use email, they use Snapchat. Some prefer email, while others Facebook. Most people have many channel on which you can connect to them. Channels like Facebook allow you to share more than just words. You can share videos and images which makes them even more engaging. So now, even the ‘simple’ idea of communicating with someone requires a fair amount of work. if you want to chat with a heavy Facebook user, you are typically going to have to get on to Facebook.

Again, the benefit is that more choice allows people to select the options that suits them best. People who use social media typically rely more heavily on their phone, Heavy desktop PC users typically favour email. The reason why many now favour things like social media is that their inbox is overloaded because it has become the ‘generic’ way to communicate these days and doesn’t work for them. Again, todays market is all about allowing customers to select what works best for themselves.

If we now turn our attention to IT we see the same thing. In the ‘good old days’ you bought a bundled product like Small Business Server that contained your email, files and folders and intranet. However, because it was a bundle you had to have the intranet portion, even if you didn’t need it. That means additional unwanted components were chewing up resources that really weren’t necessary. It also meant maintaining something that again, you may not have been using.

Fast forward to today and IT is like the world or coffee and communications, consumers now have the ability to select exactly what they need and how much they need. We live in a customised on-demand world. The benefit of all this choice is an optimised and efficient solution, however the trade off is that determining and delivering that requires more work.

If you were selling coffee back in the day, you brewed one pot and dished that out to every customer. Today each coffee is a custom configuration, taking longer to deliver and requiring more skill to create. Same with IT. Solutions like Azure providing almost infinite depth in the options they offer and require more time and skill to craft but the end result is something that fits the customer like a glove glove rather than an oven mitt.

For those IT Professionals that bemoan the new world of ‘non-bundling’ can I say that you look around and smell the coffee so to speak. Are there less places offering ‘custom’ coffee these days? Nope, there is a coffee shop delivering every sort of imaginable coffee on every corner it seems. The market is growing in leaps and bounds. Why? Because this is what customers are demanding. Look further afield. Custom travel packages, dinning, kitchens and more is exploding. IT is no different. Customisation is king and those who can supply this win.

So what do IT Professionals need to do? Like coffee baristas, they need to understand all the options available to them and be able to craft a tailored solution to meet the customers needs. The only way that happens is to skill up on the technologies available as I have said before:

Skill up or fade away, it is that simple

There is no wizard that you can run that will do this for you. If you are an IT Pro you need to put in the hard yards to learn this stuff. The good news is that if you are prepared to do the hard yards you’ll stand out from the crowd, you’ll be able to charge more and you’ll have more business coming you way as customer continue to demand skilled operators.

We live in a world that is very different even from a few years ago. IT, like everything else, is customer driven and customers are demanding solutions tailored to their needs not generic bundles that include things they’ll never use. Luckily products like Azure and Office 365 allow such granularity of choice but like getting a good coffee it takes a skilled barista or IT professional to create and deliver this. Skill only comes from hard work, which luckily not everyone is prepared to do.

Pass the grande, mocha, frappaccino, with stevia and let’s get on with our day