@Joao Claudio Paco Thanks for reaching out. Based on the information provided I assume you were getting 502 Bad Gateway error when creating azure function. This could be due to service interruption or performance degradation. You can track the health of the service on the Azure Portal. For more information, see Track service health.
I would suggest you try to create functions in other regions and check if you are still facing the issue.