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

visibility 90 event 2022-12-27 access_time 5 months ago language English

Issue context

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

The '' 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: [
    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


This error is different from the following one:

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

More from Kontext
info Last modified by Kontext 5 months ago copyright This page is subject to Site terms.
Like this article?
Share on
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts