02/26/2021, 11:30 AM
Hi, we have an issue with Event Grid (using Pulumi Azure nextgen) and topic subscriptions. Is there a way to conditionally test whether a given function (our event grid listener) is deployed before creating the subscription. Our code that create the subscription is here, and it fails due to the fact that the actual function is deployed in our Azure Devops CI/CD pipeline after running Pulumi up on a microservice
var viewUpdatesSubscription = new EventSubscription("viewUpdatesSubscription", new EventSubscriptionArgs
    Destination = new AzureFunctionEventSubscriptionDestinationArgs()
        EndpointType = EndpointType.AzureFunction.ToString(),
        MaxEventsPerBatch = 1,
        ResourceId =
                id => $"{id}/functions/ViewUpdatesTopicSubscriber"),
    EventSubscriptionName = coreRandomSuffix.Apply(random => $"view-updates-subscription-{random}"),
    Scope = viewUpdatesTopicId, // eventSubscriptionScope,
Any thoughts or ideas?