ArgumentNullException - 获取 - AzureService [英] ArgumentNullException - Get-AzureService
问题描述
我想使用的Windows Azure PowerShell模块,来管理订阅。
I'm trying to use the Windows Azure PowerShell module to manage a subscription.
我已经下载了我的证书(.publishsettings文件)和进口AzurePublishSettingsFile
然后我选择我的订阅与进口它选择-AzureSubscription
两者都不给了错误。
I have downloaded my certificate (the .publishsettings file) and imported it with Import-AzurePublishSettingsFile
and then I've selected my subscription with Select-AzureSubscription
neither of which gave errors.
我还设置使用我的订阅设置AzureSubscription -SubscriptionName嗒嗒
I've also set my subscription using Set-AzureSubscription -SubscriptionName "Blah"
不过,我收到了
Get-AzureService : Value cannot be null.
Parameter name: subscriptionId
运行时,
GET-AzureService
我读过入门指南和各类文档,但我不能工作了,我做错了什么。这在我的脑海里,使这是一个问题UX,微软应该解决的问题。
I've read getting started guides and various documentation but I can't work out what I'm doing wrong. Which in my mind, makes this a UX problem that Microsoft should address.
更新
我远一点,我用
Set-AzureSubscription -SubscriptionName "Blah" -SubscriptionId 0123
从 GET-AzureService
来改变错误:
Get-AzureService : Value cannot be null.
Parameter name: managementCertificate
但现在既然参数要一个X509Certificate型我不能把我的证书。
But now I cannot set my certificate since the argument wants an X509Certificate type.
推荐答案
有一个更好的办法使用Azure的PowerShell命令--- 增加-AzureAccount验证
。这将提示您的登录凭证,而不是使用服务管理证书。
There is a better way to authenticate when using the Azure Powershell cmdlets --- Add-AzureAccount
. This will prompt you for your login credentials instead of using the service management certificate.
您可能仍然会碰到一些问题,因为Azure的PowerShell的缓存在XML文件中订阅的%APPDATA%\\ Windows Azure的PowerShell的
。
You may still run into some issues because Azure powershell caches your subscriptions in XML files in %appdata%\Windows Azure Powershell
.
我会建议:
- 关闭Azure的PowerShell窗口
- 删除
%APPDATA%\\ Windows Azure的PowerShell的
。 的XML文件 - 开启的Azure PowerShell和运行
添加-AzureAccount
。
- Close the Azure Powershell window
- Delete the XML files in
%appdata%\Windows Azure Powershell
. - Open Azure Powershell and run
Add-AzureAccount
.
这应该确保您有配置正确的订阅。
This should ensure that you have the correct subscriptions configured.
这篇关于ArgumentNullException - 获取 - AzureService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!