1
votes

I am working with azure powershell to spin up HDInsight Clusters. I have 2 subscriptions to work with, call them foo-bar and kitty-ipsum.

If I call

 New-AzureRmHdInsightCluster -parameters

A new cluster will show up in the foo-bar subscription. If I want to set one up in the kitty-ipsum subscription, I need to change the default or current subscription.

  Select-AzureSubscription "kitty-ipsum"
  New-AzureRmHdInsightCluster -parameters

should change the current subscription to kitty-ipsum , yet this still produces a cluster in foo-bar.

What I need to know is how to create a new cluster with this other subscription.

Looking into the issue, I found that there is work to make the subscription a parameter on New-AzureRmHdinsightCluster https://github.com/Azure/azure-powershell/issues/1102 . This update might not be released for a while.

1

1 Answers

0
votes

So this was a little tricky, but I think I could re-ask my question as "How do I switch subscriptions". Which there are cmdlets for that, they just weren't working for some reason.

Here is how I solved this.

 Get-AzureRmSubscription –SubscriptionName "kitty-ipsum"  -TenantId $ID | Select-AzureRmSubscription

This allowed me to change the current subscription.