-
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 4 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 (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 | ||
| ``` | ||
zhiyuanliang-ms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| (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. | ||
zhiyuanliang-ms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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. | ||
zhiyuanliang-ms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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. | ||
zhiyuanliang-ms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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,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' | ||
zhiyuanliang-ms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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}' | ||
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.