简体   繁体   English

VSTS Azure Web部署不同的文件夹

[英]VSTS Azure web deployment different folder

I am using VSTS and there is my repository with my Laravel web application. 我正在使用VSTS,Laravel Web应用程序中有我的存储库。 So I want to deploy my application to wwwroot but the "physical path relative to site root" must be set to "site\\wwwroot\\public" because my view is in the public directory. 因此,我想将我的应用程序部署到wwwroot,但是“视图相对于站点根的物理路径”必须设置为“ site \\ wwwroot \\ public”,因为我的视图位于公共目录中。

I thought that everything was working finde till I did my second deployment and the files where now deployed to "site\\wwwroot\\public" so that my view now had to be "site\\wwwroot\\public\\public". 我以为一切正常,直到我进行第二次部署,然后将文件部署到“ site \\ wwwroot \\ public”,因此我的视图现在必须为“ site \\ wwwroot \\ public \\ public”。

Now I am looking for a way to specify a different deployment directory than the view directory. 现在,我正在寻找一种指定与视图目录不同的部署目录的方法。 This is what my settings currently look like: settings image 这是我当前的设置设置图片

If my understanding is right, you could use Azure Power Shell to append a new virtual application to the existing ones. 如果我的理解正确,则可以使用Azure Power Shell将新的虚拟应用程序追加到现有的虚拟应用程序。 Use following code. 使用以下代码。

# Example call: SetWebAppConfig MyResourceGroup MySite $ConfigObject
# https://github.com/davidebbo/AzureWebsitesSamples/blob/b2a3d67a90b7b2d673d68dab553f82e015333d10/PowerShell/HelperFunctions.ps1#L84-L87
Function SetWebAppConfig($ResourceGroupName, $SiteName, $ConfigObject)
{
    $WebAppApiVersion = "2015-08-01"
    Set-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/Config -Name $SiteName/web -PropertyObject $ConfigObject -ApiVersion $WebAppApiVersion -Force
}

Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionId $subscriptionId

$website = Get-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $websiteName
$virtualApplications = $website.SiteConfig.VirtualApplications

$hash = New-Object System.Collections.ArrayList

for ($j = 0; $j -lt $virtualApplications.count; $j++) {
    $entry = @{ virtualPath = $virtualApplications[$j].VirtualPath; physicalPath = $virtualApplications[$j].PhysicalPath }
    $hash.add($entry)
}
$newEntry = @{ virtualPath = "/$siteName"; physicalPath = "site\$siteName" }
$hash.add($newEntry)


$hashProps.VirtualApplications
$virtualApps = $website.SiteConfig.VirtualApplications.Add(@{ virtualPath = "/$siteName"; physicalPath = "site\$siteName" })
$props=@{
    virtualApplications = $hash.ToArray()
}

SetWebAppConfig $resourceGroupName $websiteName $props

Please refer to the similar question . 请参考类似的问题

Note: In VSTS, you could create a Azure Power Shell task. 注意:在VSTS中,您可以创建一个Azure Power Shell任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM