Multiple scopes for Dapr Component in Container Environment can't be set using Bicep #12343
Replies: 5 comments 2 replies
-
Can you share the full error response? From the error message, it is not clear if the issue is coming from the App RP or from the Template Deployments service. |
Beta Was this translation helpful? Give feedback.
-
{
"status": "Failed",
"error": {
"code": "DeploymentFailed",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/pay-demo-deployment",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "ResourceDeploymentFailure",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/storageContainerBindings",
"message": "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.",
"details": [
{
"code": "DeploymentFailed",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/storageContainerBindings",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "BadRequest",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/storageContainerBindings",
"message": "{\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.1\",\r\n \"title\": \"One or more validation errors occurred.\",\r\n \"status\": 400,\r\n \"traceId\": \"00-21d36e271a7cd4767acb217dd08ae44f-3e9c02ec295d032e-01\",\r\n \"errors\": {\r\n \"$.properties.scopes[0]\": [\r\n \"The JSON value could not be converted to System.String. Path: $.properties.scopes[0] | LineNumber: 0 | BytePositionInLine: 360.\"\r\n ]\r\n }\r\n}"
},
{
"code": "BadRequest",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/storageContainerBindings",
"message": "{\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.1\",\r\n \"title\": \"One or more validation errors occurred.\",\r\n \"status\": 400,\r\n \"traceId\": \"00-21d36e271a7cd4767acb217dd08ae44f-79d9613e22399ccf-01\",\r\n \"errors\": {\r\n \"$.properties.scopes[0]\": [\r\n \"The JSON value could not be converted to System.String. Path: $.properties.scopes[0] | LineNumber: 0 | BytePositionInLine: 358.\"\r\n ]\r\n }\r\n}"
},
{
"code": "BadRequest",
"target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-xxxxxxxx/providers/Microsoft.Resources/deployments/storageContainerBindings",
"message": "{\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.1\",\r\n \"title\": \"One or more validation errors occurred.\",\r\n \"status\": 400,\r\n \"traceId\": \"00-21d36e271a7cd4767acb217dd08ae44f-342b788af58727ac-01\",\r\n \"errors\": {\r\n \"$.properties.scopes[0]\": [\r\n \"The JSON value could not be converted to System.String. Path: $.properties.scopes[0] | LineNumber: 0 | BytePositionInLine: 354.\"\r\n ]\r\n }\r\n}"
}
]
}
]
}
]
}
} |
Beta Was this translation helpful? Give feedback.
-
Sorry I closed this accidentally. |
Beta Was this translation helpful? Give feedback.
-
Should scopes: [
container.scopes
] Instead be: scopes: container.scopes The error from the RP suggests to me that you're passing a non-string-value as the first entry in the array. |
Beta Was this translation helpful? Give feedback.
-
A minor refactoring suggestion would be to use: type containerType = {
scopes: string[]
containerName: string
daprComponentName: string
}
param containers containerType[] Instead of: param containers object[] That way I think the editor could have probably caught the problem instead of it being caught when deploying (see here for an example) |
Beta Was this translation helpful? Give feedback.
-
Bicep version
0.22.6
Describe the bug
The az cli gives the following error:
"The JSON value could not be converted to System.String.
To Reproduce
Use the following in a bicep file:
Use the following parameters.json:
Additional context
Add any other context about the problem here.
Hardwiring more than one value in the component does work but setting from array of strings in bicep or json file does not work
Beta Was this translation helpful? Give feedback.
All reactions