简体   繁体   English

使用 Azure CLI/Powershell 获取逻辑应用的托管标识 ObjectID

[英]Get Managed Identity ObjectID of Logic App using Azure CLI/Powershell

I have a logic App with Managed Identity enabled.我有一个启用了托管标识的逻辑应用程序。 For automation purposes, I need to use either Azure CLI or Powershell to grab the objectID of the Logic App Managed Identity to grant it access to a keyvault.出于自动化目的,我需要使用 Azure CLI 或 Powershell 来获取逻辑应用托管标识的 objectID,以授予其访问密钥保管库的权限。 I have done the same for Azure Data Factory using a Poweshell command like this:我使用这样的 Poweshell 命令对 Azure 数据工厂做了同样的事情:

 (Get-AzureRMDataFactoryV2 -ResourceGroupName $ResourceGroup -Name $DataFactoryName).Identity

Tried something similar for logic app but it does not return the identity.为逻辑应用尝试了类似的东西,但它没有返回身份。

Looks like the Workflow object returned by Get-AzLogicApp doesn't have the identity property defined.看起来Get-AzLogicApp返回的 Workflow 对象没有定义标识属性。

A workaround would be to use the Get-AzResource cmdlet instead.一种解决方法是改用Get-AzResource cmdlet。

$ID = (Get-AzResource -Name myLogicApp -ResourceType Microsoft.Logic/workflows).Identity.PrincipalId

在此处输入图片说明

根据 Joey Cai 的先前回答,您还可以在 AZ CLI 中执行以下操作:

$ID = az resource show --name "myLogicApp" --resource-group "myResourceGroup" --resource-type "Microsoft.Logic/workflows" --query "identity.principalId" | ConvertFrom-Json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用托管标识从 Azure 逻辑应用到 Azure Function 进行身份验证 - Authenticate from Azure Logic app to Azure Function using Managed Identity 对部署到 Azure 的应用程序使用 Azure 托管标识? - Using Azure Managed Identity for app deployed to Azure? 使用托管标识从逻辑应用调用 Azure AD 保护的 API - Calling an Azure AD Protected API from Logic App using Managed Identity 将 Azure Web 应用程序用于具有托管标识的容器 - Using Azure Web App for Containers with managed identity Azure SDK 使用 CLI 凭据或托管身份 - Azure SDK use CLI Creds or Managed Identity 使用托管标识在 Azure 中进行应用服务到应用服务的身份验证 - App service to app service auth in Azure using Managed Identity 使用托管标识在 python 中使用 azure 函数应用程序 - Stuck with azure function app in python using managed identity 将 Azure 托管标识用于未授权新 SDK 的应用服务 - Using Azure managed identity for App Service not authorising for new SDK 使用托管标识从 Azure 应用服务调用图 - Call Graph from Azure App Service using Managed Identity 使用托管身份从Logic App中通过身份验证调用Azure函数 - Calling an Azure Function with authentication from a Logic App using Managed Identities
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM