BelowZero
BelowZero

Reputation: 1373

How to assign a static public IP to Azure Function

I want to call an HTTP trigger of an Azure function by sending a post request to a static IP. This restriction comes from the fact that I bought a tracker where I can only set an IP and nothing else. It sends http POST requests to the given IP with a bytestream as load every five minutes.

I tried to configure an Azure Gateway and I also tried with an Azure Webapp. I assume it is possible with both but I don't know how and I am clicking everywhere in the Azure UI without success. I was wondering if I am missing a straight forward way to do it. I hope it is not to vague of a question.

Upvotes: 2

Views: 8440

Answers (2)

ccoutinho
ccoutinho

Reputation: 4566

If the Function App is (or can be) integrated with a Virtual Network, all you would need to do is:

  • Provision Public IP address
  • Provision NAT Gateway
  • Associated the NAT Gateway with the IP address previously deployed
  • Associate the NAT Gateway with the same subnet used to integrate the Function App with the Virtual Network

After that, all outbound requests originating from the Function App will have the same static Public IP address

Upvotes: 0

Andriy Bilous
Andriy Bilous

Reputation: 2522

Deploying an Azure function in an App Service Environment is currently the only way to have a static inbound and outbound IP for your function.

https://learn.microsoft.com/en-us/azure/azure-functions/functions-networking-faq#how-do-i-set-a-static-ip-in-functions

https://learn.microsoft.com/en-us/azure/azure-functions/ip-addresses#dedicated-ip-addresses

Yes, the Application Gateway v2 SKU supports static public IP addresses.

https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-faq#does-application-gateway-support-static-ip

You can choose Application Gateway Dynamic or Static IP during the resource creation. enter image description here https://learn.microsoft.com/en-us/azure/application-gateway/quick-create-portal

Upvotes: 3

Related Questions