Skip to main content

Posts

Powershell for Azure KeyVault Certificate Management, SAS key & credentials

Powershell to work with Azure KeyVault for Certificate Management #Login to ARM Account and select related Subscription Login-AzureRmAccount $subscriptionId= 'MY_Subscription_GUID' Set-AzureRmContext -SubscriptionId   $subscriptionid # Create Resource Group for  azure  KeyVault $myrg='myrg' $location='eastus' New-AzureRmResourceGroup -Name $myrg -Location $location # Create  azure  KeyVault # Use -EnabledForDeployment  to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. # Use -EnabledForTemplateDeployment to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. $mykeyvault ='mykeyvault' New-AzureRmKeyVault -VaultName $mykeyvault -ResourceGroupName $myrg -Location $location -EnabledForDeployment -EnabledForTemplateDeployment # Import Cert to  azure  KeyVault $CertificateName ='mycert' # expected pa...
Recent posts

Get/Set SubscriptionID from multiple Azure Subscription list

Powershell command can be very useful when you are admin of multiple subscription  #Login to ARM Account  Login-AzureRmAccount # By default your default subscription will get selected. You can assigned but below script will help you to select desired subscription  #Select desired subscription $_SubscriptionObject =      (Get-AzureRmSubscription |          Out-GridView `             -Title "Select Your Azure Subscription ..." `             -PassThru).SubscriptionId #Get SubscriptionID & Subscription Name $SubscriptionId = Get-AzureRmSubscription -SubscriptionId $_SubscriptionObject |Select SubscriptionId -ExpandProperty SubscriptionId $SubscriptionName = Get-AzureRmSubscription -SubscriptionId $_SubscriptionObject |Select SubscriptionName -ExpandProperty SubscriptionName #Set SubscriptionID you want to work On Set-AzureRmContext -SubscriptionId...