How to check the existence of context.Subscription.Name ?
Spai
71
Reputation points
Hi, we want to log subscriber for API use so context.Subscription.Name
is used in log-to-eventhub
policy. Everything works well when API subscription is enabled.
But sometimes for quick testing purpose, the subscription of API would be disabled, then the policy would fail due to Object reference not set to an instance of an object
for missing context.Subscription.Name
.
Is there a way to bypass this ? we hope the outcome like this IIf(context.Subscription.Name,context.Subscription.Name,"")
, not sure if there's any equivalent syntax for policy like this ?
Thank you
Sign in to answer