Getting the vnet-subnet-id of vnet integrated functionapp/webapp

Dushyant Priyadarshee 121 Reputation points
2020-11-11T15:34:39.65+00:00

What is the best means to programmatically get the vnet-subnet-id that a functionapp is vnet integrated onto?

For example:
Say we have vnet integrated functionapp:
39141-image.png

Trying to get vnetName via Resource Graph Explorer returns null. Which I think is wrong? This is the SiteConfig.VnetName which should be giving the vnet subnet id?
39151-image.png

Also, Azure resource explorer shows that vnet is linked to the app service plan (serverfarmId) and not the functionapp.
39019-image.png

I think the resource graph vnetName should be set?
The resource explorer should show the functionApp?

Apologies for the long description.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,119 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,090 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,689 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 67,691 Reputation points
    2020-11-12T12:28:22.707+00:00

    Hi @rubberduckdev

    Thanks for describing the issue clearly. I do see the same observation when using the Web Apps Get API. I believe graph explorer also display the same data. I do see that all fields inside the siteConfig are coming as null. I will reach out to my team to confirm if this is expected behaviour or not.

    If you want to programmatically get the vnet-subnet-id that I would suggest you to leverage this API. Please let me know if this API response helps you.

    API Response:

    {  
      "id": "/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork",  
      "name": "virtualNetwork",  
      "type": "Microsoft.Web/sites/config",  
      "location": "Location",  
      "properties": {  
        "subnetResourceId": "/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Network/virtualNetworks/{vnetname}/subnets/{subnetname}",  
        "swiftSupported": true  
      }  
    }  
    

0 additional answers

Sort by: Most helpful