79503942

Date: 2025-03-12 14:49:18
Score: 0.5
Natty:
Report link

Thank you very much for your help @Vinay B, it worked! Based on your suggestion, instead of using a blob storage to store the JSON file, for saving costs purpose, I placed the content directly into the template using template_content with jsonencode. Here's the working solution for me:

resource "azurerm_resource_group_template_deployment" "webpubsub" {
  name                = "WebPubSubDeployment-${var.environment}"
  resource_group_name = azurerm_resource_group.wps-rg.name
  deployment_mode     = "Incremental"

  template_content = jsonencode({
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
      "webPubSubName": {
        "type": "string",
        "defaultValue": "cca-${var.EnvironmentShort}"
      },
      "location": {
        "type": "string",
        "defaultValue": "westeurope"
      }
    },
    "resources": [
      {
        "type": "Microsoft.SignalRService/WebPubSub",
        "apiVersion": "2024-10-01-preview",
        "name": "[parameters('webPubSubName')]",
        "location": "[parameters('location')]",
        "sku": {
          "name": "Free_F1",
          "tier": "Free",
          "size": "F1",
          "capacity": 1
        },
        "kind": "SocketIO",
        "properties": {
          "tls": {
            "clientCertEnabled": false
          },
          "publicNetworkAccess": "Enabled",
          "disableLocalAuth": false,
          "disableAadAuth": false,
          "regionEndpointEnabled": "Enabled",
          "resourceStopped": "false"
        }
      }
    ]
  })

  parameters_content = jsonencode({
    "webPubSubName": {
      "value": "cca-${var.EnvironmentShort}"
    },
    "location": {
      "value": "westeurope"
    }
  })
}
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Whitelisted phrase (-1): it worked
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Vinay
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Rahula Palu