Skip to content

Instantly share code, notes, and snippets.

@itaysk
Created April 10, 2016 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itaysk/487a41faedd90157e39855be1e4d89dc to your computer and use it in GitHub Desktop.
Save itaysk/487a41faedd90157e39855be1e4d89dc to your computer and use it in GitHub Desktop.
Add a Virtual Application to Azure Web App via PowerShell
$webAppProperties = (Get-AzureRmResource -ResourceGroupName $name -ResourceType Microsoft.Web/sites/config -ResourceName "$(WebAppName)/web" -ApiVersion 2015-08-01).Properties
$webAppProperties.VirtualApplications += [pscustomobject]@{VirtualPath="/$($VirtualPath)"; PhysicalPath="$PhisicalPath"; PreloadEnabled="False"; VirtualDirectories=$null}
#VirtualPath = a the URL path to create. PhisicalPath = a folder in the server to map to, relative to "Home" directory (to create an app parallel to wwwroot, physicalPath should be like "site\newVA")
Set-AzureRmResource -ResourceGroupName $RGname -ResourceType Microsoft.Web/sites/config -ResourceName "$(WebAppName)/web" -ApiVersion 2015-08-01 -Properties $webAppProperties -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment