-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting ##[error]Failed to parse with json file #513
Comments
Hi @mslentz, could you share the format of your json file, which could have key and value masked and I can use the file to repro the issue? |
@mslentz, also check if the config json file contains any trailing commas, can be the cause of the error sometimes |
I discovered my issue was with spaces in the path to the file. Thanks for your help. |
@MaryanneNjeri thanks for looking into this. Just curious, won't it work when there are spaces in the path? |
I tried it on my end, if the space is present in the file path something like this |
I did have spaces in my file path. I changed to an AZ CLI command and was able to publish a simple json file: {"Key1": "value"} I am using this command: I just added my actual config file: {
} and the CLI is giving an error that says: The input is not a well formatted json file. I'm not seeing the problem, can you help? |
@mslentz, I tried importing the exact contents of your JSON file using the same command that you are using, and I'm not getting any error. Can you try to format the file you're using with any JSON formatter and see if there's a syntax issue on your side? |
Thanks for bringing this to our attention @mslentz. The error turned out to be due to the presence of a non-ASCII character in the JSON file being imported. We are working on supporting the import of all unicode characters using CLI. |
Great. @MaryanneNjeri, you will fix the 'space in path" issue too? |
I'm also having this issue without any special characters in my JSON file. When I use the Azure CLI, it lets me import with the same file, but the pipeline task throws this every time. |
@zhenlan yes I’ll work on a fix for that. |
@ctvanzandt42 it throws the error “Failed to parse: ‘... path to file’? |
Correct; I’ve put the depth at zero, removed it, changed the separator, no dice. If I use the CLI, it imports it just fine, but the pipeline task fails with the exact JSON. |
@ctvanzandt42 , could you share your json file, which could have key and value masked and I can use the file to reproduce the issue? |
Sure! So here's how I'm using the task:
And my JSON looks like this:
Values are not accurate obviously, and I'm also purposely not using hyphens as the separator. Right now, I'm just trying to get these two KV pairs pushed, I can flatten properly later. |
@ctvanzandt42 I tried using your json file with the azure app configuration push task, it succeeded on my end |
Can you share how the task looks? That is the exact JSON I'm pushing, with a few strings substituted. Again, it's valid JSON and it works pushing from the CLI. |
Yes let me share how the task looks like from my end. |
Task version: 1.3.4 |
Hey Maryanne, that's exactly how the task looks on my end. Very weird; I ended up doing this manually, which is obviously not ideal for production, but had to be done. I'd love to revisit this if you all find there's a bug in here, I'm happy to help you all battle-test this if need be. |
@ctvanzandt42 will definitely reach out if we find a bug. Please feel free to reach out incase of anything. |
Hi, @ctvanzandt42 a new release is out for Azure App Configuration Task version - 3.5.16 and Azure App Configuration Push Task version-1.4.4, with the fix that gives more information about the error message above, please feel free to check it out. In case of any questions please feel free to reach out :). Thanks, |
Wonderful, Maryanne! Let me know when the release notes are posted, I don't see them. Looking forward to implementing the fix. |
Awesome will let you know once the release notes are posted. |
@ctvanzandt42 the release notes for this fix were posted, AzureDevOpspipelineExtension and AzureDevOpsPushPipelineExtension |
@MaryanneNjeri can this be closed? |
Yes, thank you so much! |
Hi, I'm working in Azure Gov and I'm trying to push my config json file to an App Config service and I keep getting an error:
##[error]Failed to parse: .......path to file
the file looks like this:
{
"Key1": "value"
}
I am using Azure Pipelines in our DevOps instance. The pipeline is using a service principle that has permissions to the resource group (it is successfully deploying to an app service) and has the "App Configuration Data Owner" role on the config service.
The error is a bit non-specific, do you have any ideas on what I can do to further troubleshoot this?
The text was updated successfully, but these errors were encountered: