forked from dotnet/eShopSupport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Update README.md * Update README.md * Update README.md Co-authored-by: Jordan Matthiesen <1333029+jmatthiesen@users.noreply.github.com> * Update README.md Co-authored-by: Jordan Matthiesen <1333029+jmatthiesen@users.noreply.github.com> --------- Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> Co-authored-by: Jordan Matthiesen <1333029+jmatthiesen@users.noreply.github.com>
- Loading branch information
1 parent
bacfcb6
commit 047bf9e
Showing
1 changed file
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,3 +1,108 @@ | ||
# eShopSupport | ||
|
||
A sample .NET application showcasing support via AI for an e-commerce website using a services-based architecture with .NET Aspire. | ||
Reference to the architecture here: [Architecture.pptx](https://github.com/dotnet/eShopSupport/blob/main/docs/Architecture.pptx) | ||
|
||
### Prerequisites | ||
|
||
- Clone the eShopSupport repository: [https://github.com/dotnet/eShopSupport](https://github.com/dotnet/eShopSupport) | ||
- Ensure you're on the lastest version of Products | ||
|
||
#### Windows with Visual Studio | ||
- Install [Visual Studio 2022 version 17.10 or newer](https://visualstudio.microsoft.com/vs/). | ||
- Select the following workloads: | ||
- `ASP.NET and web development` workload. | ||
- `.NET Aspire SDK` component in `Individual components`. | ||
- Optional: `.NET Multi-platform App UI development` to run client apps | ||
|
||
Or | ||
|
||
- Run the following commands in a Powershell & Terminal running as `Administrator` to automatically configure your environment with the required tools to build and run this application. (Note: A restart is required and included in the script below.) | ||
|
||
```powershell | ||
install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense -Force | ||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
get-WinGetConfiguration -file .\.configurations\vside.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements | ||
``` | ||
|
||
Or | ||
|
||
- From Dev Home go to `Machine Configuration -> Clone repositories`. Enter the URL for this repository. In the confirmation screen look for the section `Configuration File Detected` and click `Run File`. | ||
|
||
#### Mac, Linux, & Windows without Visual Studio | ||
- Install the latest [.NET 8 SDK](https://dot.net/download?cid=eshop) | ||
- Install the [.NET Aspire workload](https://learn.microsoft.com/dotnet/aspire/fundamentals/setup-tooling?tabs=dotnet-cli%2Cunix#install-net-aspire) with the following commands: | ||
```powershell | ||
dotnet workload update | ||
dotnet workload install aspire | ||
dotnet restore eShop.Web.slnf | ||
``` | ||
|
||
Or | ||
|
||
- Run the following commands in a Powershell & Terminal running as `Administrator` to automatically configuration your environment with the required tools to build and run this application. (Note: A restart is required after running the script below.) | ||
|
||
##### Install Visual Studio Code and related extensions | ||
```powershell | ||
install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense -Force | ||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
get-WinGetConfiguration -file .\.configurations\vscode.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements | ||
``` | ||
|
||
> Note: These commands may require `sudo` | ||
- Optional: Install [Visual Studio Code with C# Dev Kit](https://code.visualstudio.com/docs/csharp/get-started) | ||
|
||
> Note: When running on Mac with Apple Silicon (M series processor), Rosetta 2 for grpc-tools. | ||
### Azure Open AI | ||
|
||
When using Azure OpenAI, inside *eShopSupport.AppHost/appsettings.json*, add the following section: | ||
|
||
```json | ||
"ConnectionStrings": { | ||
"OpenAi": "Endpoint=xxx;Key=xxx;" | ||
} | ||
``` | ||
|
||
Replace the values with your own. Then, in the eShop.AppHost *Program.cs*, set this value to **true** | ||
|
||
```csharp | ||
bool useOpenAI = false; | ||
``` | ||
|
||
Here's additional guidance on the [.NET Aspire OpenAI component](https://learn.microsoft.com/dotnet/aspire/azureai/azureai-openai-component?tabs=dotnet-cli). | ||
|
||
### Use Azure Developer CLI | ||
|
||
You can use the [Azure Developer CLI](https://aka.ms/azd) to run this project on Azure with only a few commands. Follow the next instructions: | ||
|
||
- Install the latest or update to the latest [Azure Developer CLI (azd)](https://aka.ms/azure-dev/install). | ||
- Log in `azd` (if you haven't done it before) to your Azure account: | ||
```sh | ||
azd auth login | ||
``` | ||
- Initialize `azd` from the root of the repo. | ||
```sh | ||
azd init | ||
``` | ||
- During init: | ||
- Select `Use code in the current directory`. Azd will automatically detect the .NET Aspire project. | ||
- Confirm `.NET (Aspire)` and continue. | ||
- Select which services to expose to the Internet (exposing `webapp` is enough to test the sample). | ||
- Finalize the initialization by giving a name to your environment. | ||
|
||
- Create Azure resources and deploy the sample by running: | ||
```sh | ||
azd up | ||
``` | ||
Notes: | ||
- 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. | ||
- Report any issues to [azure-dev](https://github.com/Azure/azure-dev/issues) repo. | ||
- [FAQ and troubleshoot](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot?tabs=Browser) for azd. | ||
|
||
# Contributing | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. |