Hi @Cale Lacson
You're encountering a BadRequest error while adding a connection string in your App Service. This usually means there's a problem with the input format or missing/invalid fields.
Ensure that the JSON you are entering for the connection string is properly formatted. Here's a quick template for what it should look like:
{
"name": "your-connection-string-name",
"value": "your-connection-string-value",
"type": "SQLServer", // or whichever type you're using
"slotSetting": false
}
- Navigate to your App Service in the Azure portal.
Go to Settings > Environment variables > Connection strings.
- Select Add and enter the name and value correctly.
Avoid using invalid characters in the name (like : or spaces).
If the Azure portal method isn't working, you can try using the Azure CLI to set the connection string:
az webapp config connection-string set --resource-group your-resource-group --name your-app-name --connection-string-type SQLAzure --settings your-connection-string-name="your-connection-string-value"
Make sure that your account has the necessary permissions to modify the App Service settings. You might need to be an owner or contributor in the relevant resource group.
https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal