Last active
November 6, 2017 16:22
-
-
Save GeorgDangl/e3e7e0462e82e09abed40bf0d8d8aacb to your computer and use it in GitHub Desktop.
Azure Functions deployment for CI environments via WebDeploy / MSDeploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[string]$deployUsername, | |
[string]$deployPassword | |
) | |
$VisualStudioVersion = "15.0" # 15 == VS 2017 | |
$msDeployPath = "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" | |
$MsBuildPath = $(Get-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7").$VisualStudioVersion + "MSBuild\15.0\Bin\MSBuild.exe" | |
$sourcePath = "'$PSScriptRoot/src/<ProjectFolder>/bin/Release/net461'" | |
& dotnet restore | |
& $MsBuildPath "$PSScriptRoot/src/<ProjectFolder>" /p:Configuration=Release | |
$msDeployPath = "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" | |
$sourcePathArg = "-source:contentPath='$PSScriptRoot/src/<ProjectFolder>/bin/Release/<net461>'" | |
$authArg = "username='$deployUsername',password='$deployPassword',authType='basic'" | |
$destArg = "-dest:contentPath='<FunctionName>',computername='https://<FunctionName>.scm.azurewebsites.net:443/msdeploy.axd?site=<FunctionName>',$authArg" | |
& $msDeployPath -verb:sync $sourcePathArg $destArg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment