2

我正在尝试使用 CLI 工具将保留的 IP 分配给 VM。运行后 $: azure network nic set [

pawel@LAMP-Test:~$ azure network nic set LAMP-Test FirstReservedIP
info:    Executing command network nic set
error:   The current cmdlet requires you to log in using Azure Active Directory account, not from a .publishsettings file. Please run 'azure login' or use 'azure account set' to select a correct subscription.
info:    Error information has been recorded to /home/pawel/.azure/azure.err
error:   network nic set command failed      

info:    Executing command network nic set
error:   The current cmdlet requires you to log in using Azure Active Directory account, not from a .publishsettings file. Please run 'azure login' or use 'azure account set' to select a correct subscription.
info:    Error information has been recorded to /home/pawel/.azure/azure.err
error:   network nic set command failed  
 azure network nic set LAMP-Test FirstReservedIP
    

] 1 FirstReservedIp

我收到以下错误:

当前的 cmdlet 要求您使用 Azure Active Directory 帐户登录,而不是从 .publishsettings 文件登录。请运行“azure login”或使用“azure account set”选择正确的订阅。

有没有办法只使用 .publishsettings 文件来完成这项任务?

4

1 回答 1

2

不,至少在您处于 ARM 模式时不会。仅在 ASM 模式下支持使用 .publishsettings 文件从 CLI 工具进行身份验证。

更多信息可在此处获得。

您仍然可以使用 CLI 实现非交互式登录,但它需要您使用工作/学校帐户(也称为组织帐户)对 Azure AD 进行身份验证。因此,如果您还没有管理员用户(或服务主体),请在您的 Azure AD 中创建一个。然后,将 azure login 命令添加到 CLI 脚本的顶部。例如...

azure login --username johndoe@contoso.onmicrosoft.com --password passw0rD!
azure network nic set LAMP-Test FirstReservedIP
于 2016-05-19T14:47:41.777 回答