When you created the logic app with "When a HTTP request is received" trigger, it will generate a url for request like https://prod-04.eastasia.logic.azure.com:443/workflows/830xxxxxxxxa5ebb/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=l5xxxxxxxxxxzMRM
. The url is protected with SAS token, the SAS token follows the base url in querystring. When you request in postman, it will fill the querystring in "Params" like below screenshot:
But when you request the url in powershell, you specify the header with Authorization="None"
, the request method will assume that you don't use any authentication and it is conflict with SAS token. So it shows the error message The request has both SAS authentication scheme and 'None' authorization scheme
which you provided.
To solve this problem, you just need to request the url without -Header
.
Invoke-RestMethod -Method Post -Uri $supportAreaUri -ContentType application/json -Body $body
By the way: When you request the url without -Header
, it may show this error message You do not have permissions to perform action 'run' on scope '/triggers/manual/paths/'
. It was caused by the line $supportAreaUri = [uri]::EscapeUriString($supportAreaUri)
. Actually, you do not need to do escapeUriString, so just remove this line and request again.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…