0

Is Azure SQL Serverless database implementation supported using Bicep? I haven't seen any Bicep examples of it on Web. Most of the examples are using ARM only and the reverse engineering of ARM to Bicep is not working for me. It is just giving internal server error with no more details. Does someone have any working example of it which can be used as a reference? Appreciate your help in advance!

SQLPRODDBA
  • 171
  • 8
  • 2
    we can convert `Json` to `bicep` using `VS Code`. save `Json` code in a file and open the folder in `VS Code`. After that press `ctrl+p` it will open a command palette in that use the following command `>bicep:decompile to bicep` . it will convert `json` to `bicep` and create a `.bicep` file in the same directory. – Tarun Krishna Jan 09 '23 at 08:36

1 Answers1

1

Here is bicep file for reference.

param servername string = 'mysqlserver-1036050389'
param location string = 'centralus'

resource servername_resource 'Microsoft.Sql/servers@2022-05-01-preview' = {
  name: servername
  location: location
  properties: {
    administratorLogin: 'azureuser'
    administratorLoginPassword: 'Bigambs123457'
    version: '12.0'
    publicNetworkAccess: 'Enabled'
    restrictOutboundNetworkAccess: 'Disabled'
  }
}

resource servername_mySampleDatabase 'Microsoft.Sql/servers/databases@2022-05-01-preview' = {
  parent: servername_resource
  name: 'mySampleDatabase'
  location: location
  sku: {
    name: 'GP_S_Gen5'
    tier: 'GeneralPurpose'
    family: 'Gen5'
    capacity: 2
  }
  kind: 'v12.0,user,vcore,serverless'
  properties: {
    collation: 'SQL_Latin1_General_CP1_CI_AS'
    maxSizeBytes: 34359738368
    catalogCollation: 'SQL_Latin1_General_CP1_CI_AS'
    zoneRedundant: false
    readScale: 'Disabled'
    autoPauseDelay: 60
    requestedBackupStorageRedundancy: 'Geo'
    minCapacity: 2
    isLedgerOn: false
    
  }
}
SwathiDhanwada
  • 518
  • 3
  • 9