Azure ARM templates - using the output of other deployments

后端 未结 3 866
忘掉有多难
忘掉有多难 2021-01-03 12:13

What I am interested in is reading the output parameters of another deployment in a different resource group. My ARM templates are something like:

  1. platform.jso
3条回答
  •  梦谈多话
    2021-01-03 12:55

    How are you doing your deployments? In PowerShell you can do something like:

    (Get-AzureResourceGroupDeployment NameOfResourceGroup).Outputs.NameOfOuputProperty.Value
    

    And that will give you the output of the most recent deployment. You can also throw the entire deployment object into a var and have at it that way.

    $d = Get-AzureResourceGroupDeployment NameOfResourceGroup
    

    Which would be faster if you needed a many output properties.

    That help?

    Update for AzureRM cmdlet

    The syntax is largely the same:

    (Get-AzureRmResourceGroupDeployment -ResourceGroupName NameOfResourceGroup -Name NameOfDeployment).Outputs.NameOfOutputProperty.value
    

    If you have multiple deployments you can use:

    Get-AzureRmResourceGroupDeployment -ResourceGroupName NameOfResourceGroup 
    

    To see them all and see what the names are...

提交回复
热议问题