Guest User

Untitled

a guest
Oct 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function RunCommand($dir,$command,$resourceGroupName, $webAppName, $slotName = $null){
  2. $kuduApiAuthorisationToken = Get-KuduApiAuthorisationHeaderValue $resourceGroupName $webAppName $slotName
  3. $kuduApiUrl="https://$webAppName.scm.azurewebsites.net/api/command"
  4. $Body =
  5. @{
  6. "command"=$command;
  7. "dir"=$dir
  8. }
  9. $bodyContent=@($Body) | ConvertTo-Json
  10. Write-Host $bodyContent
  11. Invoke-RestMethod -Uri $kuduApiUrl `
  12. -Headers @{"Authorization"=$kuduApiAuthorisationToken;"If-Match"="*"} `
  13. -Method POST -ContentType "application/json" -Body $bodyContent
  14. }
  15.  
  16.  
  17. RunCommand "sitewwwrootbinapache-tomcat-8.0.33webapps" "copy xx.war ..xx.war /y" "[resource group]" "[web app]"
Add Comment
Please, Sign In to add comment