Open JayDoubleu opened 3 years ago
This might also occur on workbooks in sentinel as they can easily exceed that 131k character quota. Just now I'm exporting some and they're like 145k characters :(. @edit: yup:
Unhandled exception. Azure.Deployments.Core.Exceptions.ExpressionException: The language expression literal limit exceeded. Limit: '131072' and actual: '168361'.
We are using this to load ADX scripts and hitting the max character limit using
loadTextContent
.string(loadJsonContent())
is not a workable solution for our usecase.
+1 for being blocked loading ADX scripts, too.
Any update on this?
For those hitting this limit when defining APIM API definitions - minifying the openapi YAML and using loadTextContent or loadYamlContent should give you some temporary breathing space
Our solution ended up being:
The reason we use the REST API is that this also allows us to provide the additional option to specifying that query parameters should not be translated into a template one. (https://learn.microsoft.com/en-us/rest/api/apimanagement/apis/create-or-update?view=rest-apimanagement-2022-08-01&tabs=HTTP#translaterequiredqueryparametersconduct) As it is not (yet?) supported by the PowerShell module or the Azure CLI. (Note that Bicep does already support this)
But this is a lot of additional complexity that we would have loved to avoid, so if there would be a solution for this, it would be great!
I encountered also this problem when importing an openAPI spec into Azure API Management using Bicep using loadTextContent.
I encountered also this problem when importing an openAPI spec into Azure API Management using Bicep using loadTextContent.
You can avoid it by loading openapi spec to object (load json/yaml content) and then serialise object into string-encoded-json using string
function.
I encountered also this problem when importing an openAPI spec into Azure API Management using Bicep using loadTextContent.
You can avoid it by loading openapi spec to object (load json/yaml content) and then serialise object into string-encoded-json using
string
function.
Many thanks, this saved the day!
string(loadJsonContent('very-large-open-api-spec.json'))
Is there an ETA for this? It seems that the change is trivial and affects multiple users, yet this doesn't seem to be on the radar. Am I correct in assuming that this isn't being actioned because the ARM deployment size limit needs to be increased first?
string(loadJsonContent('very-large-open-api-spec.json'))
weirdly enough this works, also for loadYamlContent, thanks
Increase MaxLiteralCharacterLimit for loadTextContent https://github.com/Azure/bicep/blob/main/src/Bicep.Core/LanguageConstants.cs#L32
Some of logic app JSON code as well as Azure Workbooks cannot be used with this function due to them being larger than 131072 characters. A lot of these resources would be created via azure portal and then used within arm templates/bicep for deployment. It would be great to have the ability to load it's content from within a separate file.