Net core application and deploying the application in Azure App Services. In my application, I have an app settings.json file with below content
"Roles": {
"Roles": [
"Admins",
"Users"
]
}
I have the below configuration in my ARM template.
Parameters.json
"Roles": {
"value": [
"Admins",
"Users"
]
}
I am trying to add values in app settings as below
{
"name": "Roles__Roles",
"value": "[parameters('Roles')]"
}
This is giving me an exception
2021-01-19T10:25:17.0538350Z ##[error]Details:
2021-01-19T10:25:17.0539754Z ##[error]undefined: HTTP request body must not be empty.
Can someone help me to fix this?
As far as I understand, the app settings values provided for the App Service need to be of type string. However, your parameter "Roles" is of type array. Thus, a conversion to string is required. Try this:
{
"name": "Roles__Roles",
"value": "[string(parameters('Roles'))]"
}
The same applies to parameters of type object.
Unfortunately, the error message is not at all helpful in clarifying this.
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With