Searching Azure blob storage by file extension

Here is a powershell script to search azure’s blob storage by file extension:

## Install Azure powershell, instructions @
## GDURGHA - 2017-09-20
$StorageAcctName = 'STORAGE ACCT NAME'
$StorageAcctKey = 'SECURE KEY HERE'
$ContainerName = 'myfiles'

$StorageContext = New-AzureStorageContext -StorageAccountName $StorageAcctName -StorageAccountKey $StorageAcctKey
$blobs = Get-AzureStorageBlob -Container $ContainerName -Context $StorageContext -MaxCount 10

# Search by Suffix using powershell
Write-Output $blobs | Where-Object {$_.Name -like "*.jpg"} | Select-Object {$_.Name}

Write-Output "-- Search finished --"
By |September 20th, 2017|Azure|0 Comments

Azure Automated Login via Service Principal

In order for this setup to work you must be an administrator for your azure subscription:

  • Create a new application registration under Azure Active Directory.
  • Generate a key for the application.
  • Assign the application to your azure subscription(s).

The community has put together an excellent how to document which will walk you though the 3 steps mentioned above, this can be found at

After performing all 3 steps, you should gather the following information:

  • Tenant ID/Directory ID: This is found under the Properties blade of the Azure Active Directory
  • Application ID:  This is found under the Properties blade of the Register application
  • Secure Key: This is found and generated under the Keys blade of the Register application

After you’ve gather all the information, plug it into this script and execute it. I’ve tested this on Azure Powershell version 4.0.2. To get your version of Azure Powershell execute the following:

Get-Module -ListAvailable -Name Azure -Refresh | Select Version

Here is the script to authenticate your service principal:

$key = '' # Found under Azure AD -> Application -> Keys
$applicationId = '' # Application ID - Self explanatory 
$tenantId = '' # This ID is found under Properties for the Azure Active Directory

# Create credentials
$pass = ConvertTo-SecureString $($key) -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $applicationId, $pass

# Authenticate
Login-AzureRmAccount -Credential $cred -ServicePrincipal -TenantId $tenantId


By |June 6th, 2017|Azure|0 Comments

Microsoft Azure Blueprints

The azure team at Microsoft has put together quick scenario based diagrams to help put together solutions, from BI to DevOps and Live Media Streaming scenarios, you can review them by clicking here.


By |July 26th, 2016|Azure|0 Comments