Use Azure Service Application and Service Principal

Azure has many functions that I don’t know. Recently I need to dynamically create Virtual Machines, but using my own credential is not properly since it needs 2FA to authenticate. I searched the document, Azure provides a Service Application and Service Principal, using it can access Azure API without needing user interactive login.

I recommend to use Azure CLI to create your Service Application and Service Principal since I feel it quite convenient to use.

Why we need it? “One does not want to login interactively all the time. Azure provides service principal authentication as a secure way for silent login.”

First please read the document to know what’s Service Application by this link https://azure.microsoft.com/en-us/documentation/articles/active-directory-application-objects/.

How to create? In github, here is the document, https://github.com/Azure/azure-sdk-for-node/blob/master/Documentation/Authentication.md.

What’s different is that azure may did some updates. The command provided by the document may not execute right. In old document, application and service principle can be created together, but in my Azure version(0.9.9), it must created by two commands. The process is the same as in the above github link. After setting right, you can login in with the create Service Principle.

You can use ms-rest-azureAPI to access the resources.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值