How to retrieve output data after the deployment

LXF 205 Reputation points
2024-07-09T02:00:48.7+00:00

Hello there,

I am wondering if there's a straightforward method to retrieve the output results after a deployment is completed.

By 'straightforward,' I mean configuring a specific API-link during the deployment to which the output data, along with its deployment ID, resource group/tenant ID, and other relevant details, would automatically be sent.

I ask because the method mentioned below requires me to log in as a precondition. When there are multiple different tenants using the same template (our solution offered, ex: DCR and DCE) for deployment, it's impractical to log in manually each time.

--- --- --- ref below --- ---

Ref: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/linked-templates?tabs=azure-powershell#get-values-from-linked-template

and the below PS measure:

User's image

Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
1,146 questions
{count} votes

Accepted answer
  1. Givary-MSFT 32,751 Reputation points Microsoft Employee
    2024-07-12T06:30:07.6666667+00:00

    @LXF Below approach has been recommended by our internal AI tool (need to verify before this is implemented),

    There are several ways to retrieve the output values from an ARM template deployment without logging into the Azure tenant. Here are a few options:

    Use the Azure REST API: You can use the Azure REST API to retrieve the output values from the deployment. You will need to authenticate to the API using a service principal or managed identity, but you will not need to log into the Azure tenant. You can use the az rest command in the Azure CLI or send HTTP requests directly to the API.

    Use the Azure PowerShell module: You can use the Azure PowerShell module to retrieve the output values from the deployment. You will need to authenticate to Azure using a service principal or managed identity, but you will not need to log into the Azure tenant. You can use the Get-AzResourceGroupDeployment cmdlet to retrieve the output values.

    Use the Azure CLI: You can use the Azure CLI to retrieve the output values from the deployment. You will need to authenticate to Azure using a service principal or managed identity, but you will not need to log into the Azure tenant. You can use the az deployment show command to retrieve the output values.

    Please note that in order to use any of these methods, you will need to have the appropriate permissions to access the deployment and retrieve the output values. You will also need to authenticate to Azure using a service principal or managed identity, which requires some setup and configuration.

    Note: AI suggestion, need to verify/validate before.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.