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
Copy file name to clipboardExpand all lines: articles/container-apps/javascript-overview.md
+54-54Lines changed: 54 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,58 +174,58 @@ For production builds, make sure you use the correct version tag, which may not
174
174
## Deployment
175
175
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.
176
176
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
+
```
219
219
220
220
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.
221
221
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
225
225
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
+
```
229
229
230
230
## Cold starts
231
231
@@ -243,9 +243,9 @@ Security considerations for JavaScript developers using Azure Container Apps inc
243
243
244
244
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.
245
245
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
+
```
249
249
250
250
### HTTPS and certificates
251
251
@@ -255,9 +255,9 @@ Ensure your application is served over HTTPS. Azure Container Apps can manage [c
255
255
256
256
Regularly update your dependencies to avoid security vulnerabilities. Use tools like `npm audit` to check for vulnerabilities.
0 commit comments