Skip to content
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

chore: Add dev container #377

Merged
merged 14 commits into from
Jan 6, 2025
Merged

chore: Add dev container #377

merged 14 commits into from
Jan 6, 2025

Conversation

DaveSkender
Copy link
Member

@DaveSkender DaveSkender commented Jan 6, 2025

Fixes #376

  • Add a Dev Container configuration to the repository
  • Update .NET packages
  • Add, update/fix use of key vault
  • Update/fix README.md

For more details, open the Copilot Workspace session.

Fixes #376

Add a Dev Container configuration to the repository.

* **Dev Container Configuration**
  - Add `.devcontainer/devcontainer.json` with configurations for .NET SDK 9, Node LTS, NPM latest, GitHub CLI, Angular CLI, Azure Functions Core Tools, PowerShell, and ESLint.
  - Include environment variables `ALPACA_KEY`, `ALPACA_SECRET`, and `AzureWebJobsStorage`.

* **README.md Updates**
  - Add instructions for using the Dev Container.
  - Add instructions for setting up Azure Key Vault for storing secrets.
  - Add instructions for using User Secrets for local development.

* **Project File Updates**
  - Update `server/Functions/Functions.csproj` and `server/WebApi/WebApi.csproj` to include references to Azure Key Vault SDK and Azure Identity.

* **Code Updates**
  - Update `server/Functions/UpdateQuotes.cs` to retrieve `ALPACA_KEY` and `ALPACA_SECRET` from environment variables, User Secrets, and Azure Key Vault in the recommended order of precedence.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/facioquo/stock-charts/issues/376?shareId=XXXX-XXXX-XXXX-XXXX).
@Copilot Copilot bot review requested due to automatic review settings January 6, 2025 04:17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • .devcontainer/devcontainer.json: Language not supported
  • server/Functions/Functions.csproj: Language not supported
  • server/WebApi/WebApi.csproj: Language not supported
Comments suppressed due to low confidence (5)

server/Functions/UpdateQuotes.cs:46

  • [nitpick] The variable name alpacaKey is inconsistently cased compared to the original ALPACA_KEY. It should be renamed to ALPACA_KEY.
string? alpacaKey = _configuration["ALPACA_KEY"];

server/Functions/UpdateQuotes.cs:47

  • [nitpick] The variable name alpacaSecret is inconsistently cased compared to the original ALPACA_SECRET. It should be renamed to ALPACA_SECRET.
string? alpacaSecret = _configuration["ALPACA_SECRET"];

server/Functions/UpdateQuotes.cs:65

  • The error message for missing Key Vault URL could be more descriptive. Suggested fix: "Key Vault URL is missing. Please set it using setx KEY_VAULT_URL \"MY-KEY-VAULT-URL\"."
throw new ArgumentNullException(keyVaultUrl, "Key Vault URL missing, use `setx KEY_VAULT_URL \"MY-KEY-VAULT-URL\"` to set.");

server/Functions/UpdateQuotes.cs:81

  • The error message for missing API KEY could be more descriptive. Suggested fix: "API KEY is missing. Please set it using setx ALPACA_KEY \"MY-ALPACA-KEY\"."
throw new ArgumentNullException(alpacaKey, "API KEY missing, use `setx ALPACA_KEY \"MY-ALPACA-KEY\"` to set.");

server/Functions/UpdateQuotes.cs:88

  • The error message for missing API SECRET could be more descriptive. Suggested fix: "API SECRET is missing. Please set it using setx ALPACA_SECRET \"MY-ALPACA-SECRET\"."
throw new ArgumentNullException(alpacaSecret, "API SECRET missing, use `setx ALPACA_SECRET \"MY-ALPACA-SECRET\"` to set.");
@DaveSkender DaveSkender self-assigned this Jan 6, 2025
@DaveSkender DaveSkender marked this pull request as draft January 6, 2025 05:38
@DaveSkender DaveSkender marked this pull request as ready for review January 6, 2025 06:24
@DaveSkender DaveSkender requested a review from Copilot January 6, 2025 06:24

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (6)
  • .devcontainer/devcontainer.json: Language not supported
  • client/package.json: Language not supported
  • client/src/styles.scss: Language not supported
  • server/Directory.Packages.props: Language not supported
  • server/Functions/Functions.csproj: Language not supported
  • server/WebApi/WebApi.csproj: Language not supported
@DaveSkender DaveSkender enabled auto-merge (squash) January 6, 2025 06:24
@DaveSkender DaveSkender merged commit 0253bdb into main Jan 6, 2025
8 checks passed
@DaveSkender DaveSkender deleted the DaveSkender/add-dev-container branch January 6, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

add dev container
1 participant