简体   繁体   English

如何使用PowerShell Azure cmdlet登录到我的Azure订阅并使用`Get-AzureRmResource`

[英]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.

相关问题 .NET SDK for Azure 中 Get-AzureRmResource 的 C# 等效项是什么? - What is the C# equivalent of Get-AzureRmResource in .NET SDK for Azure? 在CI服务器上使用Azure Powershell cmdlet - Use Azure powershell cmdlets on CI server 如何强制Powershell使用新的Azure订阅 - How to forcing Powershell to use new Azure Subscription Get-AzureRmResource返回不同​​的数据,具体取决于调用方式 - Get-AzureRmResource returns different data depending on how it was called 如何针对 Azure DevOps 存储库中的特定分支使用 Azure Powershell Datafactory cmdlet? - How to use Azure Powershell Datafactory cmdlets against specific branches in Azure DevOps repositories? 在 AzureRM 中将 Find-AzureRmResource 替换为 Get-AzureRmResource 以标记资源 - Replace Find-AzureRmResource with Get-AzureRmResource in AzureRM for Tagging Resources Azure Powershell cmdlet失败 - Azure Powershell cmdlets fails 调用 Azure Powershell cmdlet 时出现“未在上下文中找到订阅”错误 - "No subscription found in the context" error when invoking Azure Powershell cmdlets 如何在Pester中模拟Azure PowerShell Cmdlet? - How to mock Azure PowerShell Cmdlets in Pester? 如何使用 PowerShell 获取 Azure 订阅的 TAG 值 - How to get TAG value for Azure Subscription with PowerShell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM