plain-eye-9759
04/03/2020, 8:37 AM{
name: "[concat(variables('topicName'), '/Microsoft.EventGrid/', variables('eventGridSubscriptionName'))]",
type: "Microsoft.EventGrid/topics/providers/eventSubscriptions",
location: "[variables('location')]",
apiVersion: "2018-01-01",
properties: {
functionUrl: "[concat('https://', variables('functionAppName'),'.<http://azurewebsites.net/runtime/webhooks/eventgrid?functionName=|azurewebsites.net/runtime/webhooks/eventgrid?functionName=>', variables('functionName'),'&code=')]",
destination: {
endpointType: "WebHook",
properties: {
endpointUrl: "[concat(variables('functionUrl'), listKeys(resourceId('Microsoft.Web/sites/host/', variables('functionAppName'), 'default'),'2016-08-01').systemkeys.eventgrid_extension)]"
}
},
filter: {
includedEventTypes: [
"All"
]
}
},
}
I'm getting this error Encountered an error (ServiceUnavailable) from host runtime.
Looks like an Azure issue actually, but I don't know what the issue is.
Also is there a way to do it directly with Pulumi? @tall-librarian-49374tall-librarian-49374
04/03/2020, 8:39 AMplain-eye-9759
04/03/2020, 8:46 AMwebhookEndpoint: {
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}`;
}),
},
AzureCliCredentials.create();
please?@azure/ms-rest-nodeauth
tall-librarian-49374
04/03/2020, 8:50 AMFunctionApp
you can call functionApp.getHostKeys()
plain-eye-9759
04/03/2020, 8:51 AMError: 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}
functionApp.getHostKeys().apply(keys => keys.systemKeys)
didn't work either. same errortall-librarian-49374
04/03/2020, 9:13 AMplain-eye-9759
04/03/2020, 9:29 AM