6767 "jupyter.interactiveWindow.textEditor.executeSelection" : true ,
6868 "jupyter.notebookFileRoot" : " ${workspaceFolder}" ,
6969 "jupyter.kernels.excludePythonEnvironments" : [
70- " **/anaconda3/**" ,
71- " **/conda/**" ,
72- " **/miniconda3/**" ,
73- " **/python3.*" ,
74- " */site-packages/*" ,
75- " /bin/python" ,
76- " /bin/python3" ,
77- " /opt/python/*/bin/python*" ,
78- " /usr/bin/python" ,
79- " /usr/bin/python3" ,
80- " /usr/local/bin/python" ,
81- " /usr/local/bin/python3" ,
82- " python" ,
83- " python3"
70+ " **/anaconda3/**" ,
71+ " **/conda/**" ,
72+ " **/miniconda3/**" ,
73+ " **/python3.*" ,
74+ " */site-packages/*" ,
75+ " /bin/python" ,
76+ " /bin/python3" ,
77+ " /opt/python/*/bin/python*" ,
78+ " /usr/bin/python" ,
79+ " /usr/bin/python3" ,
80+ " /usr/local/bin/python" ,
81+ " /usr/local/bin/python3" ,
82+ " python" ,
83+ " python3"
8484 ],
8585 "jupyter.kernels.trusted" : [
8686 " /workspaces/Apim-Samples/.venv/bin/python"
8787 ],
8888 "files.associations" : {
8989 "*.bicep" : " bicep"
9090 },
91- // Auto-show terminal output during codespace startup
9291 "terminal.integrated.showExitAlert" : false ,
9392 "terminal.integrated.focusAfterRun" : " terminal" ,
9493 "terminal.integrated.defaultProfile.linux" : " bash" ,
9897 "workbench.startupEditor" : " none" ,
9998 "workbench.panel.defaultPanelHeight" : 400 ,
10099 "workbench.view.alwaysShowHeaderActions" : true ,
101- // Auto-open terminal panel on startup
102100 "workbench.action.terminal.focus" : true ,
103101 "workbench.action.togglePanel" : true ,
104102 "terminal.integrated.defaultLocation" : " view" ,
105- // Auto-allow clipboard operations in Codespaces
106103 "security.workspace.trust.enabled" : false ,
107104 "editor.experimental.pasteActions.enabled" : true ,
108105 "workbench.editor.enablePreview" : false
109106 }
110- }
111- },
112- "containerEnv" : {
113- "PYTHONPATH" : " /workspaces/Apim-Samples/shared/python:/workspaces/Apim-Samples"
114- },
115- // Container lifecycle commands for optimal Codespaces prebuild performance: https://containers.dev/implementors/features/#lifecycle-hooks
116- // 1. onCreateCommand: Runs only once during initial prebuild - creates venv
117- // 2. updateContentCommand: Runs during any prebuild when content changes - installs/updates packages
118- // 3. postStartCommand: Runs on every startup - verifies and configures
119- "onCreateCommand" : [
120- " bash" , " -c" ,
121- " echo '🚀 Creating Python virtual environment in workspace...' && /usr/local/bin/python3.12 -m venv /workspaces/Apim-Samples/.venv --copies && source /workspaces/Apim-Samples/.venv/bin/activate && pip install --upgrade pip setuptools wheel && echo '✅ Virtual environment created'"
122- ],
123- "updateContentCommand" : [
124- " bash" , " -c" ,
125- " echo '📦 Installing/updating Python packages from requirements.txt...' && source /workspaces/Apim-Samples/.venv/bin/activate && pip install -r requirements.txt && pip install pytest pytest-cov coverage ipykernel && echo '✅ Python packages installed/updated' && python setup/setup_python_path.py --generate-env && echo '✅ Environment configuration updated' && echo '🔧 Registering Jupyter kernel...' && python -m ipykernel install --user --name=apim-samples --display-name='APIM Samples Python 3.12' --python=" $(which python) " && echo '✅ Jupyter kernel registered' && echo '⚙️ Configuring Azure CLI...' && az config set core.login_experience_v2=off 2>/dev/null || true && az extension add --name containerapp --only-show-errors 2>/dev/null || true && az extension add --name front-door --only-show-errors 2>/dev/null || true && echo '✅ Azure CLI configured for Codespaces'"
126- ],
127- "postStartCommand" : [
128- " bash" , " -c" ,
129- " echo 'APIM Samples Codespace Starting - Keep this terminal open to see progress!' && bash .devcontainer/post-start-setup-2.sh"
130- ],
131- "forwardPorts" : [
132- 8000 ,
133- 8080 ,
134- 5000 ,
135- 3000
136- ],
137- "portsAttributes" : {
138- "8000" : {
139- "label" : " Python Development Server" ,
140- "onAutoForward" : " notify"
141107 },
142- "8080" : {
143- "label" : " Alternative HTTP Server" ,
144- "onAutoForward" : " notify"
108+ "containerEnv" : {
109+ "PYTHONPATH" : " /workspaces/Apim-Samples/shared/python:/workspaces/Apim-Samples"
145110 },
146- "5000" : {
147- "label" : " Flask Development Server" ,
148- "onAutoForward" : " notify"
111+ "onCreateCommand" : [
112+ " bash" ,
113+ " -c" ,
114+ " echo '🚀 Creating Python virtual environment in workspace...' && /usr/local/bin/python3.12 -m venv /workspaces/Apim-Samples/.venv --copies && source /workspaces/Apim-Samples/.venv/bin/activate && pip install --upgrade pip setuptools wheel && echo '✅ Virtual environment created'"
115+ ],
116+ "updateContentCommand" : [
117+ " bash" ,
118+ " -c" ,
119+ " echo '📦 Installing/updating Python packages from requirements.txt...' && source /workspaces/Apim-Samples/.venv/bin/activate && pip install -r requirements.txt && pip install pytest pytest-cov coverage ipykernel && echo '✅ Python packages installed/updated' && python setup/setup_python_path.py --generate-env && echo '✅ Environment configuration updated' && echo '🔧 Registering Jupyter kernel...' && python -m ipykernel install --user --name=apim-samples --display-name='APIM Samples Python 3.12' --python=\" $(which python)\" && echo '✅ Jupyter kernel registered' && echo '⚙️ Configuring Azure CLI...' && az config set core.login_experience_v2=off 2>/dev/null || true && az extension add --name containerapp --only-show-errors 2>/dev/null || true && az extension add --name front-door --only-show-errors 2>/dev/null || true && echo '✅ Azure CLI configured for Codespaces'"
120+ ],
121+ "postStartCommand" : [
122+ " bash" ,
123+ " -c" ,
124+ " echo 'APIM Samples Codespace Starting - Keep this terminal open to see progress!' && bash .devcontainer/post-start-setup-2.sh"
125+ ],
126+ "forwardPorts" : [
127+ 8000 ,
128+ 8080 ,
129+ 5000 ,
130+ 3000
131+ ],
132+ "portsAttributes" : {
133+ "8000" : {
134+ "label" : " Python Development Server" ,
135+ "onAutoForward" : " notify"
136+ },
137+ "8080" : {
138+ "label" : " Alternative HTTP Server" ,
139+ "onAutoForward" : " notify"
140+ },
141+ "5000" : {
142+ "label" : " Flask Development Server" ,
143+ "onAutoForward" : " notify"
144+ },
145+ "3000" : {
146+ "label" : " Node.js Development Server" ,
147+ "onAutoForward" : " notify"
148+ }
149149 },
150- "3000" : {
151- "label" : " Node.js Development Server" ,
152- "onAutoForward" : " notify"
153- }
154- },
155- "remoteUser" : " vscode" ,
156- "workspaceFolder" : " /workspaces/Apim-Samples" ,
157- "mounts" : [],
158- "runArgs" : [
159- " --init"
160- ]
150+ "remoteUser" : " vscode" ,
151+ "workspaceFolder" : " /workspaces/Apim-Samples" ,
152+ "mounts" : [],
153+ "runArgs" : [
154+ " --init"
155+ ]
156+ }
161157}
0 commit comments