paolosalvatori / handle-private-endopints-events-with-event-grid

This sample demonstrates how to handle Azure Private Endpoints provisioning and deprovisioning events with Azure Event Grid
6 stars 0 forks source link

Event GRID deployment issue #1

Closed dinfreeman closed 3 years ago

dinfreeman commented 3 years ago

Hi Paolo, I successfully deployed the function App. But when i tried to deploy the event grid (create-azure-function-subscription.sh), i got a error. Let me know you thoughts if any ? Fred

PS /home/frederic> bash create-azure-function-subscription-custom.sh Checking if [sbxfunctionappstore] storage account actually exists... [sbxfunctionappstore] storage account already exists Retrieving the connection string for [sbxfunctionappstore] storage account... The connection string for [sbxfunctionappstore] storage account is [DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=sbxfunctionappstore;AccountKey=tLXW4VGQlhSvC7834CIvFiBM8cwDMMFAs7LmEvEFSPeUHdeBTQe63w1NA4AEqYSrcdoXDK8ZYN2y40WHF6TMDg==] Checking if [deadletter] container already exists... A container called [deadletter] already exists in [sbxfunctionappstore] storage account Retrieving the resource id for [sbxfunctionappstore] storage account... Resource id for [sbxfunctionappstore] storage account successfully retrieved: [/subscriptions/662343d1-9f34-422b-ae13-2c1e0bada88d/resourceGroups/PrivateEndpointEventGridFunctionApp/providers/Microsoft.Storage/storageAccounts/sbxfunctionappstore] Retrieving username from [sbxPrivateEndpointEventGridFunctionApp] Azure Function publishing profile... [$sbxPrivateEndpointEventGridFunctionApp] username successfully retrieved Retrieving password from [sbxPrivateEndpointEventGridFunctionApp] Azure Function publishing profile... [...] password successfully retrieved Retrieving JWT token from Azure Function \ Kudu Management API... [...] JWT token successfully retrieved Retrieving [eventgrid_extension] key... [] key successfully retrieved

Failed to retrieve []
create-azure-function-subscription-custom.sh: line 160: return: can only `return' from a function or sourced script

The endpoint for the [ProcessEvents] function in the [sbxPrivateEndpointEventGridFunctionApp] function app is [https://sbxPrivateEndpointEventGridFunctionApp.azurewebsites.net/runtime/webhooks/eventgrid?functionName=ProcessEvents&code=] No [PrivateEndpointAzureFunctionSubscriber] Event Grid subscription actually exists for [CCE-Azure-ConnectivitySandBox] subscription events Creating [PrivateEndpointAzureFunctionSubscriber] Event Grid subscription for [CCE-Azure-ConnectivitySandBox] subscription events... Webhook URL=[https://sbxPrivateEndpointEventGridFunctionApp.azurewebsites.net/runtime/webhooks/eventgrid?functionName=ProcessEvents&code=] Failed to create [PrivateEndpointAzureFunctionSubscriber] Event Grid subscription in the [CCE-Azure-ConnectivitySandBox] subscription WARNING: If you are creating an event subscription from a topic that has “Azure” as the value for its “kind” property, you must validate your webhook endpoint by following the steps described in https://aka.ms/eg-webhook-endpoint-validation.

ERROR: (Url validation) Webhook validation handshake failed for https://sbxprivateendpointeventgridfunctionapp.azurewebsites.net/runtime/webhooks/eventgrid. Http POST request failed with response code Unknown. For troublehooting, visit https://aka.ms/esvalidation. Activity id:c29b16ab-b23e-45a5-9aaf-80bc95c607a0, timestamp: 6/26/2021 12:19:23 PM (UTC).

paolosalvatori commented 3 years ago

Hi @dinfreeman this solution is an experiment we did before the PrivateDnsZoneGroup child object was fully documented. At that point, we decided to replace this procedure with a deployIfNotExists Azure policy. See https://github.com/paolosalvatori/private-endpoints-topologies for more information. I stopped maintaining this solution because the way to go is using an Azure policy, sorry about that 😢

dinfreeman commented 3 years ago

Hello, thank you for your reply :) You're right. I found the new option to do that using Private DNS zone group + Azure policy. https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/private-link-and-dns-integration-at-scale. I'm on my way to evaluate it. cheers.