Azure / Azure/api-management-policy-snippets

About the example Azure Storage Blob CRUD with MSI

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
399
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Could someone please explain a better examples with CRUD and Msi (deep dive policies) ? What if if I need handle a file of different type ( not json object) ? What about to send this file to blob ? I`m trying to get a file from a S3 (via get API) and write this to an blob storage.
I can Get data from S3 using send request, otherwise when I try sent that to Blob storage is generated an error because the type of file isn't a pure json object:
`
https://{{storage}}.blob.core.windows.net/container
POST

2019-07-07


BlockBlob


file

@($"{((IResponse)context.Variables["**blobdata**"]).Body.As() }")

`
Here I`m trying send "blobdata" because is the variable that contains the file from the first Send-Request ( not presented here). The error I received is following:

`"Expression evaluation failed. The message body is not a valid JSON. Unexpected character encountered while parsing value: P. Path '', line 0, position 0.\r\n at Newtonsoft.Json.JsonTextReader.ParseValue()\r\n at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)\r\n at Microsoft.WindowsAzure.ApiManagement.Proxy.Gateway.MessageBody.AsJObject(Stream stream, Encoding encoding, JsonSerializerSettings settings)\r\n at Microsoft.WindowsAzure.ApiManagement.Proxy.Gateway.MessageBody.As[T](Boolean preserveContent)",
"Unexpected character encountered while parsing value: P. Path '', line 0, position 0."`

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository files or tests are named; start with the embedded send-request policy and the response variable from the first request, then reproduce the non-JSON body error. Done means a documented Azure API Management example covering CRUD, managed-identity policies, and transferring an arbitrary file from S3 to Azure Blob Storage.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, azure
Domain
api, cloud, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.