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: docs/workshop.md
+63-5Lines changed: 63 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -852,7 +852,7 @@ That wasn't much work, right?
852
852
It's now time to test our API! First we need to start the server. Run the following command in the terminal:
853
853
854
854
```bash
855
-
npm run start:server
855
+
npm run dev:server
856
856
``` -->
857
857
858
858
---
@@ -965,13 +965,71 @@ jobs:
965
965
966
966
Not bad! Copilot did a great job here, but we still need to change a few things to make it work.
967
967
968
-
In the last command in the bottom, we'll replace the web app name and the resource group. It's no secrets, so we can put in there directly.
968
+
The last command is not enough to deploy our app, since we also need to create a Cosmos DB database and set the connection string.
969
969
970
-
- Replace `${{ secrets.AZURE_WEBAPP_NAME }}` with `"todo-copilot-${{github.actor}}"`. We're using `${{github.actor}}` to get your GitHub username, so we have a unique name for the web app.
970
+
Remove the command entirely, and let's go step by step to ask Copilot what we need. Add this first comment:
971
971
972
-
- Replace `${{ secrets.AZURE_RESOURCE_GROUP }}` with `"rg-copilot-nodejs-todo"`.
972
+
```bash
973
+
# Create resource group rg-copilot-nodejs-todo
974
+
```
975
+
976
+
Hit `enter`, and Copilot should suggest this command for you:
977
+
978
+
```bash
979
+
az group create --name rg-copilot-nodejs-todo --location eastus
980
+
```
981
+
982
+
Accept it, then now add this comment to create the database:
983
+
984
+
```bash
985
+
# Create cosmosdb with default api
986
+
```
987
+
988
+
Copilot should come up with something like this:
989
+
990
+
```bash
991
+
az cosmosdb create --name copilot-nodejs-todo --resource-group rg-copilot-nodejs-todo
992
+
```
993
+
994
+
Great! Accept it, and continue with this comment:
995
+
996
+
```bash
997
+
# Deploy webapp using node 18
998
+
```
999
+
1000
+
Now it you suggest a command similar than what it did in the first place:
1001
+
1002
+
```bash
1003
+
az webapp up --sku F1 --name copilot-nodejs-todo --resource-group rg-copilot-nodejs-todo --runtime "node|18-lts"
1004
+
```
1005
+
1006
+
Again, accept it, but we'll need to tweak the `--name` option a bit to make it unique, as it will also serve as the URL for your web app. Change it to something like `--name nodejs-todo-YOUR_GITHUB_USERNAME`.
1007
+
1008
+
And now we need to retrieve the connection string. Add this comment:
1009
+
1010
+
```bash
1011
+
# Retrieve cosmosdb connection string
1012
+
```
1013
+
1014
+
And start typing `DATABASE_CONNECTION_STRING=` so it know that we want to get the result inside this variable. Copilot should complete the line with:
0 commit comments