azure.bicep 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @maxLength(20)
  2. @minLength(4)
  3. @description('Used to generate names for all resources in this file')
  4. param resourceBaseName string
  5. param webAppSku string
  6. param serverfarmsName string = resourceBaseName
  7. param webAppName string = resourceBaseName
  8. param location string = resourceGroup().location
  9. // Compute resources for your Web App
  10. resource serverfarm 'Microsoft.Web/serverfarms@2021-02-01' = {
  11. kind: 'app'
  12. location: location
  13. name: serverfarmsName
  14. sku: {
  15. name: webAppSku
  16. }
  17. }
  18. // Azure Web App that hosts your website
  19. resource webApp 'Microsoft.Web/sites@2021-02-01' = {
  20. kind: 'app'
  21. location: location
  22. name: webAppName
  23. properties: {
  24. serverFarmId: serverfarm.id
  25. httpsOnly: true
  26. siteConfig: {
  27. appSettings: [
  28. {
  29. name: 'WEBSITE_RUN_FROM_PACKAGE'
  30. value: '1' // Run Azure App Service from a package file
  31. }
  32. {
  33. name: 'WEBSITE_NODE_DEFAULT_VERSION'
  34. value: '~18' // Set NodeJS version to 18.x for your site
  35. }
  36. {
  37. name: 'RUNNING_ON_AZURE'
  38. value: '1'
  39. }
  40. ]
  41. ftpsState: 'FtpsOnly'
  42. }
  43. }
  44. }
  45. // The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
  46. output TAB_AZURE_APP_SERVICE_RESOURCE_ID string = webApp.id // used in deploy stage
  47. output TAB_DOMAIN string = webApp.properties.defaultHostName
  48. output TAB_ENDPOINT string = 'https://${webApp.properties.defaultHostName}'