Azure Bicep Deploy Error - The 'parameters.properties.storageAccountSubscriptionId' segment in the url is invalid.

visibility 14 event 2022-12-27 access_time 2 months ago language English
more_vert

Issue context

When setting up Azure SQL database with auditing using Azure Blob Storage, you may encounter the following error:

The 'parameters.properties.storageAccountSubscriptionId' segment in the url is invalid.

The bicep resource code looks something like the following:

resource auditSettings 'Microsoft.Sql/servers/auditingSettings@2022-05-01-preview' = {
  parent: kontextSqlServer
  name: 'default'
  properties: {
    auditActionsAndGroups: [
      'SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP'
      'FAILED_DATABASE_AUTHENTICATION_GROUP'
      'BATCH_COMPLETED_GROUP'
    ]
    isAzureMonitorTargetEnabled: false
    isDevopsAuditEnabled: false
    isManagedIdentityInUse: false
    isStorageSecondaryKeyInUse: false
    retentionDays: 0
    state: 'Enabled'
    storageAccountSubscriptionId: subscription_id
    storageEndpoint: sql_audit_blob_endpoint
  }
}

subcription_id and sql_audit_blob_endpoint are parameters of string type.

Fix the issue

After spending some time to debug this issue, I found the error occurred because the parameter for subscription_id is null or empty. After I ensure it is passed into the template correctly, the issue is resolved automatically.

storageAccountSubscriptionId: subscription_id
storageEndpoint: sql_audit_blob_endpoint

References

This error is different from the following one:

Microsoft.Sql servers/securityAlertPolicies · Issue #6532 · Azure/azure-quickstart-templates · GitHub

info Last modified by Kontext 2 months ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts