-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support for app settings configuration for azurerm_static_site #13451
Comments
One work-around for setting SWA App Settings is to provision an ARM Resource Group Template Deployment via Working example: variable "resource_group_name" {}
data "azurerm_resource_group" "rg" {
name = var.resource_group_name
}
variable "swa_name" {}
variable "swa_sku_tier" {}
resource "azurerm_static_site" "frontend" {
name = var.swa_name
resource_group_name = data.azurerm_resource_group.rg.name
location = data.azurerm_resource_group.rg.location
sku_tier = var.swa_sku_tier
}
variable "app_setting1" {}
variable "app_setting2" {}
resource "azurerm_resource_group_template_deployment" "frontend_appsettings" {
deployment_mode = "Incremental"
name = "frontend-appsettings"
resource_group_name = data.azurerm_resource_group.rg.name
template_content = file("staticwebapp-arm-staticsite-config.json")
parameters_content = jsonencode({
staticSiteName = {
value = azurerm_static_site.frontend.name
},
appSetting1 = {
value = var.app_setting1
},
appSetting2 = {
value = var.app_setting2
},
})
} With {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"staticSiteName": {
"type": "string"
},
"appSetting1": {
"type": "string"
},
"appSetting2": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/staticSites/config",
"apiVersion": "2020-10-01",
"name": "[concat(parameters('staticSiteName'), '/appsettings')]",
"kind": "string",
"properties": {
"APP_SETTING1": "[parameters('appSetting1')]",
"APP_SETTING2": "[parameters('appSetting2')]"
}
}
],
"outputs": {}
}
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
It's not just the app settings, it is also other configuration.
Perhaps this is a separate issue, but I don't see why solving this for the app settings could not be part of general support for the entire API version (which is 2022-03-01 in the aforementioned docs). This issue has no milestone yet. While the azapi_resource approach is documented well, it would be nice to have an implementation like there is for other (Terraform/Azure) resources. I could maybe try to work on this if time permits it, but only if it would be merged or picked up further. |
Is it supported now? Since |
It's documented but I just tried to use it and it's not working unfortunately. |
Community Note
Description
New or Affected Resource(s)
azurerm_static_site
Potential Terraform Configuration
Same as
app_settings
forazurerm_app_service
andazurerm_function_app
: app_settings - (Optional) A map of key-value pairs for App Settings and custom values.References
The text was updated successfully, but these errors were encountered: