Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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.

81 changes: 37 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,50 @@
# Project Name
# Quote of the Day - JavaScript (AZD)

(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.
```sh
az login
```

- OS
- Library version
- ...
- Initialize `azd` from the root of the repo.

### Installation
```sh
azd init
```

(ideally very short)
- During init:
- Enter an environment name for this deployment when prompted.
- Create Azure resources and deploy the sample by running:

- npm install [package name]
- mvn install
- ...
```sh
azd up
```

### Quickstart
(Add steps to get up and running quickly)
Notes:

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


## 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 takes a few minutes the first time it is ever run for an environment.
- At the end of the process, `azd` will display the `url` for the webapp. Follow that link to test the sample.
- You can run `azd up` after saving changes to the sample to re-deploy and update the sample.
- `azd down` is an easy way to delete the newly created resources. The Entra App Registration will not be removed and must be removed separately.
- Report any problems by opening an issue in [this repo](https://github.com/Azure-Samples/quote-of-the-day-dotnet/issues).
- [FAQ and troubleshoot](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot?tabs=Browser) 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-"
}
61 changes: 61 additions & 0 deletions infra/app/QuoteOfTheDay.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
param name string
param location string = resourceGroup().location
param tags object = {}

param identityName string
param applicationInsightsName string
@secure()
param appDefinition object
param appConfigurationConnectionString string
param appServicePlanId string

resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
name: identityName
location: location
}

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: 'UserAssigned'
userAssignedIdentities: { '${identity.id}': {} }
}
properties: {
serverFarmId: appServicePlanId
siteConfig: {
appCommandLine: 'npm start'
linuxFxVersion: 'NODE|20-lts'
alwaysOn: true
}
}
}

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_CONNECTION_STRING: appConfigurationConnectionString
},
appDefinition.settings)
}
}

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