I have:
- A V1 VNet (classic) named VNET_DEV01_CLASSIC2.
- I have also a PowerShell Script that creates a WebApp (AppService) using ARM templates (Here you can see template).
The new WebApp is created ok but then I need to manually connect it to V1 VNet
After connecting it, it works perfectly.
How can automate this? So far I tried two approaches unsucessfully:
1) Updating ARM template to create it with the connection. I saw all the azure-quickstart-templates but did not found any WebApp that connect to VNet. I tried also to use Resource Explorer and deduct how would be the template resource, but unsuccessfully.
2) After creating it, add some PowerShell commands to connect it to V1 VNet I cannot find any article to do it. Here there is a comment from Ahmed IG that asks for the same and answered by compy@MSFT but the answer is not public...
I tried also to use Resource Explorer and follow PowerShell example but doesn't work. The error I am having is:
New-AzureRmResource : The pipeline has been stopped. At D:\cad\antstream\azure-devops\AzureManagementScripts\as-cms\kk.ps1:14 char:1 + New-AzureRmResource -ResourceName as-cms-dev01 -Location $ResourceLoc ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureRmResource], PipelineStoppedException + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet New-AzureRmResource : {"Message":"The requested resource does not support http method 'PUT'."} At D:\cad\antstream\azure-devops\AzureManagementScripts\as-cms\kk.ps1:14 char:1 + New-AzureRmResource -ResourceName as-cms-dev01 -Location $ResourceLoc ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureRmResource], ErrorResponseMessageException + FullyQualifiedErrorId : MethodNotAllowed,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet
So my question is How can automate this?