Posted in

App Service Plan (Function App) <--> Virtual Network

Od jakiegoś w Microsoft Azure istnieje możliwość połączenia App Service Plan do Virtual Network. Dzięki powyższej aplikacji możemy w Azure wdrażać aplikacje Webowe, które to działają wewnątrz wdrożonej infrastruktury sieciowej. Wymagania do takowej konfiguracji:
  • W sieci do której chcemy podłączyć App Service Plan musimy mieć wdrożony Virtual network gateway typu Route-based (w moim przypadku SKU VpnGw1) – a więc będzie to nas kosztowało zgodnie z cennikiem;
  • Musimy mieć zdefiniowany Address pool w Point-to-site configuration;
  • Minimalna wielkość App Service Plan to S1 Standard.
Od niedawna Microsoft wprowadził możliwość korzystania z IKEv2 w Point-to-site configuration VPN – jeżeli mamy włączony takowa opcję wówczas nie uda się nam podłączyć takiej sieci do App Service Plan, a jeżeli już się uda uzyskamy błąd:
Failed to add Virtual Network to Web App. Adding network supportexample to web app failed. Gateway did not finish the operation in time
Coprawda – Po chwili będziemy widzieć prawidłową konfigurację, ale przy np. ping’owaniu maszyny wirtualnej z App Service Plan uzyskamy błędy:
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions:
Aby integracja App Service Plan (Function App) i Virtual Network zadziałała, na chwilę przyłączania Virtual Network do App Service Plan należy wyłączyć IKEv2 VPN. Co ciekawe po operacji połączenia możemy tą opcję włączyć i wszystko działa prawidłowo. Wówczas uzyskami odpowiedzi jak poniżej:
D:homesitewwwroot>tcpping 10.0.0.4:22 Connected to 10.0.0.4:22, time taken: 265ms Connected to 10.0.0.4:22, time taken: <1ms Connected to 10.0.0.4:22, time taken: <1ms Connected to 10.0.0.4:22, time taken: <1ms Complete: 4/4 successfull attempts (100%). Average success time: 66.25ms
  For some time ago you can connect the App Service Plan to the Virtual Network. Using this feature Web Applications in Azure can operate within theclosed network infrastructure. Requirements for this configuration:
  • In the network where you want to connect the App Service Plan, we must have implemented a Route-based Virtual network gateway (in my case SKU VpnGw1) – so it will cost us according to the price list;
  • We must have an Address pool defined in Point-to-site configuration;
  • The minimal size of the App Service Plan is S1 Standard.
Recently, Microsoft introduced the possibility of using IKEv2 in Point-to-site configuration VPN – if we have this option enabled then we will not be able to connect such a network to the App Service Plan, and even we succeed, we will get an error:
Failed to add Virtual Network to Web App. Adding network supportexample to web app failed. Gateway did not finish the operation in time
  After a while we will see the correct configuration, but for example when pinging a virtual machine from the App Service Plan we get errors:
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions:
For the integration of the App Service Plan (Virtual App) and Virtual Network to work, you need to disable IKEv2 VPN when you connect the Virtual Network to the App Service Plan. after the connection operation, we can enable this option and everything works properly. Then you will get the answers as below:
D:homesitewwwroot>tcpping 10.0.0.4:22 Connected to 10.0.0.4:22, time taken: 265ms Connected to 10.0.0.4:22, time taken: <1ms Connected to 10.0.0.4:22, time taken: <1ms Connected to 10.0.0.4:22, time taken: <1ms Complete: 4/4 successfull attempts (100%). Average success time: 66.25ms
 

Microsoft Certified Trainer, Office 365, AWS, Azure and Cloud Expert-Architect. In the IT world for over than 20 years.

Apart from the main area of Microsoft Azure expert in the field of infrastructure servers Windows Server 2003-2019, Microsoft Active Directory, Hyper-V Private Cloud, IIS, System Center, SQL.

Private Cloud, System Center, Hyper-V, Open Stack Expert and all Microsoft products Expert. Linux Server administrator.

My Azure community projects:

https://mazeball.azurewebsites.net/
https://github.com/MariuszFerdyn?tab=repositories

More