Share via

My Bicep deployment is demanding a "format" parameter when it's not even supported

Anonymous
2025-04-02T18:19:04.9566667+00:00

I have a basic Bicep resource that I am trying to deploy and it fails every single time with an error that makes absolutely no sense:

"Value cannot be null. Parameter name: format"

"format" is not a parameter that this resource supports, so there's no discernable way to get around the error. This is my resource code:

param resourceName string
param userDefinedName string
param frequency int
param kind string
param locations array
param requestUrl string
param appInsightsResourceId string

resource webTest 'Microsoft.Insights/webTests@2022-06-15' = {
  name: resourceName
  location: resourceGroup().location
  properties: {
    Name: userDefinedName
    Enabled: true
    Frequency: frequency
    Kind: kind
    Locations: locations
    Request: {
      HttpVerb: 'GET'
      RequestUrl: requestUrl
    }
    RetryEnabled: false
    SyntheticMonitorId: userDefinedName
  }
  tags: {
    'hidden-link:${appInsightsResourceId}': 'Resource'
  }
}

output webTestId string = webTest.id

And my main.bicep file calls it like this:

module availabilityTest 'modules/insights/web-test.bicep' = {
  name: 'availability-test-deployment'
  params: {
    resourceName: healthCheckTestName
    userDefinedName: healthCheckTestName
    frequency: 300
    kind: 'standard'
    locations: [
      {
        Id: 'us-ca-sjc-azr' // West US
      }
      {
        Id: 'us-va-ash-azr' // East US
      }
      {
        Id: 'us-fl-mia-edge' // Central US
      }
      {
        Id: 'us-il-ch1-azr' // North Central US
      }
      {
        Id: 'us-tx-sn1-azr' // South Central US
      }
    ]
    requestUrl: 'http://${pip.outputs.publicIpAddress}/health'
    appInsightsResourceId: appi.outputs.appInsightsResourceId
  }
}
Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.


Answer accepted by question author
  1. Pranay Reddy Madireddy 6,340 Reputation points Moderator
    2025-04-02T21:01:01.2166667+00:00

    Hi @Stephen Baker
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:
    My Bicep deployment is demanding a "format" parameter when it's not even supported

    Solution:
    I was able to solve the issue by adding properties.ValidationRules to the resource. While they aren't stated to be required in the official documentation, it would seem that they are.

    The final (working) resource definition looks like this. Hopefully this helps someone:

    param resourceName string
    param userDefinedName string
    param description string
    param frequency int
    param timeout int = 30
    param kind string
    param locations array
    param requestUrl string
    param appInsightsResourceId string
    resource webTest 'Microsoft.Insights/webtests@2022-06-15' = {
      name: resourceName
      kind: kind
      location: resourceGroup().location
      properties: {
        Name: userDefinedName
        Description: description
        Enabled: true
        Frequency: frequency
        Kind: kind
        Locations: locations
        Request: {
          HttpVerb: 'GET'
          RequestUrl: requestUrl
        }
        ValidationRules: {
          ExpectedHttpStatusCode: 200
          IgnoreHttpStatusCode: false
          ContentValidation: null
          SSLCheck: false
        }
        RetryEnabled: false
        SyntheticMonitorId: userDefinedName
        Timeout: timeout
      }
      tags: {
        'hidden-link:${appInsightsResourceId}': 'Resource'
      }
    }
    output webTestId string = webTest.id
    

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Alex Pike 10 Reputation points
    2025-05-15T03:31:37.23+00:00

    If anyone else is STILL getting the deploy error "Value cannot be null. Parameter name: format" know that there are MULTIPLE hidden validation requirements. I can't list them all out here but for me, Timeout HAS to be 30. Frequency MUST be either 300, 600 or 900. ValidationRules.SSLCheck MUST be false if Request.RequestUrl is not https://

    Almost destroyed myself deploying this resource. Will be sending the bill for my therapy sessions to whoever wrote the error handling for this resource.

    2 people found this answer helpful.
    0 comments No comments

  2. Anonymous
    2025-04-02T20:14:57.1233333+00:00

    I was able to solve the issue by adding properties.ValidationRules to the resource. While they aren't stated to be required in the official documentation, it would seem that they are.

    The final (working) resource definition looks like this. Hopefully this helps someone:

    param resourceName string
    param userDefinedName string
    param description string
    param frequency int
    param timeout int = 30
    param kind string
    param locations array
    param requestUrl string
    param appInsightsResourceId string
    
    resource webTest 'Microsoft.Insights/webtests@2022-06-15' = {
      name: resourceName
      kind: kind
      location: resourceGroup().location
      properties: {
        Name: userDefinedName
        Description: description
        Enabled: true
        Frequency: frequency
        Kind: kind
        Locations: locations
        Request: {
          HttpVerb: 'GET'
          RequestUrl: requestUrl
        }
        ValidationRules: {
          ExpectedHttpStatusCode: 200
          IgnoreHttpStatusCode: false
          ContentValidation: null
          SSLCheck: false
        }
        RetryEnabled: false
        SyntheticMonitorId: userDefinedName
        Timeout: timeout
      }
      tags: {
        'hidden-link:${appInsightsResourceId}': 'Resource'
      }
    }
    
    output webTestId string = webTest.id
    
    

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.