
Announcements
Hi, I'm trying to use code from this website to parse somehow Databrick API Response.
Without Code enabled, everything works I got 200 response with the data that I want.
With the code below I got error. Any suggestions?
public class Script : ScriptBase
{
public override async Task<HttpResponseMessage> ExecuteAsync(){
HttpResponseMessage response = await this.Context.SendAsync(
this.Context.Request,
this.CancellationToken);
var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(
continueOnCapturedContext: false
);
var result = JObject.Parse(responseString);
var _resultSet = new List<Dictionary<string, Newtonsoft.Json.Linq.JToken>>();
var _columns = new List<string>();
foreach (var _c in result["manifest"]["schema"]["columns"]) {
_columns.Add( _c["name"].ToString()) ;
}
foreach (var _r in result["result"]["data_array"]) {
var _newRow = new Dictionary<string, Newtonsoft.Json.Linq.JToken>();
var _colIndex = 0;
foreach (var _f in _r) {
_newRow.Add(_columns[_colIndex], _f );
_colIndex++;
}
_resultSet.Add(_newRow);
}
var y = new Dictionary<string,List<Dictionary<string, Newtonsoft.Json.Linq.JToken>>>() {
{"results" , _resultSet } };
response.Content = CreateJsonContent(JsonConvert.SerializeObject(y));
return response;
}
}Failed to provision compute for custom code. Request failed with error 'Code: BadRequest. Message: Unable to find an unassigned function app in 'West US'.'. The correlation Id is 'f9c88d51-fc9a-4881-a78b-7a3e99f82387'.