Skip to content

Instantly share code, notes, and snippets.

@spboyer
Created January 30, 2026 20:36
Show Gist options
  • Select an option

  • Save spboyer/4db5a2164da54f3a13ae891676adedaf to your computer and use it in GitHub Desktop.

Select an option

Save spboyer/4db5a2164da54f3a13ae891676adedaf to your computer and use it in GitHub Desktop.
Copilot CLI Session: Fortune Cookie Function App deployment to Azure

Copilot CLI Session Recording

Session Metadata

Field Value
Session ID session-20260130-151839
Model claude-sonnet-4-20250514
Start Time 2026-01-30T20:18:39
End Time 2026-01-30T20:34:47
Duration ~16 minutes
Working Directory /Users/shboyer/github/func-fortune-peter
Git Branch Not a git repository

Environment

Component Version
OS Darwin
Shell /bin/zsh
Node Available
Azure CLI Available
Azure Functions Core Tools Available

Session Exchanges

Exchange 1: Start Recording

User Prompt:

start

Assistant Response: Started session recording with ID session-20260130-151839.

Tool Calls:

  • bash - Check git branch
  • view - View session_recorder.py
  • bash - Initialize recorder

Exchange 2: Create Fortune Cookie Function App

User Prompt:

Lets create a fortune cookie function app that will return a new fortune each call. Then deploy it to Azure

Assistant Response: Created a Node.js Azure Function app with fortune cookie functionality and deployed to Azure.

Tool Calls:

  1. view - View project directory
  2. azure-get_azure_bestpractices - Get Azure Functions best practices (learn)
  3. azure-get_azure_bestpractices - Get Azure Functions best practices (azurefunctions, all)
  4. ask_user - Ask for programming language preference → User selected: JavaScript/Node.js
  5. bash - Create host.json
  6. bash - Create package.json
  7. bash - Create local.settings.json
  8. bash - Create src/functions/fortune.js
  9. bash - npm install
  10. bash - Create infra/main.bicep
  11. bash - Create infra/abbreviations.json
  12. bash - Create infra/core/monitor/monitoring.bicep
  13. bash - Create infra/core/storage/storage-account.bicep
  14. bash - Create infra/core/host/functions-flexconsumption.bicep
  15. bash - Create azure.yaml
  16. bash - Create .gitignore
  17. bash - azd env new fortune-peter
  18. bash - azd env set AZURE_LOCATION eastus2
  19. bash - azd up (provisioning)
  20. bash - func azure functionapp publish (deployment - retry after RBAC propagation)
  21. bash - Get function key
  22. bash - curl test endpoint

Errors Encountered:

  • azd up deployment step failed due to duplicate azd-service-name: api tags
  • Initial func publish failed with 403 (RBAC propagation delay)
  • Resolved by waiting 30s for role assignment propagation

Outcome: ✅ Successfully deployed


Exchange 3: Portal URL

User Prompt:

portal url?

Assistant Response: Provided Azure Portal URL for the function app.

Tool Calls:

  • bash - az functionapp show (get resource ID)

Session Statistics

Metric Value
Total Exchanges 4
Total Tool Calls ~25
Total Errors 2 (resolved)
Files Created 10
Azure Resources Deployed 5 (RG, Storage, Log Analytics, App Insights, Function App)

Resources Created

Local Files

  • host.json - Function host configuration
  • package.json - Node.js dependencies
  • local.settings.json - Local development settings
  • src/functions/fortune.js - Fortune cookie HTTP function
  • azure.yaml - AZD project configuration
  • infra/main.bicep - Main infrastructure template
  • infra/main.parameters.json - Bicep parameters
  • infra/abbreviations.json - Resource naming abbreviations
  • infra/core/monitor/monitoring.bicep - Monitoring resources
  • infra/core/storage/storage-account.bicep - Storage account
  • infra/core/host/functions-flexconsumption.bicep - Function app (Flex Consumption)

Azure Resources

Resource Name Type
Resource Group rg-fortune-peter Microsoft.Resources/resourceGroups
Function App func-zcjssj7xls67i Microsoft.Web/sites
App Service Plan asp-* Microsoft.Web/serverfarms (FC1)
Storage Account st* Microsoft.Storage/storageAccounts
Application Insights appi-* Microsoft.Insights/components
Log Analytics log-* Microsoft.OperationalInsights/workspaces

Function Endpoint

https://func-zcjssj7xls67i.azurewebsites.net/api/fortune?code=50WbFnV-1NkfYYAxONhoXJoqTwqrGuXTMfPyxXgSBCCBAzFu8Gcs1w==

Sample Response

{
  "fortune": "Adventure can be real happiness.",
  "timestamp": "2026-01-30T20:32:18.350Z",
  "luckyNumbers": [12, 25, 30, 37, 46, 47]
}

Feedback/Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment