Created
March 9, 2017 21:12
-
-
Save IlyaFinkelshteyn/fcbe7e1a3fe0f601944f1cf87c449be5 to your computer and use it in GitHub Desktop.
This file contains 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
$env:AzureDeploymentUsername = "<deployment_credentials_username>" | |
$env:AzureDeploymentPassword = "deployment_credentials_password" | |
$env:AzureWebsiteName = "<your_site_name>" | |
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $env:AzureDeploymentUsername,$env:AzureDeploymentPassword))) | |
$apiUrl = "https://$env:AzureWebsiteName.scm.azurewebsites.net/api/command" | |
$body = @{ | |
command="npm install" | |
dir="site" | |
} | |
$headers = @{ | |
"Authorization" = ("Basic {0}" -f $base64AuthInfo) | |
"ContentType" = "application/json" | |
} | |
Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Method POST -ContentType "application/json" -Body (ConvertTo-Json $body) | fl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment