PowerShell cmdlet in an API Management transformation policy #14536
-
One is able to get Cosmosdb data directly from API Management using steps in this blog from the PM. Example: https://ztech.azure-api.net/cosmos/getdata/41c40e37-f85e-6e34-0d2b-69cfe44e78a0 Could one execute a PowerShell cmdlet to convert the output to HTML in an API Management Transformation policy? Currently, one needs to implement AzFunctions with Cosmosdb binding just to AzFunctions Run.ps1using namespace System.Net
param($Request,$CosmosDBinput, $TriggerMetadata)
$Body= [string]($CosmosDBinput|ConvertTo-Html)
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $body
ContentType = "text/html"
}) Document Details⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Azure services returns result in Json. It can be converted to XML or YAML because they are schema based language. Could you explain further why you need content in HTML? What's the conversion rule expected? Could you just call |
Beta Was this translation helpful? Give feedback.
-
feature request is created #14642 |
Beta Was this translation helpful? Give feedback.
feature request is created #14642