title: How to output resource id in bicep
body: <p>How to output resource id in bicep, while creating the subnet how do we get the output string, virtual network syntax s shown below</p>
  <pre><code>resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
    name: vnetName
    location: resourceGroup().location
    properties: {
      addressSpace: {
        addressPrefixes: [
          '10.0.0.0/16'
        ]
      }
      subnets: [
        {
          name: 'subnetpoc-1'
          properties: {
            addressPrefix: '10.0.3.0/24'
          }
        }
        {
          name: 'subnetnetpoc-2'
          properties: {
            addressPrefix: '10.0.4.0/24'
          }
        }
      ]
    }
  }
  
  // output subnet string = &quot;&quot;
  </code></pre>