Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Azdevify eshopOnWeb #844

Merged
merged 47 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
04895cc
Azdevify eshopOnWeb
Oct 25, 2022
c783174
Azdev-ify changes for latest /bicep/core
Nov 18, 2022
88a2778
Azdev-ify changes for latest /bicep/core
Nov 18, 2022
b2a3137
Remove some invalid changes
Nov 18, 2022
45ad9ed
add scripts folder and rename sqlserver
Nov 18, 2022
5b86898
Update bicep add azure.yaml scripts
jongio Dec 10, 2022
8697f4a
add azd in codespace
Dec 12, 2022
a949d4b
upgrade dotnet core 5.0 to 6.0 in order to install dotnet-ef
Dec 12, 2022
7f40d2d
install azd in codespace
Dec 12, 2022
04b88ff
install azd in codespace
Dec 12, 2022
5951b6d
Remove install azd in codespace, check some errors
Dec 12, 2022
c3479b9
Install azd in codespace, check some errors
Dec 12, 2022
cf9c718
Merge pull request #2 from jongio/Azdevify
zedy-wj Dec 12, 2022
e5c6f71
eliminate manually update the appsettings.json file
Dec 12, 2022
eba96d8
remove some invalid changes
Dec 12, 2022
b4853e2
fix indent
zedy-wj Dec 13, 2022
a4f4d69
Fix indent
zedy-wj Dec 13, 2022
50a8268
Remove invalid changes
Dec 13, 2022
a4427bc
Pull the connection string from key vault
Dec 14, 2022
9e82160
fix some bug
Dec 14, 2022
d495076
Remove some invalid changes
Dec 15, 2022
9a13af4
Fix format and update the method of pulling connection string from kv…
Dec 15, 2022
fc3f7b2
Remove invalid files
Jan 31, 2023
9955c69
Merge pull request #1 from zedy-wj/Azdevify
zedy-wj Jan 31, 2023
a9d4080
fix conflict
Jan 31, 2023
caa3ca2
Add version in Packages.prop
Jan 31, 2023
33d8d5c
Fix Azure.Identity version in Packages.prop
Jan 31, 2023
d27aeff
revert git version
Jan 31, 2023
2df331a
Merge branch 'main' of https://github.com/zedy-wj/eShopOnWeb
Jan 31, 2023
3bb6bf8
fix dotnet version
Jan 31, 2023
2a67d21
update readme
Feb 2, 2023
cdc079a
Add the AZD_TEMPLATE parameter in the configuration. When the value i…
Feb 7, 2023
69b2dc6
Modify some comments and fix format
Feb 7, 2023
7e99523
fix azd up command
Feb 8, 2023
3e0ca98
update variable
Feb 17, 2023
78dfbd7
update variable
Feb 17, 2023
a7b4199
use app.Environment.Isdevelopment to judge current env
Feb 20, 2023
bd9b618
use app.Environment.Isdevelopment to judge current env
Feb 20, 2023
0c13ff9
update according to comments
Mar 27, 2023
890f609
correct readme
Mar 28, 2023
b2ea136
fix conflict
Apr 20, 2023
d2753c7
fix possible null reference error
Aug 11, 2023
890e6df
update azd login to azd auth login
Aug 17, 2023
d7242d5
Merge branch 'main' of https://github.com/zedy-wj/eShopOnWeb
Aug 17, 2023
180b6e1
add a note in the instruction steps
Aug 23, 2023
a5bc07f
Merge branch 'main' of https://github.com/zedy-wj/eShopOnWeb
Aug 23, 2023
50d3ca5
Merge remote-tracking branch 'upstream/main'
Aug 25, 2023
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
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageVersion Include="Ardalis.ListStartupServices" Version="1.1.4" />
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" />
<PackageVersion Include="Azure.Identity" Version="1.6.0" />
<PackageVersion Include="Azure.Identity" Version="1.9.0-beta.2" />
<PackageVersion Include="BlazorInputFile" Version="0.2.0" />
<PackageVersion Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageVersion Include="BuildBundlerMinifier" Version="3.2.449" PrivateAssets="All" />
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,28 @@ powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1'
curl -fsSL https://aka.ms/install-azd.sh | bash
```

zedy-wj marked this conversation as resolved.
Show resolved Hide resolved
And you can also install with package managers, like winget, choco, and brew. For more detials, you can follow the documentation: https://aka.ms/azure-dev/install.
zedy-wj marked this conversation as resolved.
Show resolved Hide resolved

After logging in with the following command, you will be able to use the azd cli to quickly provision and deploy the application.

```
azd login
```

Then, just use the `azd up` command to complete all operations of clone, provision and deployment.
Then, executes the commands `azd init` to initializes environment.
zedy-wj marked this conversation as resolved.
Show resolved Hide resolved
```
azd init -t dotnet-architecture/eShopOnWeb
```
azd up -t dotnet-architecture/eShopOnWeb

And executes the commands `azd up` to complete all operations of provision and deployment.
zedy-wj marked this conversation as resolved.
Show resolved Hide resolved
```
azd up
```

According to the prompt, enter an `env name`, and select `subscription` and `location`, these are the necessary parameters when you create resources. Wait a moment for the resource deployment to complete, click the web endpoint and you will see the home page.

**Notes:**
Considering security, we store its related data (id, password) in the key vault when we create the database, and obtain it from the key vault when we use it. This is different from directly deploying applications locally.
Considering security, we store its related data (id, password) in the **Azure Key Vault** when we create the database, and obtain it from the Key Vault when we use it. This is different from directly deploying applications locally.

You can also run the sample directly locally (See below).

Expand Down
3 changes: 1 addition & 2 deletions infra/core/database/sqlserver/sqlserver.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource sqlServer 'Microsoft.Sql/servers@2022-05-01-preview' = {
resource firewall 'firewallRules' = {
name: 'Azure Services'
properties: {
// Allow all clients
// Allow all clients
// Note: range [0.0.0.0-0.0.0.0] means "allow all Azure-hosted clients only".
// This is not sufficient, because we also want to allow direct access from developer machine, for debugging purposes.
startIpAddress: '0.0.0.1'
Expand Down Expand Up @@ -127,4 +127,3 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
var connectionString = 'Server=${sqlServer.properties.fullyQualifiedDomainName}; Database=${sqlServer::database.name}; User=${appUser}'
output connectionStringKey string = connectionStringKey
output databaseName string = sqlServer::database.name
output connectionString string = connectionString
6 changes: 5 additions & 1 deletion infra/core/host/appservice.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ param minimumElasticInstanceCount int = -1
param numberOfWorkers int = -1
param scmDoBuildDuringDeployment bool = false
param use32BitWorkerProcess bool = false
param ftpsState string = 'FtpsOnly'
param healthCheckPath string = ''

resource appService 'Microsoft.Web/sites@2022-03-01' = {
name: name
Expand All @@ -43,12 +45,14 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
siteConfig: {
linuxFxVersion: linuxFxVersion
alwaysOn: alwaysOn
ftpsState: 'FtpsOnly'
ftpsState: ftpsState
minTlsVersion: '1.2'
appCommandLine: appCommandLine
numberOfWorkers: numberOfWorkers != -1 ? numberOfWorkers : null
minimumElasticInstanceCount: minimumElasticInstanceCount != -1 ? minimumElasticInstanceCount : null
use32BitWorkerProcess: use32BitWorkerProcess
functionAppScaleLimit: functionAppScaleLimit != -1 ? functionAppScaleLimit : null
healthCheckPath: healthCheckPath
cors: {
allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins)
}
Expand Down
2 changes: 1 addition & 1 deletion infra/core/security/keyvault-access.bicep
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param name string = 'add'

param keyVaultName string = ''
param keyVaultName string
param permissions object = { secrets: [ 'get', 'list' ] }
param principalId string

Expand Down
148 changes: 0 additions & 148 deletions src/Web/AzureDeveloperCliCredential.cs

This file was deleted.