I have integrated Send grid with the Azure AD B2C using Custom policies for sending the OTP codes. https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-email-sendgrid?pivots=b2c-custom-policy#create-azure-ad-b2c-policy-key
The send grid is enabled with the IP whitelisting, So I am getting the error "The requestor's IP Address is not whitelisted" while sending OTP from AD B2C.
Logs from App Insights
outerMessage
Exception Message:Original Exception type:HttpResponseException, responseContent:{"errors":[{"message":"The requestor's IP Address is not whitelisted","field":null,"help":null}]}, Exception Type:PolicyException, CorrelationID:xxxxxxx
details
[{"outerId":"0","message":"Exception Message:Original Exception type:HttpResponseException, responseContent:{\"errors\":[{\"message\":\"The requestor's IP Address is not whitelisted\",\"field\":null,\"help\":null}]}, Exception Type:PolicyException, CorrelationID:xxxxx","type":"System.Exception","id":"42573161"}]
Now I need to whitelist the IP address of AD B2C tenant, Please share how to get the IP address range of the AD B2C Tenant.
Looks like you can download Azure IP ranges right here.