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

Use $WebhookURI as the return value #683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ if ($WorkspaceName) {
Write-Output "Log Analytics Primary Key: $LogAnalyticsPrimaryKey"
}

Write-Output "Webhook URI variable: $($WebhookURIAutoVar | Format-List -Force | Out-String)"
Write-Output "Webhook URI variable (value will be blank): $($WebhookURIAutoVar | Format-List -Force | Out-String)"

if ($WebhookURI) {
Write-Warning "Make sure to keep a record of the following Webhook URI because you'll use it as a parameter when you set up the execution schedule for the Azure Logic App. The URI is also stored as encrypted in the above Automation Account variable. To retrieve the value, see https://docs.microsoft.com/en-us/azure/automation/shared-resources/variables?tabs=azure-powershell#powershell-cmdlets-to-access-variables"
Expand All @@ -322,3 +322,5 @@ if ($WebhookURI) {
else {
Write-Warning "A Webhook URI has already been generated for this Automation account. Please use the existing Webhook URI to setup the execution schedule for the Azure Logic App. The URI is also stored as encrypted in the above Automation Account variable. To retrieve the value, see https://docs.microsoft.com/en-us/azure/automation/shared-resources/variables?tabs=azure-powershell#powershell-cmdlets-to-access-variables"
}

return $WebhookURI
Copy link
Member

Choose a reason for hiding this comment

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

@SvenAelterman This may not work as intended by the caller because there are other things that this function outputs using Write-Output which would also get returned to the caller of the this function.

Copy link
Author

Choose a reason for hiding this comment

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

You're correct, I realized that after submitting the PR. I'll see about an alternate solution.