简体   繁体   中英

How can i install ARR on azure VM via PowerShell?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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