This message was deleted.
# azure
s
This message was deleted.
t
p
thanks, I was trying this earlier but not sure how to resolve the webhook endpoint, then I saw a codeblock you posted on Github
Copy code
webhookEndpoint: {
   url: pulumi.all([this.functionApp.id, this.functionApp.defaultHostname]).apply(async ([id, hostname]) => {
   const creds = await AzureCliCredentials.create();
   const client = new AzureServiceClient(creds);
    const url = `<https://management.azure.com>${id}/host/default/listkeys?api-version=2018-02-01`;
    const response = await client.sendRequest({ method: 'POST', url });
    const systemKey = response.parsedBody.systemKeys.eventgrid_extension;
    return `https://${hostname}/runtime/webhooks/eventgrid?functionName=${name}&code=${systemKey}`;
        }),
    },
Whick package contains
AzureCliCredentials.create();
please?
t
I think you don’t have to do tis. If you have a
FunctionApp
you can call
functionApp.getHostKeys()
p
ahh, I found
@azure/ms-rest-nodeauth
checking
Copy code
Error: Failed to retrieve the host keys: {"Code":"BadRequest","Message":"Encountered an error (ServiceUnavailable) from host runtime.","Target":null,"Details":[{"Message":"Encountered an error (ServiceUnavailable) from host runtime."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"Encountered an error (ServiceUnavailable) from host runtime."}}],"Innererror":null}
Didn't work, I also tried
functionApp.getHostKeys().apply(keys => keys.systemKeys)
didn't work either. same error
t
Sounds like a problem on Azure side?
p
looks like that