2

Estoy tratando de replicar un ejemplo el cual encontré para conocer un poco el funcionaminto de azure. Pero creo que tengo un inconveniente a la hora de usar variables, para obtener los datos que deben ser recibidos.

El ejemplo es el siguiente: enlace del ejemplo

El codigo que usan en el ejemplo es:

runbook

param (
 [object]$WebhookData
 )

if ($WebhookData -ne $null) 
    {
        $BodyContent = $WebhookData.RequestBody
        Write-Output "There was a tweet from $BodyContent"
    }
else
    {
        Write-Error "Something went wrong buddy"   
    }

webhook

$Credential = Get-Credential

#Authenticate to Azure and AzureRM
Add-AzureAccount -Credential $Credential | Out-Null
Add-AzureRmAccount -Credential $Credential | Out-Null

#Provide the necessary information for your environment
$Webhook = New-AzureRmAutomationWebhook `
 -Name "TriggeredByTwitter"`
 -RunbookName "Hello-Twitter"`
 -IsEnabled 1 `
 -ExpiryTime (Get-Date).AddDays(10)`
 -ResourceGroupName "Automation"`
 -AutomationAccountName "AutomationAccount"

#Print the webhook uri
Write-Host $Webhook.WebhookUri -ForegroundColor Green

imagen webhook

En mi caso utilizo el GUI de azure para crear el webhook, se me hace comodo ya que no conozco prácticamente nada.

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.