Azure Application Gateway: Subnet must only have application gateway - azure

I'm facing an error - "Subnet must only have application gateway" while creating an Application Gateway for in my azure network.
I'm following the steps from thid document: https://learn.microsoft.com/en-us/azure/application-gateway/create-url-route-portal
Tried to look around but could not find any solution.

Tested in my environment working fine for me , You need to create a seperate subnet for application gateway. you cannot use the subnet that is accomplished with other resources. Like wise you can see in below i selected AzureBastionSubnet ie already using with bastion.
Once i created seperate subnet for AppGtw it is working fine.
Note : If you are using the subnet that is already accomplished with other reources for that subnet you need to Select NSG None.

Related

Connecting AKS and Web App with VNet integration

I'm trying to connect my Web App to the AKS LoadBalancer through the VNet integration instead of a public load balancer.
The problem here is to integrate VNet into the web app, the VNet needs to have a subnet delegated to Microsoft.Web/serverFarms. On the other hand, AKS cannot be assigned with a subnet that has a delegation.
I have found this that seemingly has done the exact same thing but it seems to be old as I cannot reproduce the same result. Either I get
VNET aks-subnet is missing a delegation to Microsoft.Web/serverFarms. Please add the delegation and try again. or aks-subnet cannot be used as it's a delegated subnet
I have tried to add two subnets one with delegation to managedClusters and use that for my AKS but the same ... cannot be used as it's a delegated subnet happens.
sidenote: I'm using the bicep script to deploy.
VNET Integration requires a dedicated subnet for the App Service that is going to be integrated. This means the subnet cannot be used for any other purpose, i.E. hosting AKS or VMs.
The App Service can then reach services in other subnets on the same VNET or in peered VNETs.
Subnet Size Requirements are a minimum of /27 and Microsoft recommends /26 for production grade environments.
It is sometimes a little tricky to troubleshoot issues with VNET integration, some good hints are documented here.

How to work around issue with Private endpoint on a subnet with a delegation?

I am trying to add a private endpoint in azure for a azure function app. So even using the panel.azure.com I get information that its subnet is using delegate serverfarms. When I remove the delegate and redeploy the VN, I cannot deploy the function as its literally telling me that I should set serverfarms delegation on that function's subnet. How to avoid this issue or how to fix it? I am not sure how to diagnose what is the serverfarms needed for, other than that azure tells me that I need to set that property. My underlying question would be what is the root cause why the function app requires serverfarms delegation in the subnet before deploying?
why the function app requires serverfarms delegation in the subnet before deploying?
An Azure Service with subnet delegation may establish some pre or post deployment conditions, such as:
deploy the service in a shared versus dedicated subnet.
add to the service a set of Network Intent Policies post deployment that is required for the service to work properly.
The azure function will have some impact when using the subnet delegation like:
supports NSG association
dictates the minimum number of IP Addresses in the delegated subnet
helps injected services to better integrate with the virtual network by defining their pre-conditions of deployments in the form of Network Intent Policies.
To remove subnet delegation from an Azure service
In the portal's search bar, enter myVirtualNetwork. When myVirtualNetwork appears in the search results, select it.
Select Subnets, under SETTINGS, and then select mySubnet.
In mySubnet page, for the Subnet delegation list, select None from the services listed under Delegate subnet to a service.
Please refer why azure service requires subnet delegation during deployment conditions and how to fix this subnet delegation using portal as well as CLI.
Updated Answer
Some properties will be defined like computeMode, sku object description by serverfarm based on the hosting plan, the azure resources (function or web app, etc) were deployed.
If they're incorrect or the any mismatch in deployed locations of resources found, then few errors occurs like server farm is not found, or required or related to server farm.
Please see this SO Thread 1 and Thread 2 where few users have got the problems if server farm defined properties are mismatched.
And This Microsoft documentation tells what is the server farm, what kind of resources are belongs to server farm type and sample bicep/json template code for each hosting plan contains the properties defined by server farm to azure functions especially.

Unable to delete subnet and virtual network in azure

I am just practicing the azure. And I created a virtual network and subnets.
Now I am not able to delete the subnet. I have disconnected all connected devices from the virtual network.
Here is the error getting while deleting subnet
Please help me to clean up the subnet and virtual network.
Thanks
Additional details
All resources in my account
And here is the subnets tab and error getting while deletion:
Subnet configuration:
As the error shows the subnet PrivateSubnet should be in use. And you can see it's delegated to the service Microsoft.Web/serverfarms. So you need to remove the delegated service first. Do it follow the steps here. When the delegated service list is empty, then you can delete the subnet as you want.
Update:
According to my experience, your subnet is in use network/PrivateSubnet/AppLink, it means there is a Web App integrate with your subnet at least. And I didn't see the Web App in your resource group. So I guess there someone else uses your subnet and his Web App still exists. You need to check it yourself.

Azure container services and Application gateway

I connected an Application Gateway as a frontend for the services in the kubernetes cluster. I created a subnet on the k8s-vnet-<id> with address space 10.0.0.0/29 and connected the Application Gateway to that subnet.
I followed instrucions from https://fizzylogic.nl/2017/06/16/how-to-connect-azure-api-management-to-your-kubernetes-cluster/
When I try to scale the ContainerServices I get the following error:
Operation name: Write VirtualNetworks
Error code: InUseSubnetCannotBeDeleted
Message:
Subnet api-gateway-subnet is in use by /subscriptions/cdf495e8-6232-4a61-a661-716fec93f8b5/resourceGroups/KuberGoPlay/providers/Microsoft.Network/applicationGateways/ngaz-appgw-play/gatewayIPConfigurations/appGatewayIpConfig and cannot be deleted.
Why is the container service trying to delete the subnet when it scales?
Or am I connecting the Application Gateway the wrong way ?
/Martin
Why is the container service trying to delete the subnet when it
scales?
When we try to scale up or scale down (update a resource) Azure container service, the request is processed by deleting and creating the resource.
You may encounter this error when attempting to update a resource, but
the request is processed by deleting and creating the resource. Make
sure to specify all unchanged values.
More information about InUseSubnetCannotBeDeleted, please refer to that link.
Here a article talk about how to use template to update resource, please refer to it.

Change the Subnet address of an App Service Environment

I have an App Service Environment (ASE) that is all working as expected. Unfortunately I now need to change to IP address range of the ASE, currently it is set as 10.0.0.0/26 and I'd like it to be 10.0.6.0/26. When I try to configure the Subnet associated with the ASE, I get an error saying I can't change it because it is in use.
Is there any way to change the IP Address range of the ASE?
I guess i'll be the bearer of bad news here. The answer is no. You have to delete the ASE and redeploy it to the new subnet.
From the docs:
Before you create your ASE
It is important to be aware of the things you cannot change. Those aspects you cannot change about your ASE after it is created are:
Location
Subscription
Resource Group
VNet used
Subnet used
Subnet size
While at it, you probably want to deploy an ASEv2 instead.

Resources