Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
472 changes: 103 additions & 369 deletions .gitignore

Large diffs are not rendered by default.

79 changes: 36 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,50 @@
# Project Name
# Quote of the Day - JavaScript

(short, 1-3 sentenced, description of the project)
## Prerequisites

## Features
- Clone this repository.
- Install or update to Powershell 7 <https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4>
- Install or update Azure CLI <https://learn.microsoft.com/en-us/cli/azure/install-azure-cli>
- Ensure you have the required permissions to deploy into the target Azure subscription. Either of the below sets of roles can be used:
- Owner
- Contributor & User Access Administrator

This project framework provides the following features:
## Use Azure Developer CLI

* Feature 1
* Feature 2
* ...
This application can be run using the [Azure Developer CLI](https://aka.ms/azd), or `azd`, with very few commands:

## Getting Started
- Navigate to the root of the repository.
- Install [azd](https://aka.ms/azure-dev/install).
- Log in `azd` (if you haven't done it before) to your Azure account:

### Prerequisites
```sh
azd auth login
```

(ideally very short, if any)
- Log in to the Azure CLI.

- OS
- Library version
- ...
```sh
az login
```

### Installation
- Initialize `azd` from the root of the repo.

(ideally very short)
```sh
azd init
```

- npm install [package name]
- mvn install
- ...
- Enter an environment name (e.g. quote-of-the-day-js-example) for this deployment when prompted.
- Create Azure resources and deploy the sample by running:

### Quickstart
(Add steps to get up and running quickly)
```sh
azd up
```

1. git clone [repository clone url]
2. cd [repository name]
3. ...
Notes:


## Demo

A demo app is included to show how to use the project.

To run the demo, follow these steps:

(Add steps to start up the demo)

1.
2.
3.

## Resources

(Any additional resources or related projects)

- Link to supporting information
- Link to similar sample
- ...
- The operation may take a few minutes when run for the first time in an environment.
- Upon completion, `azd` will display the web application's `url`. Follow this link to test the sample.
- To re-deploy and update the sample after making changes, run `azd up`.
- Use `azd down` to easily delete the newly created resources.
- Report any problems by opening an issue in [this repo](https://github.com/Azure-Samples/quote-of-the-day-dotnet/issues).
- Refer to the [FAQ and troubleshoot](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot) for `azd`.
14 changes: 14 additions & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json

name: quote-of-the-day-javascript
metadata:
template: quote-of-the-day-javascript@0.0.1-beta
hooks:
prepackage:
shell: pwsh
run: cd src && npm run build-client
services:
QuoteOfTheDay:
project: src
host: appservice
language: js
135 changes: 135 additions & 0 deletions infra/abbreviations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"analysisServicesServers": "as",
"apiManagementService": "apim-",
"appConfigurationStores": "appcs-",
"appManagedEnvironments": "cae-",
"appContainerApps": "ca-",
"authorizationPolicyDefinitions": "policy-",
"automationAutomationAccounts": "aa-",
"blueprintBlueprints": "bp-",
"blueprintBlueprintsArtifacts": "bpa-",
"cacheRedis": "redis-",
"cdnProfiles": "cdnp-",
"cdnProfilesEndpoints": "cdne-",
"cognitiveServicesAccounts": "cog-",
"cognitiveServicesFormRecognizer": "cog-fr-",
"cognitiveServicesTextAnalytics": "cog-ta-",
"computeAvailabilitySets": "avail-",
"computeCloudServices": "cld-",
"computeDiskEncryptionSets": "des",
"computeDisks": "disk",
"computeDisksOs": "osdisk",
"computeGalleries": "gal",
"computeSnapshots": "snap-",
"computeVirtualMachines": "vm",
"computeVirtualMachineScaleSets": "vmss-",
"containerInstanceContainerGroups": "ci",
"containerRegistryRegistries": "cr",
"containerServiceManagedClusters": "aks-",
"databricksWorkspaces": "dbw-",
"dataFactoryFactories": "adf-",
"dataLakeAnalyticsAccounts": "dla",
"dataLakeStoreAccounts": "dls",
"dataMigrationServices": "dms-",
"dBforMySQLServers": "mysql-",
"dBforPostgreSQLServers": "psql-",
"devicesIotHubs": "iot-",
"devicesProvisioningServices": "provs-",
"devicesProvisioningServicesCertificates": "pcert-",
"documentDBDatabaseAccounts": "cosmos-",
"eventGridDomains": "evgd-",
"eventGridDomainsTopics": "evgt-",
"eventGridEventSubscriptions": "evgs-",
"eventHubNamespaces": "evhns-",
"eventHubNamespacesEventHubs": "evh-",
"hdInsightClustersHadoop": "hadoop-",
"hdInsightClustersHbase": "hbase-",
"hdInsightClustersKafka": "kafka-",
"hdInsightClustersMl": "mls-",
"hdInsightClustersSpark": "spark-",
"hdInsightClustersStorm": "storm-",
"hybridComputeMachines": "arcs-",
"insightsActionGroups": "ag-",
"insightsComponents": "appi-",
"keyVaultVaults": "kv-",
"kubernetesConnectedClusters": "arck",
"kustoClusters": "dec",
"kustoClustersDatabases": "dedb",
"logicIntegrationAccounts": "ia-",
"logicWorkflows": "logic-",
"machineLearningServicesWorkspaces": "mlw-",
"managedIdentityUserAssignedIdentities": "id-",
"managementManagementGroups": "mg-",
"migrateAssessmentProjects": "migr-",
"networkApplicationGateways": "agw-",
"networkApplicationSecurityGroups": "asg-",
"networkAzureFirewalls": "afw-",
"networkBastionHosts": "bas-",
"networkConnections": "con-",
"networkDnsZones": "dnsz-",
"networkExpressRouteCircuits": "erc-",
"networkFirewallPolicies": "afwp-",
"networkFirewallPoliciesWebApplication": "waf",
"networkFirewallPoliciesRuleGroups": "wafrg",
"networkFrontDoors": "fd-",
"networkFrontdoorWebApplicationFirewallPolicies": "fdfp-",
"networkLoadBalancersExternal": "lbe-",
"networkLoadBalancersInternal": "lbi-",
"networkLoadBalancersInboundNatRules": "rule-",
"networkLocalNetworkGateways": "lgw-",
"networkNatGateways": "ng-",
"networkNetworkInterfaces": "nic-",
"networkNetworkSecurityGroups": "nsg-",
"networkNetworkSecurityGroupsSecurityRules": "nsgsr-",
"networkNetworkWatchers": "nw-",
"networkPrivateDnsZones": "pdnsz-",
"networkPrivateLinkServices": "pl-",
"networkPublicIPAddresses": "pip-",
"networkPublicIPPrefixes": "ippre-",
"networkRouteFilters": "rf-",
"networkRouteTables": "rt-",
"networkRouteTablesRoutes": "udr-",
"networkTrafficManagerProfiles": "traf-",
"networkVirtualNetworkGateways": "vgw-",
"networkVirtualNetworks": "vnet-",
"networkVirtualNetworksSubnets": "snet-",
"networkVirtualNetworksVirtualNetworkPeerings": "peer-",
"networkVirtualWans": "vwan-",
"networkVpnGateways": "vpng-",
"networkVpnGatewaysVpnConnections": "vcn-",
"networkVpnGatewaysVpnSites": "vst-",
"notificationHubsNamespaces": "ntfns-",
"notificationHubsNamespacesNotificationHubs": "ntf-",
"operationalInsightsWorkspaces": "log-",
"portalDashboards": "dash-",
"powerBIDedicatedCapacities": "pbi-",
"purviewAccounts": "pview-",
"recoveryServicesVaults": "rsv-",
"resourcesResourceGroups": "rg-",
"searchSearchServices": "srch-",
"serviceBusNamespaces": "sb-",
"serviceBusNamespacesQueues": "sbq-",
"serviceBusNamespacesTopics": "sbt-",
"serviceEndPointPolicies": "se-",
"serviceFabricClusters": "sf-",
"signalRServiceSignalR": "sigr",
"sqlManagedInstances": "sqlmi-",
"sqlServers": "sql-",
"sqlServersDataWarehouse": "sqldw-",
"sqlServersDatabases": "sqldb-",
"sqlServersDatabasesStretch": "sqlstrdb-",
"storageStorageAccounts": "st",
"storageStorageAccountsVm": "stvm",
"storSimpleManagers": "ssimp",
"streamAnalyticsCluster": "asa-",
"synapseWorkspaces": "syn",
"synapseWorkspacesAnalyticsWorkspaces": "synw",
"synapseWorkspacesSqlPoolsDedicated": "syndp",
"synapseWorkspacesSqlPoolsSpark": "synsp",
"timeSeriesInsightsEnvironments": "tsi-",
"webServerFarms": "plan-",
"webSitesAppService": "app-",
"webSitesAppServiceEnvironment": "ase-",
"webSitesFunctions": "func-",
"webStaticSites": "stapp-"
}
73 changes: 73 additions & 0 deletions infra/app/QuoteOfTheDay.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
param name string
param location string = resourceGroup().location
param tags object = {}

param appConfigurationName string
param applicationInsightsName string
@secure()
param appDefinition object
param appServicePlanId string

resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = {
name: applicationInsightsName
}

resource appService 'Microsoft.Web/sites@2023-01-01' = {
name: name
location: location
tags: union(tags, {'azd-service-name': 'QuoteOfTheDay' })
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: appServicePlanId
siteConfig: {
appCommandLine: 'npm start'
linuxFxVersion: 'NODE|20-lts'
alwaysOn: true
}
}
}

@description('This is the built-in app configuration data reader role. See https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#app-configuration-data-reader')
resource appConfigDataReaderDefinition 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
name: '516239f1-63e1-4d78-a4de-a74fb236a071'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-09-01-preview' existing = {
name: appConfigurationName
}

resource appConfigDataReaderRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, appConfiguration.id, appConfigDataReaderDefinition.id)
scope: appConfiguration
properties: {
roleDefinitionId: appConfigDataReaderDefinition.id
principalId: appService.identity.principalId
principalType: 'ServicePrincipal'
}
}

module configAppSettings '../shared/appservice-appsettings.bicep' = {
name: '${name}-appSettings'
params: {
name: appService.name
appSettings: union(
{
ENABLE_ORYX_BUILD: true
},
{
SCM_DO_BUILD_DURING_DEPLOYMENT: true
},
{
APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString
},
{
APPCONFIG_ENDPOINT: appConfiguration.properties.endpoint
},
appDefinition.settings)
}
}

output name string = appService.name
output uri string = 'https://${appService.properties.defaultHostName}'
Loading