Category Archives: Azure

Azure PowerShell: Deploy Linux Custom Script Extension

Here’s how you can deploy an Azure VM Extension via PowerShell: # Before running this, upload your bash script to an Azure storage account container, grab its name and key via PowerShell or the Azure portal   Login-AzureRmAccount   $Subscription … Continue reading

Posted in Azure, Bash, PowerShell | Leave a comment

Azure PowerShell: Copy All Files in Blob Storage to Local Directory

Here’s a Azure PowerShell script that downloads all blobs in a storage container to your local disk:   $storageAccountName = "mysuperstorage" $containerName = ‘my-blobs’ $destinationFolder = ‘C:\temp\my-blobs’   New-Item -ItemType Directory -Force -Path $destinationFolder   Login-AzureRmAccount   $storageAccountContext = (Get-AzureRmStorageAccount … Continue reading

Posted in Azure, PowerShell | Leave a comment

Azure: Run Windows Custom Script Extension with VM Credentials

By default, the Windows Custom Script Extension in Azure will run as Local System. Here’s how you can pass your VM credentials from your Azure Resource Manager (ARM) template to the custom script extension and ensure they are not easily … Continue reading

Posted in Azure, PowerShell | Leave a comment

Azure SDK Installation Issues

If you are trying to install the Azure SDK with the Web Platform Installer and the process gets “stuck” on step two, run the following from an administrative command prompt to remove and recreate the SQL localdb instance: Delete the … Continue reading

Posted in Azure, PowerShell | Leave a comment

Azure: Troubleshooting PowerShell DSC Resources

The errors you get back from the PowerShell DSC extension in Azure can be frustratingly terse. Here’s a way to troubleshoot and try out PowerShell DSC changes without having to deploy the extension over and over again. After the extension … Continue reading

Posted in Azure, PowerShell, PowerShell DSC | Leave a comment

Azure PowerShell: Set Custom Script Extension on VM

Here’s a script that sets/runs an existing custom script extension on a VM in Azure: $ResourceGroupName = "MyResourceGroup" $StorageAccountName = "mystorage" $VmName = "MyWinVm01"   $ExtensionName = "TestScriptExtension" $ExtensionContainerName = "extensions" $ExtensionFileName = "test\TestScriptExtension.ps1"   $ResourceGroupLocation = (Get-AzureRmResourceGroup -Name $ResourceGroupName)[0].Location … Continue reading

Posted in Azure, PowerShell | Leave a comment