Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Set Default Storage Account for PowerShell Cmdlets in Azure

$
0
0

Summary: Learn how to define the default storage account to be used with the Azure PowerShell cmdlets.

Hey, Scripting Guy! Question How do I tell Azure which media or storage account I'd like to use when I create a virtual machine?

Hey, Scripting Guy! Answer Use Get-AzureStorageAccount to access the names of your storage accounts, and
           then use Set-AzureSubscription to define your current default for the cmdlets.

The following example sets the first account as the default in the subscription called 'HSG Azure Subscription':

$StorageAccount=(Get-AzureStorageAccount)[0].label

Set-AzureSubscription –SubscriptionName 'HSG Azure Subscription'
–CurrentStorageAccountName $StorageAccount 



Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>