Skip to content

Commit 146e9a3

Browse files
committed
edits
1 parent 13e097a commit 146e9a3

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

articles/container-apps/javascript-overview.md

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -174,58 +174,58 @@ For production builds, make sure you use the correct version tag, which may not
174174
## Deployment
175175
To support continuous integration/continuous deployment (CI/CD), set up a CI/CD pipeline using GitHub Actions, Azure DevOps, or another CI/CD tool to automate the deployment process.
176176

177-
```yaml
178-
# .github/workflows/deploy.yml
179-
name: Deploy to Azure
180-
181-
on:
182-
push:
183-
branches:
184-
- main
185-
186-
jobs:
187-
build-and-deploy:
188-
runs-on: ubuntu-latest
189-
190-
steps:
191-
- uses: actions/checkout@v4
192-
193-
- name: Set up Node.js
194-
uses: actions/setup-node@v4
195-
with:
196-
node-version: '22'
197-
198-
- name: Install dependencies
199-
run: npm ci
200-
201-
- name: Build the app
202-
run: npm run build
203-
204-
- name: Log in to Azure
205-
uses: azure/login@v2
206-
with:
207-
creds: ${{ secrets.AZURE_CREDENTIALS }}
208-
209-
- name: Deploy to Azure Container Apps
210-
run: |
211-
az containerapp up \
212-
--name my-container-app \
213-
--resource-group my-resource-group \
214-
--image my-docker-image \
215-
--environment my-environment \
216-
--cpu 1 --memory 2Gi \
217-
--env-vars NODE_ENV=production PORT=3000
218-
```
177+
```yaml
178+
# .github/workflows/deploy.yml
179+
name: Deploy to Azure
180+
181+
on:
182+
push:
183+
branches:
184+
- main
185+
186+
jobs:
187+
build-and-deploy:
188+
runs-on: ubuntu-latest
189+
190+
steps:
191+
- uses: actions/checkout@v4
192+
193+
- name: Set up Node.js
194+
uses: actions/setup-node@v4
195+
with:
196+
node-version: '22'
197+
198+
- name: Install dependencies
199+
run: npm ci
200+
201+
- name: Build the app
202+
run: npm run build
203+
204+
- name: Log in to Azure
205+
uses: azure/login@v2
206+
with:
207+
creds: ${{ secrets.AZURE_CREDENTIALS }}
208+
209+
- name: Deploy to Azure Container Apps
210+
run: |
211+
az containerapp up \
212+
--name my-container-app \
213+
--resource-group my-resource-group \
214+
--image my-docker-image \
215+
--environment my-environment \
216+
--cpu 1 --memory 2Gi \
217+
--env-vars NODE_ENV=production PORT=3000
218+
```
219219
220220
When using Docker Registry, sign into your registry then push your Docker images to a container registry like Azure Container Registry (ACR) or Docker Hub.
221221
222-
```bash
223-
# Tag the image
224-
docker tag my-app:latest myregistry.azurecr.io/my-app:latest
222+
```bash
223+
# Tag the image
224+
docker tag my-app:latest myregistry.azurecr.io/my-app:latest
225225

226-
# Push the image
227-
docker push myregistry.azurecr.io/my-app:latest
228-
```
226+
# Push the image
227+
docker push myregistry.azurecr.io/my-app:latest
228+
```
229229

230230
## Cold starts
231231

@@ -243,9 +243,9 @@ Security considerations for JavaScript developers using Azure Container Apps inc
243243

244244
Ensure sensitive information such as database connection strings and API keys are stored securely. Use Azure Key Vault to manage secrets and environment variables securely.
245245

246-
```bash
247-
az keyvault secret set --vault-name myKeyVault --name "CosmosDBConnectionString" --value "<your-connection-string>"
248-
```
246+
```bash
247+
az keyvault secret set --vault-name myKeyVault --name "CosmosDBConnectionString" --value "<your-connection-string>"
248+
```
249249

250250
### HTTPS and certificates
251251

@@ -255,9 +255,9 @@ Ensure your application is served over HTTPS. Azure Container Apps can manage [c
255255

256256
Regularly update your dependencies to avoid security vulnerabilities. Use tools like `npm audit` to check for vulnerabilities.
257257

258-
```bash
259-
npm audit
260-
```
258+
```bash
259+
npm audit
260+
```
261261

262262

263263
## Error handling
@@ -472,15 +472,15 @@ When your application runs into run time issues on Azure Container Apps, you can
472472

473473
Enable and configure logging to capture application logs. Use Azure Monitor and Log Analytics to collect and analyze logs.
474474

475-
First, create a new workspace.
475+
1. Create a new workspace.
476476

477477
```azurecli
478478
az monitor log-analytics workspace create \
479479
--resource-group my-resource-group \
480480
--workspace-name <WORKSPACE_NAME>
481481
```
482482

483-
Then create a new workspace setting.
483+
1. Then create a new workspace setting.
484484

485485
```azurecli
486486
az monitor diagnostic-settings create \
@@ -493,26 +493,26 @@ Then create a new workspace setting.
493493

494494
Use [remote debugging](#remote-debugging) tools to connect to your running container. Ensure your Dockerfile exposes the necessary ports for debugging.
495495

496-
```yaml
497-
# Expose the debugging port
498-
EXPOSE 9229
499-
```
496+
```yaml
497+
# Expose the debugging port
498+
EXPOSE 9229
499+
```
500500

501501
### Health checks
502502

503503
Configure health checks to monitor the health of your application. This feature ensures that Azure Container Apps can restart your container if it becomes unresponsive.
504504

505-
```yaml
506-
# Azure Container Apps YAML configuration
507-
properties:
508-
configuration:
509-
livenessProbe:
510-
httpGet:
511-
path: /health
512-
port: 3000
513-
initialDelaySeconds: 30
514-
periodSeconds: 10
515-
```
505+
```yaml
506+
# Azure Container Apps YAML configuration
507+
properties:
508+
configuration:
509+
livenessProbe:
510+
httpGet:
511+
path: /health
512+
port: 3000
513+
initialDelaySeconds: 30
514+
periodSeconds: 10
515+
```
516516

517517
## Related content
518518

0 commit comments

Comments
 (0)