【问题标题】:Moving Notification Hub to another subsription using Azure Powershell使用 Azure Powershell 将通知中心移动到另一个订阅
【发布时间】:2016-02-15 17:30:23
【问题描述】:

我的 BizSpark 帐户上有一个移动服务,我的 Ultimate 订阅上有一个通知中心。我想将通知中心添加到 BizSpark 上现有的 MobileService 中,但出现错误并要求重试,但它消失了:

我尝试了几个新的集线器,如图所示,但它们都不起作用,给了我旧通知集线器没有的错误。

然后我想将集线器转移到我关注 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:无法验证参数“ResourceId”上的参数。参数为 null 或空。提供一个不为 null 或空的参数,然后尝试 再次命令。 在行:1 字符:73 + ... inationResourceGroupName 'DestRG' -ResourceId $res.ResourceId -Destin ... +~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Move-AzureRmResource], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.MoveAzureResourceCommand

谁能帮我解决这个问题?

确保 您登录的帐户是源订阅。通过将登录后的 SubscriptionID 与来自Get-AzureRmSubscription 的结果进行比较来验证。

【问题讨论】:

    标签: powershell azure azure-notificationhub


    【解决方案1】:

    试试下面的cmd:

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

    【讨论】:

    • 谢谢!我与 Microsoft 支持人员交谈,上面的代码实际上是正确的,问题是 Azure 没有将我的 notificationHub 保存在 resourceGroup 中,所以我无法移动 notificationHub,但现在一切正常。但是我不确定如何回答这个问题:) 可能会删除它。
    • 好的,你可以把它放在这里一段时间,它对有同样问题的人很有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-17
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    • 2016-12-09
    • 2016-08-05
    相关资源
    最近更新 更多