Source of the JSONArrayFor Liquid method when using Logic App - azure

I've built my own Liquid template verification application that will take a liquid template + a sample file and then output the result. The app is using the same version of Dotliquid that Logic Apps does but there seems to be a custom filter JSONArrayFor that I'm not able to replicate.
Running the app with the filter throws an error "DotLiquid.Exceptions.SyntaxException: Unknown tag 'JSONArrayFor'" so it has to be a custom filter created by the Azure team.
Does anyone have any clue where I can find the source, the logic or anything in regard what it does and how the filter works?

Related

OpenAPI Generator issue with Destination service API specification

I want to get all destinations on subaccount and instance level. In SAP API business Hub, I found the API information and "SAP Cloud SDK" tab to generate code by OpenAPI generator.
https://api.sap.com/api/SAP_CP_CF_Connectivity_Destination/overview
I downloaded the API specification and added dependencies into Cloud SDK for Java project. The code is generated successfully with some errors (unknown models)in generated api classes.
For example in DestinationsOnSubaccountLevelApi.class, model OneOfDestinationNameOnly is imported and used in method but it is not generated in model package.
I looked into API specification and found that there were two types of response entity. That is the reason why the code could not be generated properly. I can modify the API specification to make it work but it should not be the long term solution. Is there any other way to fix this issue?
Unfortunately the SAP Cloud SDK Generator for Open API services is not yet able to understand oneOf relationship that is modeled in the specification.
As an alternative, would you consider using the DestinationAccessor API for resolving single destinations?
You can also directly instantiate an ScpCfDestinationLoader, which allows for querying all destinations:
ScpCfDestinationLoader loader = new ScpCfDestinationLoader();
DestinationOptions options = DestinationOptions
.builder()
.augmentBuilder(ScpCfDestinationOptionsAugmenter.augmenter().retrievalStrategy(ScpCfDestinationRetrievalStrategy.ALWAYS_SUBSCRIBER))
.build();
Try<Iterable<ScpCfDestination>> destinations = loader.tryGetAllDestinations(options);
Similar to the default behavior of DestinationAccessor API, in the code above only the subscriber account will be considered. Other options are:
ScpCfDestinationRetrievalStrategy.ALWAYS_SUBSCRIBER
ScpCfDestinationRetrievalStrategy.ALWAYS_PROVIDER
ScpCfDestinationRetrievalStrategy.SUBSCRIBER_THEN_PROVIDER

struggling to get 'deploy to azure button' to work

I'm struggling to get a Deploy to Azure button to work and hoping someone can help,
my code in the readme.md looks like
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/<url encoded link to raw template>
when I try the button it takes me to the deploy screen, only I get an error:
"(x) Error parsing template. Please ensure template is valid JSON. Invalid symbol at character position 4. (3 other errors)"
the template validates and works as expected when deployed manually through Deploy a Custom Template,
the raw uri to the template in our tfsgit repo returns the raw template as expected
(the raw uri uses msoft's pattern of https://dev.azure.com/{{organization}}/{{project}}/_apis/sourceProviders/{{providerName}}/filecontents?repository={{repository}}&path={{path}}&commitOrBranch={{commitOrBranch}}&api-version=5.0-preview.1)
I'm guessing might be some kind of authentification issue, I've tried basic auth with username:password#https://... or maybe it only works with github.com, either way I'm completely stuck
nothing I try seems to work, and azure won't show me the json it's trying to parse,
I was wondering if someone else has had a similar issue and would be able to point me in the right direction here
thanks in advance

How to get the Builds for a project using OData in Azure Devops

I'm trying to get all the builds for a project using Odata for Azure Devops. However I found there was an endpoint for that https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/Builds but while trying the same for my Project I'm getting the below error
{"$id":"1","innerException":null,"message":"Resource not found for the segment 'Builds'.","typeName":"Microsoft.OData.UriParser.ODataUnrecognizedPathException, Microsoft.TeamFoundation.OData.Core","typeKey":"ODataUnrecognizedPathException","errorCode":0,"eventId":0}
Is this endpoint not available anymore. Or is there something wrong with my query?
Is this endpoint not available anymore. Or is there something wrong
with my query?
The entity set Build has been renamed. You can check this post from our User Voice forum.
All entity sets and entity properties with names starting with Build will be renamed to start with PipelineRun.
For e.g. Builds entity set will be called PipelineRuns, BuildId entity property will be called PipelineRunId.
So what you should use is : https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/PipelineRuns. It works on my side :)

XSLT got the exception in logic apps

When I use the XSLT to transform XML source file then got the below exception in Logic APP. This below URL is avail in the XSLT file.
How to resolve this issue in logic apps?
XSD schema is valid and working fine. At TransformXML place got this issue.
"Code": "InvalidXsltContent", "Message": "An error occurred while
processing map. 'Cannot find a script or an extension object
associated with namespace
'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'.'",
According to the error message, it seems the logic app can't find the external assembly from the integration account. So could you please check if you have upload the assembly to your integration account ? You can refer to this tutorial to know how to upload the assembly.
By the way, it seems you want to use custom extension in your xslt map. Here I provide two links for your reference:
https://learn.microsoft.com/en-us/biztalk/core/technical-reference/custom-extension-xml-grid-property?redirectedfrom=MSDN
https://blog.vertica.dk/2013/03/20/using-custom-xslt-in-biztalk/

How to create Index with custom analyzers from json file in Azure Search .NET SDK?

I had read that the Azure Search .NET SDK uses NewtonSoft.Json to convert it's models to/from json in it's underlying REST API calls so I've been doing the same in my own app.
I have a simple app which creates a new Index using the .NET SDK. To do this, I was defining my Index in a json file, using the format outlined here https://learn.microsoft.com/en-us/rest/api/searchservice/create-index and then I was converting this to a Microsoft.Azure.Search.Models.Index object using Newtonsoft.
var index = JsonConvert.DeserializeObject<Microsoft.Azure.Search.Models.Index>(System.IO.File.ReadAllText("config.json");
This was working fine before I configured custom Analyzers, but now that I have custom Analyzers in my config, the Analyzers, Tokenizers, and TokenFilters are not being resolved into the correct types. ie. my custom Analyzer is being deserialized as a Microsoft.Azure.Search.Models.Analyzer, instead of Microsoft.Azure.Search.Models.CustomAnalyzer, same goes for the Tokenizers and TokenFilters, they are being deserialized into the base types.
Is there an easy way I can create an Index like this in the .NET SDK from a json file?
Unfortunately this is not an officially supported scenario. While it works for simple index definitions, we're working to understand what we need to do to be able to support all cases.
Please post your feature request on our User Voice page to help us prioritize: https://feedback.azure.com/forums/263029-azure-search
In the meantime, you might be able to get it working yourself by adapting the JsonSerializerSettings initialization code at the bottom of this file.

Resources