You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,26 +47,69 @@ All packages from `requirements.txt` are pre-installed:
47
47
### Environment Configuration
48
48
-**PYTHONPATH** - Automatically configured to include shared Python modules
49
49
-**Jupyter Kernel** - Custom kernel named "APIM Samples Python"
50
-
-**Azure CLI** - Configured for container-friendly authentication
50
+
-**Azure CLI** - Installed and ready for authentication (requires tenant-specific `az login` inside container)
51
51
-**Port Forwarding** - Common development ports (3000, 5000, 8000, 8080) pre-configured
52
52
53
53
## 🔧 Post-Setup Steps
54
54
55
-
After the container starts, you'll need to:
55
+
The dev container automatically handles most setup during initialization. During the first build, you'll be prompted to configure Azure CLI authentication.
56
56
57
-
1.**Sign in to Azure**:
58
-
```bash
59
-
az login
60
-
```
57
+
### Automated Interactive Setup (During First Build)
58
+
When the container starts for the first time, the setup script will automatically:
59
+
1.**Install all dependencies** (Python packages, Azure CLI extensions)
60
+
2.**Configure Jupyter environment** with custom kernel
61
+
3.**Prompt for Azure CLI configuration**:
62
+
- Mount local Azure config (preserves login between rebuilds)
63
+
- Use manual login (run tenant-specific `az login` each time)
64
+
- Configure manually later
65
+
66
+
### Manual Configuration (If Needed Later)
67
+
If you skipped the initial configuration or want to change it:
68
+
69
+
**Interactive Setup**:
70
+
```bash
71
+
python .devcontainer/configure-azure-mount.py
72
+
```
73
+
74
+
**Manual Azure Login**:
75
+
```bash
76
+
# Log in to your specific tenant
77
+
az login --tenant <your-tenant-id-or-domain>
61
78
62
-
2.**Verify your Azure setup**:
63
-
Execute `shared/jupyter/verify-az-account.ipynb`
79
+
# Set your target subscription
80
+
az account set --subscription <your-subscription-id-or-name>
81
+
82
+
# Verify your authentication context
83
+
az account show
84
+
```
64
85
86
+
### Continue with Development
87
+
After setup is complete:
88
+
1.**Verify your Azure setup**: Execute `shared/jupyter/verify-az-account.ipynb`
89
+
2.**Test your environment**: Run `python .devcontainer/verify-setup.py`
65
90
3.**Start exploring**:
66
91
- Navigate to any infrastructure folder (`infrastructure/`)
67
92
- Run the `create.ipynb` notebook to set up infrastructure
68
93
- Explore samples in the `samples/` directory
69
94
95
+
## 🔧 Troubleshooting
96
+
97
+
If you encounter import errors or module resolution issues, see:
@@ -77,10 +120,67 @@ The dev container is built on:
77
120
78
121
## 🔄 Azure CLI Authentication
79
122
80
-
The container mounts your local `~/.azure` directory to preserve authentication state between container rebuilds. This means:
81
-
- Your Azure login persists across sessions
82
-
- Your Azure CLI configuration is maintained
83
-
- No need to repeatedly authenticate
123
+
### Quick Setup (Recommended)
124
+
125
+
Run the interactive configuration script to automatically set up Azure CLI authentication for your platform:
126
+
127
+
**Python (Cross-platform)**:
128
+
```bash
129
+
python .devcontainer/configure-azure-mount.py
130
+
```
131
+
132
+
**PowerShell (Windows)**:
133
+
```powershell
134
+
.\.devcontainer\configure-azure-mount.ps1
135
+
```
136
+
137
+
**Bash (Linux/macOS)**:
138
+
```bash
139
+
./.devcontainer/configure-azure-mount.sh
140
+
```
141
+
142
+
### Configuration Options
143
+
144
+
The setup script provides three choices:
145
+
146
+
**Option 1: Mount local Azure CLI config**
147
+
- ✅ Preserves login between container rebuilds
148
+
- ✅ Uses your existing tenant-specific `az login` from host machine
149
+
- ✅ Works on Windows (`${localEnv:USERPROFILE}/.azure`) and Unix (`${localEnv:HOME}/.azure`)
150
+
- ✅ Best for: Personal development with stable logins
151
+
152
+
**Option 2: Use manual login inside container [RECOMMENDED]**
153
+
- ✅ Run tenant-specific `az login` each time container starts
154
+
- ✅ More secure, fresh authentication each session
155
+
- ✅ Works universally across all platforms and environments
156
+
- ✅ Best for: Shared environments, GitHub Codespaces
157
+
- ✅ Ensures you're working with the correct tenant and subscription
158
+
159
+
**Option 3: Configure manually later**
160
+
- ✅ No changes made to devcontainer.json
161
+
- ✅ You can edit the configuration files yourself
162
+
- ✅ Full control over mount configuration
163
+
164
+
### Mount Preservation
165
+
166
+
The configuration script intelligently preserves any existing mounts (like SSH keys, additional volumes) while only managing Azure CLI mounts. This ensures your custom development setup remains intact.
167
+
168
+
### Non-Interactive Environments
169
+
170
+
In environments like GitHub Codespaces automation, the script automatically detects non-interactive contexts and safely defaults to Option 2 (manual login) for maximum reliability.
171
+
172
+
### Manual Options
173
+
174
+
**Option 1: Mount Local Azure Config**
175
+
- Preserves authentication between container rebuilds
176
+
- Platform-specific (configured automatically by the setup script)
177
+
178
+
**Option 2: Manual Login**
179
+
- Log in to your specific tenant: `az login --tenant <your-tenant-id-or-domain>`
180
+
- Set your target subscription: `az account set --subscription <your-subscription-id-or-name>`
181
+
- Verify context: `az account show`
182
+
- Works universally across all platforms
183
+
- Requires re-authentication after container rebuilds
84
184
85
185
## 🐛 Troubleshooting
86
186
@@ -119,7 +219,7 @@ If you need to rebuild the container:
119
219
120
220
## 🔒 Security Considerations
121
221
122
-
- Azure credentials are mounted from your local machine
222
+
- Azure credentials are handled through tenant-specific `az login` inside the container (or optionally mounted)
123
223
- The container runs as a non-root user (`vscode`)
124
224
- All dependencies are installed from official sources
125
225
- Network access is controlled through VS Code's port forwarding
0 commit comments