综合技术

Setup PowerShell Azure Authentication for Pulumi

微信扫一扫,分享到朋友圈

Setup PowerShell Azure Authentication for Pulumi
0 0

Create an Azure service principal with Azure CLI

This can be done using the Azure CLI or the Azure Portal. Here is the “How To” Azure documentation

Setup the Environment Variables

Once created, you need to set up these PowerShell environment variables. I place these in my PowerShell $Profile
.

$env:ARM_CLIENT_ID       = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
$env:ARM_CLIENT_SECRET   = "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"
$env:ARM_TENANT_ID       = "ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ"
$env:ARM_SUBSCRIPTION_ID = "SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS"

You can use the same values in Pulumi configuration variables
, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access.

$ pulumi config set azure:clientId "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
$ pulumi config set azure:clientSecret "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY" --secret
$ pulumi config set azure:tenantId "ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ"

This eliminates having to do az login
, which expires.

感谢您的支持!

    Léon Bottou and Olivier Bousquet win Test of Time award

    上一篇

    中国银行业和银行法发展40年的本土经验

    下一篇

    您也可能喜欢

    评论已经被关闭。

    插入图片

    热门分类