Created
November 9, 2018 11:54
-
-
Save gethari/ec05d607f020b0fe84563e6eca1fc750 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
$creds = Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Web/sites/config -ResourceName $functionAppName/publishingcredentials -Action list -ApiVersion 2015-08-01 -Force | |
$username = $creds.Properties.PublishingUserName | |
$password = $creds.Properties.PublishingPassword | |
$filePath = ".\MIUGDemo.zip" | |
$apiUrl = "https://" + $functionAppName + ".scm.azurewebsites.net/api/zipdeploy" | |
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username, $password))) | |
$userAgent = "powershell/1.0" | |
Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization = ("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method POST -InFile $filePath -ContentType "multipart/form-data" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment