Skip to content
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

[QUERY] Deployment template parameter parsing failure #39318

Closed
2 tasks done
leventegebhardt opened this issue Mar 20, 2024 · 4 comments
Closed
2 tasks done

[QUERY] Deployment template parameter parsing failure #39318

leventegebhardt opened this issue Mar 20, 2024 · 4 comments
Assignees
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@leventegebhardt
Copy link

Query/Question
I'm trying to deploy a function app via an ARM template through Azure Java SDK.
The template contains parameters of type "string":

...
"parameters": {
    "functionAppName": {
      "type": "string",
      "defaultValue": "fnapp-def",
      "metadata": {
        "description": "Description of the parameter"
      }
    },
...

Related Java code snippet:

Map<String, String> parameters = new HashMap<>();
parameters.put("functionAppName", "fnapp-test1");

...

resourceManager
    .deployments()
    .define(functionAppName)
    .withExistingResourceGroup(resourceGroup)
    .withTemplateLink(templateFile.getPath(), "1.0.0")
    .withParameters(parameters)
    .withMode(DeploymentMode.INCREMENTAL)
    .beginCreate();

Following exception is thrown at runtime:

java.io.UncheckedIOException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.azure.resourcemanager.resources.models.DeploymentParameter` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('fnapp-test1')
 at [Source: (String)"{"functionAppName":"fnapp-test1"}"; line: 1, column: 20] (through reference chain: java.util.LinkedHashMap["functionAppName"])

	at com.azure.resourcemanager.resources.implementation.DeploymentImpl.getParametersFromObject(DeploymentImpl.java:613)
	at com.azure.resourcemanager.resources.implementation.DeploymentImpl.withParameters(DeploymentImpl.java:308)
	at com.azure.resourcemanager.resources.implementation.DeploymentImpl.withParameters(DeploymentImpl.java:59)
	at AzureFunctionAppHandler.createFunctionApp(AzureFunctionAppHandler.java:136)

Why is this not a Bug or a feature Request?
It seems that the SDK expects the parameter in a different form. If not, then this might be a bug indeed.

Setup (please complete the following information if applicable):

  • OS: iOS
  • IDE: IntelliJ
  • Library/Libraries: azure-resourcemanager-appservice:2.36.1, azure-resourcemanager:2.36.0, azure-core:1.47.0

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added
@github-actions github-actions bot added ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 20, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@XiaofeiCao
Copy link
Contributor

@leventegebhardt
There seems to be another "value" layer for parameter value.

Would you try:

Map<String, String> functionAppNameValue = new HashMap<>();
functionAppNameValue.put("value", "fnapp-test1");
parameters.put("functionAppName", functionAppNameValue );

@XiaofeiCao XiaofeiCao added the needs-author-feedback More information is needed from author to address the issue. label Apr 18, 2024
@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Apr 18, 2024
Copy link

Hi @leventegebhardt. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

Hi @leventegebhardt, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Apr 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants