2016-02-10 29 views
1

我的BizSpark帳戶上有移動服務,我的終端服務上有一個通知中心。我想通知中心添加到MobileService現有的BizSpark的,我得到了一個錯誤,並要求再試一次,它消失了:使用Azure Powershell將通知中心移動到另一個服務

enter image description here

我嘗試了幾個新中心作爲可以在圖片中可以看出但他們都沒有工作,給我錯誤,我沒有與我的舊通知中心。

我當時就想中樞轉移到哪裏我也跟着Msdn相同的訂閱,並使用PowerShell中的下列命令:

PS C:\Users\johann> Import-Module Azure 

PS C:\Users\johann> Login-AzureRmAccount 

Environment   : AzureCloud 
Account    : [email protected] 
TenantId    : xxxxxx 
SubscriptionId  : xxxxx 
CurrentStorageAccount : 

PS C:\Users\johann> Get-AzureRmSubscription 

SubscriptionName : Windows Azure MSDN - Visual Studio Ultimate 
SubscriptionId : xxxULTIMATExxxx 
TenantId   : 
State   : 

SubscriptionName : BizSpark 
SubscriptionId : xxxBIZSPARKxxxx 
TenantId   : 
State   : 

PS C:\Users\johann> $res = Find-AzureRmResource -ResourceName 'MyNotificationHubsName' 

PS C:\Users\johann> Move-AzureRmResource -DestinationResourceGroupName 'DestRG' -ResourceId $res.ResourceId -DestinationSubscriptionId 'xxxBIZSPARKxxxx' 

這給了我下面的錯誤:

Move-AzureRmResource : Cannot validate argument on parameter 'ResourceId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:1 char:73 + ... inationResourceGroupName 'DestRG' -ResourceId $res.ResourceId -Destin ... + ~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Move-AzureRmResource], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.MoveAzureResourceCommand

燦有人幫我解決這個問題嗎?

確保 您登錄的帳戶是源訂閱。通過將登錄後的SubscriptionID與Get-AzureRmSubscription的結果進行比較來驗證。

回答

2

請嘗試以下CMD:

Get-AzureRMResource -ResourceName **** -ResourceGroupName **** | 
     Move-AzureRMResource -DestinationResourceGroupName *** -DestinationSubscriptionId **** -Force 
+0

謝謝!我與Microsoft支持人員交談過,上面的代碼實際上是正確的,問題在於Azure沒有將我的notificationHub保存到resourceGroup中,所以我無法移動notificationHub,但現在一切正常。但我不確定如何回答這個問題:) 可能會刪除它。 – JTIM

+1

好的,你可以在這裏留下一段時間,這對有同樣問題的人會有幫助。 –

相關問題