-
Notifications
You must be signed in to change notification settings - Fork 1
Init - Add nodejs example with AZD template #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6f63a42
init
zhiyuanliang-ms 7eba0a6
update config
zhiyuanliang-ms 7dd1dcc
update readme
zhiyuanliang-ms 67818aa
update
zhiyuanliang-ms 38a0410
update
zhiyuanliang-ms 66dfc37
update
zhiyuanliang-ms e49f14c
update readme
zhiyuanliang-ms ff4d5f1
update
zhiyuanliang-ms 7948b8b
update
zhiyuanliang-ms f863955
update app to use token credential
zhiyuanliang-ms 5f115c2
use system assigned identity
zhiyuanliang-ms 1f08f06
use latest package
zhiyuanliang-ms 66743bf
update
zhiyuanliang-ms 9732f65
update
zhiyuanliang-ms db5d16b
update
zhiyuanliang-ms c5142d7
update
zhiyuanliang-ms 6c61011
not use inline createTelemetryPublisher
zhiyuanliang-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.