使用 Azure Powershell 将通知中心移动到另一个订阅
Moving Notification Hub to another subsription using Azure Powershell
我的 BizSpark 帐户上有一个移动服务,我的终极订阅上有一个通知中心。我想将 Notification Hub 添加到 BizSpark 上现有的 MobileService,但出现错误并要求重试,但它消失了:
我尝试了几个新的集线器,如图所示,但其中 none 有效,给我的错误是我的旧通知集线器没有的。
然后我想将集线器转移到我关注的同一个订阅 Msdn,并在 Powershell 中使用以下命令:
PS C:\Users\johann> Import-Module Azure
PS C:\Users\johann> Login-AzureRmAccount
Environment : AzureCloud
Account : xxxxx@gmail.com
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
.
的结果进行比较来验证
尝试以下命令:
Get-AzureRMResource -ResourceName **** -ResourceGroupName **** |
Move-AzureRMResource -DestinationResourceGroupName *** -DestinationSubscriptionId **** -Force
我的 BizSpark 帐户上有一个移动服务,我的终极订阅上有一个通知中心。我想将 Notification Hub 添加到 BizSpark 上现有的 MobileService,但出现错误并要求重试,但它消失了:
我尝试了几个新的集线器,如图所示,但其中 none 有效,给我的错误是我的旧通知集线器没有的。
然后我想将集线器转移到我关注的同一个订阅 Msdn,并在 Powershell 中使用以下命令:
PS C:\Users\johann> Import-Module Azure
PS C:\Users\johann> Login-AzureRmAccount
Environment : AzureCloud
Account : xxxxx@gmail.com
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
.
尝试以下命令:
Get-AzureRMResource -ResourceName **** -ResourceGroupName **** |
Move-AzureRMResource -DestinationResourceGroupName *** -DestinationSubscriptionId **** -Force