[英]How to use PowerShell Azure cmdlets to log into my Azure subscription and use `Get-AzureRmResource`
In a PS console I can do the following to get all of the Azure resources for a subscription. 在PS控制台中,我可以执行以下操作以获取预订的所有Azure资源。
Login-AzureRmAccount Get-AzureRmResource
I want to do this in a Azure function, but Login-AzureRmAccount
is an interactive prompt. 我想在Azure函数中执行此操作,但是
Login-AzureRmAccount
是交互式提示。
You will need to log in using a service principal instead of interactive login. 您将需要使用服务主体而不是交互式登录来登录。 See https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authenticate-service-principal for details on setting that up.
有关设置的详细信息,请参见https://docs.microsoft.com/zh-cn/azure/azure-resource-manager/resource-group-authenticate-service-principal 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.