Advertisement
Guest User

frontendHosting.bicep

a guest
Apr 20th, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. @secure()
  2. param provisionParameters object
  3. var resourceBaseName = provisionParameters.resourceBaseName
  4. var storageName = contains(provisionParameters, 'frontendHostingStorageName') ? provisionParameters['frontendHostingStorageName'] : '${resourceBaseName}tab' // Try to read name for frontend hosting Storage Account from parameters
  5. var storageSku = contains(provisionParameters, 'frontendHostingStorageSku') ? provisionParameters['frontendHostingStorageSku'] : 'Standard_LRS' // Try to read SKU for frontend hosting Storage Account from parameters
  6.  
  7. // Azure Storage that hosts your static web site
  8. resource storage 'Microsoft.Storage/storageAccounts@2021-06-01' = {
  9. kind: 'StorageV2'
  10. location: resourceGroup().location
  11. name: storageName
  12. properties: {
  13. supportsHttpsTrafficOnly: true
  14. }
  15. sku: {
  16. name: storageSku // You can follow https://aka.ms/teamsfx-bicep-add-param-tutorial to add frontendHostingStorageSku property to provisionParameters to override the default value "Standard_LRS".
  17. }
  18. }
  19.  
  20. var siteDomain = replace(replace(storage.properties.primaryEndpoints.web, 'https://', ''), '/', '')
  21.  
  22. output resourceId string = storage.id
  23. output endpoint string = 'https://${siteDomain}'
  24. output domain string = siteDomain
  25. output indexPath string = '/index.html#'
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement