Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dockerfile for Azure PowerShell devcontainer
# Use official .NET 8.0 image for amd64 architecture
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/dotnet:1-8.0

# Set working directory
WORKDIR /workspace

# Set default user to root for pwsh compatibility
USER root
17 changes: 6 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0",
// Use a Dockerfile for custom configuration

"context": "..",

"dockerFile": "Dockerfile",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
Expand All @@ -15,16 +18,8 @@
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
// }

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install -g autorest",
"postCreateCommand": "./.devcontainer/post-create.sh",

// Configure tool-specific properties.
"customizations": {
Expand Down
18 changes: 18 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we rewrite this into PowerShell script?

set -e

echo "� Updating npm..."
npm update -g npm

echo "�📦 Installing AutoRest..."
npm install -g autorest

echo "⚡ Installing platyPS..."
pwsh -c "Install-Module -Name platyPS -Force -Scope CurrentUser"

echo "🔐 Installing Az.Accounts for authentication..."
pwsh -c "Install-Module -Name Az.Accounts -Force -Scope CurrentUser"

echo "🧪 Installing PSScriptAnalyzer for static analysis..."
pwsh -c "Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser"