Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDeploymentOutput not working #815

Open
bobbyangers opened this issue Nov 2, 2021 · 3 comments
Open

getDeploymentOutput not working #815

bobbyangers opened this issue Nov 2, 2021 · 3 comments

Comments

@bobbyangers
Copy link

bobbyangers commented Nov 2, 2021

Despite OutputTemplateVariables = true

export async function getDeploymentOutput(armClient: ResourceManagementClient, resourceGroupName: string): Promise<any[]> {
167 >> const deploymentName = results._response.parsedBody[0].name;
}
is getting the last "deployment" instead of looking for the last "full" deployment, ie : DeploymentName = Dtl3p5bv1hko

So it's not getting the correct deployment information.

Finished updating Lab Environment ''.
##[debug]environmentResourceGroupId=/subscriptions/***/resourcegroups/xx-devtest-lab1-rg
##[debug]DeployUtil: Getting deployment output for resource group 'xx-devtest-lab1-rg'.
##[debug]DeployUtil: Completed getting deployment output for resource group 'xx-devtest-lab1-rg'.
##[debug]task result: Succeeded

In my case, my azuredeploy.json contains "sub" deployments, so the "last" deployment is not the main deployment.

Can we fix this to get the correct deployment based on the DeploymentName, not the one in position 0 ?

@leovms
Copy link
Contributor

leovms commented Jan 5, 2022

@bobbyangers, I looked at the code for getDeploymentOutput and, unless I am misreading it, deploymentOutput is an array. It actually enumerates all the different deployment outputs based on the deploymentName. Later in the code, where it is used, it seems to also process a collection and sets the different variables accordingly.

Can you please elaborate so we can have a better understanding of where things may be failing?

@rangers-globecar
Copy link

167 >> const deploymentName = results._response.parsedBody**[0]**.name;

Please look at the line 167, in bold.... it's not looping through anything, it's take the first value.

@leovms
Copy link
Contributor

leovms commented Jan 5, 2022

Ah, I understand what you mean. The expectation is that we traverse through all, not just the first one. Thank you for the clarification. I missed that tidbit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants