Skip to content

azure-arm-template: get CustomScriptExtension output #21

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

Merged
merged 2 commits into from
Jan 15, 2023

Conversation

dennisameling
Copy link
Contributor

@dennisameling dennisameling commented Jan 14, 2023

Used this for inspiration.

@dennisameling
Copy link
Contributor Author

dennisameling commented Jan 14, 2023

I was able to run the ARM template directly against Azure, so that part is working correctly 🎉

Now we only have to make sure that GitHub outputs the logs correctly, but that should be relatively straightforward by doing something like steps.deploy.outputs.customScriptInstanceView. Might have some time tomorrow to look into that.

@dennisameling
Copy link
Contributor Author

dennisameling commented Jan 14, 2023

Ok, let's see if this works (I'll remove the VM right after creation).

@dennisameling
Copy link
Contributor Author

That worked! 🎉

We might want to do some basic JSON parsing though to make things easier to read. Will follow up on that later.

CC @dscho

We want to know the output that the CustomScriptExtension gives us,
so let's output it from the ARM template. That way, we can access
it from the azure/arm-deploy GitHub Action in a follow-up commit.

Signed-off-by: Dennis Ameling <[email protected]>
@dennisameling dennisameling force-pushed the azure-vm-custom-script-extension-output branch from 6f7904c to 0e87a06 Compare January 15, 2023 10:36
Comment on lines +112 to +115
"UriFileNamePieces": "[split(parameters('postDeploymentPsScriptUrl'), '/')]",
"firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]",
"firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]",
"firstFileName": "[variables('firstFileNameBreakString')[0]]",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken directly from the original template we used earlier.

We want to see the output of the CustomScriptExtension in the pipeline,
as it contains helpful info on things like the GfW and GitHub Actions
runner versions that got installed.

Signed-off-by: Dennis Ameling <[email protected]>
@dennisameling dennisameling force-pushed the azure-vm-custom-script-extension-output branch from 0e87a06 to 5e22fa6 Compare January 15, 2023 10:39
@dennisameling dennisameling changed the title [WIP] azure-arm-template: get CustomScriptExtension output azure-arm-template: get CustomScriptExtension output Jan 15, 2023
@dennisameling dennisameling marked this pull request as ready for review January 15, 2023 10:39
@dennisameling
Copy link
Contributor Author

It works!! 🎉

(Have just deleted that VM too)

@dennisameling dennisameling requested a review from dscho January 15, 2023 10:56
@dscho
Copy link
Member

dscho commented Jan 15, 2023

It works!! 🎉

(Have just deleted that VM too)

Exciting! ❤️

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful work, thank you very much!

@dscho dscho merged commit 9c4b31a into main Jan 15, 2023
@dscho dscho deleted the azure-vm-custom-script-extension-output branch January 15, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants