Great news…about Azure Function development
Azure Functions Visual Studio Tools Preview
Great news…about Azure Function development
Dev, Cloud and Stuff!
Category: Azure
Great news…about Azure Function development
I have been trying to write a PowerShell command that would help me find the right Azure VM Image to use when creating a new Virtual Machine.
In the Portal UI you get something not very useful like the following when search for a VM Image. No unique identifying information to locate the image from script.
However, when using such a simple search in PowerShell, you get a lot more data returned and working out which one you want is a bit of a pain.
After a few iterations I thought I would share it and save others the time.
The first thing is how to filter the huge list to just the images that contain what I am after, whether that’s a service or OS. It turns out that there is not much consistency to help here, but two fields stand out for searching.
Once filtered, there seemed to be a number of additional fields that may vary and influence your decision as to which VM Image you want when creating a new VM.
I was looking for a simple “Windows Server 2016 Datacenter”. Ideally the recommended or default. For this case it was possible to filter by the ImageFamily. However I noticed this was not going to be so easy for other things such as ‘SQL Server’ images as some ImageFamily were return with text like ‘Windows SQL14-PCU-MAIN-12.0.5000.0-SQLENTCORE.ENU.Nov-WS2012R2-127gb.09.27.16.01.042’ , so opted for filter on the Label instead.
$searchTerm = "*Windows Server 2016*" Get-AzureVMImage | Where-Object {$_.Label -like $searchTerm -and $_.Category -eq "Public" -and $_.ShowInGui -ne $false} | Sort-Object PublishedDate -Descending | Select-Object Label,PublisherName, PublishedDate,IsPremium,RecommendedVMSize,ImageName | Format-Table
The line above will produce a table output as shown below, but the ImageName, which is probably what you are after, may well be truncated.
So, once you have honed your search term down, then run this smaller table version.
Get-AzureVMImage | Where-Object {$_.Label -like $searchTerm -and $_.Category -eq "Public" -and $_.ShowInGui -ne $false} | Sort-Object PublishedDate -Descending | Select-Object Label,ImageName | Format-Table
which produces something like the listing below, from where you can copy the full ImageName.
New to Docker and especially with hosting and managing on Microsoft Azure? Then this is a good starter read.
I just found this very useful tool, especially if you are dealing with Azure VMs.
This is the tool used by the Azure Developer Support Team. You can install it while on a VM using Powershell by running the following in a Powershell command window:
md c:\tools; Import-Module bitstransfer; Start-BitsTransfer http://dsazure.blob.core.windows.net/azuretools/AzureTools.exe c:\tools\AzureTools.exe; c:\tools\AzureTools.exe
For more info see https://blogs.msdn.microsoft.com/kwill/2013/08/26/azuretools-the-diagnostic-utility-used-by-the-windows-azure-developer-support-team/
Very useful article on Azure Table queries.
Before you spend any time banging your head against the wall on this, please note that SQL Data Tools schema comparisons do not work against SQL Azure Basic databases. It will fail with some kind of timeout error. Do not be tempted to start messing with your default SQL timeouts. The default is already 60 seconds and thats plenty of time for almost everything you will encounter.
To change your edition (and there are many reasons to, not least point in time continuous backups and geo replication), you will need to go to the Scale tab on your database and select at least a Standard subscription type.