Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RunCommand($dir,$command,$resourceGroupName, $webAppName, $slotName = $null){
- $kuduApiAuthorisationToken = Get-KuduApiAuthorisationHeaderValue $resourceGroupName $webAppName $slotName
- $kuduApiUrl="https://$webAppName.scm.azurewebsites.net/api/command"
- $Body =
- @{
- "command"=$command;
- "dir"=$dir
- }
- $bodyContent=@($Body) | ConvertTo-Json
- Write-Host $bodyContent
- Invoke-RestMethod -Uri $kuduApiUrl `
- -Headers @{"Authorization"=$kuduApiAuthorisationToken;"If-Match"="*"} `
- -Method POST -ContentType "application/json" -Body $bodyContent
- }
- RunCommand "sitewwwrootbinapache-tomcat-8.0.33webapps" "copy xx.war ..xx.war /y" "[resource group]" "[web app]"
Add Comment
Please, Sign In to add comment