Reputation: 11
I have deployed my project to Azure Cloud Service but additionally i must install Application Request Routing (ARR).
peace of .ps1 PowerShell command:
if( Get-Service was ) {
Write-Host "Stopping IIS and WAS..."
Stop-Service was -Force
}
$filepath="%temp%\arr.msi"
$process = (Start-Process -FilePath msiexec -ArgumentList /i, $filepath, /qn -Wait).ExitCode
Write-Host $process
if( Get-Service was ) {
Start-Service was,w3svc -Verbose
}
output:
Downloading MSI packages... Downloading MSI package: D:\Users\BUTTER~1\AppData\Local\Temp\2\arr.msi Downloaded... Done. Performing installation... Stopping IIS and WAS... 1619 Done VERBOSE: Performing operation "Start-Service" on Target "World Wide Web Publishing Service (w3svc)". VERBOSE: Performing operation "Start-Service" on Target "Windows Process Activation Service (was)".
there is no error but it doesn't install ARR. can anyone help?
Upvotes: 0
Views: 2169
Reputation: 5917
I couldn't find a good way of doing this directly through PowerShell. If you don't mind using Chocolatey you can do it all from the Web Platform Installer Command Line (WebPICMD), example:
#Download and install Chocolatey and through Chocolatey install WebPICMD
iex ((new-object net.webclient).DownloadString("https://chocolatey.org/install.ps1"))
cinst webpicommandline
#Install Url Rewrite and ARR
$webPiProducts = @('UrlRewrite2', 'ARRv3_0')
WebPICMD /Install /Products:"$($webPiProducts -join ',')" /AcceptEULA
More info about WebPICMD here: http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release
Inspiration for Chocolatey came from this blog post: http://www.tugberkugurlu.com/archive/script-out-everything-initialize-your-windows-azure-vm-for-your-web-server-with-iis-web-deploy-and-other-stuff
Upvotes: 5