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

event 2022-12-27 visibility 469 comment 0 insights
more_vert
insights Stats
Kontext Kontext Microsoft Azure

Data analytics, application development with Microsoft Azure cloud platform.

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

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts