After deployment completes, you'll see "Your deployment is complete" ✅
- Click the "Outputs" tab on the left sidebar (see screenshots below)
- Find and copy the entire script value:
- Windows users: Copy
windowsSetupScript
- Mac/Linux users: Copy
macLinuxSetupScript
- Windows users: Copy
- Save it as a file and run:
First, click on "Outputs" in the left sidebar
Then copy your platform's setup script
Windows (PowerShell):
.\setup.ps1
If you get a security error, first run: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Mac/Linux (Terminal):
bash setup.sh
That's it! Your AI assistant is now running both in Azure and locally with all settings automatically configured. 🎉
- 🧠 GPT-4 Powered - Latest Azure OpenAI models
- 💾 Persistent Memory - Remembers conversations across sessions
- 🔐 Enterprise Security - Function-level authentication
- ⚡ Auto-scaling - Serverless Azure Functions
- 🎨 Web Chat Interface - Beautiful UI included
- 🔧 Zero Configuration - All Azure settings automatically configured
- Auto-installs Python 3.11 if not found (required for Azure Functions v4)
- Handles all path issues including spaces in "Program Files"
- Configures all Azure settings automatically from your deployment
- No manual editing required - everything just works!
- Stores conversation context per user
- Maintains shared knowledge base
- Persistent across sessions
- Modular agent architecture
- Easy to add custom agents
- Built-in memory management agents
For a comprehensive understanding of how this solution works, see our detailed architecture diagrams that show:
- Enterprise Architecture Overview - Complete flow from Microsoft Teams/Copilot Studio through Azure Functions to OpenAI
- Data Flow Sequence - Step-by-step message processing with timing
- Component Architecture - All Azure resources and their relationships
- Agent Execution Flow - How agents are loaded, executed, and orchestrated
- Memory Architecture - File share structure for shared and user-specific memories
- Deployment Architecture - From GitHub to Azure with automated configuration
- Copilot Studio Integration - How to connect this function to Microsoft Copilot Studio
graph LR
A[Microsoft Teams User] --> B[Copilot Studio]
B --> C[Azure Function]
C --> D[AI Agents]
D --> E[Azure OpenAI GPT-4o]
D --> F[Azure File Share<br/>Memory Storage]
E --> C
F --> C
C --> B
B --> A
style A fill:#50E6FF,stroke:#fff,stroke-width:2px
style B fill:#7F5AF0,stroke:#fff,stroke-width:2px
style C fill:#0078D4,stroke:#fff,stroke-width:2px
style D fill:#8B5CF6,stroke:#fff,stroke-width:2px
style E fill:#10A37F,stroke:#fff,stroke-width:2px
style F fill:#FFB900,stroke:#fff,stroke-width:2px
Tech Stack: Azure Functions (Python 3.11) → Azure OpenAI GPT-4o → Azure Storage → Application Insights
The setup script will automatically install missing components, but you'll need:
- Azure Account - Get free trial
- PowerShell - Already installed on Windows
- Everything else auto-installs! ✨
- Azure Account - Get free trial
- Python 3.9-3.11 -
brew install python@3.11
(Mac) orapt-get install python3.11
(Linux) - Git -
brew install git
(Mac) orapt-get install git
(Linux) - Node.js -
brew install node
(Mac) or from nodejs.org
Then install Azure Functions Core Tools:
npm install -g azure-functions-core-tools@4
Once setup is complete, you can start your bot anytime with:
cd Copilot-Agent-365
.\run.ps1
cd Copilot-Agent-365
./run.sh
Then:
- Local API: http://localhost:7071/api/businessinsightbot_function
- Web Chat: Open
client/index.html
in your browser - Azure URL: Automatically shown after setup (includes auth key)
Invoke-RestMethod -Uri "http://localhost:7071/api/businessinsightbot_function" `
-Method Post `
-Body '{"user_input": "Hello", "conversation_history": []}' `
-ContentType "application/json"
curl -X POST http://localhost:7071/api/businessinsightbot_function \
-H "Content-Type: application/json" \
-d '{"user_input": "Hello", "conversation_history": []}'
Edit these in Azure Portal → Function App → Configuration:
ASSISTANT_NAME
- Your bot's nameCHARACTERISTIC_DESCRIPTION
- Your bot's personality
Create new file in agents/
folder:
from agents.basic_agent import BasicAgent
class MyCustomAgent(BasicAgent):
def __init__(self):
self.name = 'MyCustom'
self.metadata = {
"name": self.name,
"description": "What this agent does",
"parameters": {
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "Input parameter"
}
},
"required": ["input"]
}
}
super().__init__(self.name, self.metadata)
def perform(self, **kwargs):
input_data = kwargs.get('input', '')
# Your logic here
return f"Processed: {input_data}"
- Azure deploys all resources (OpenAI, Storage, Function App)
- Setup script is generated with YOUR credentials embedded
- Running the script:
- Installs Python 3.11 if needed
- Clones the repository
- Creates
local.settings.json
with your Azure values - Sets up Python environment
- Installs all dependencies
- Creates run scripts
The setup script automatically includes:
- ✅ Your Azure Storage connection string
- ✅ Your OpenAI API key and endpoint
- ✅ Your Function App details
- ✅ All other required settings
Copilot-Agent-365/
├── function_app.py # Main Azure Function
├── agents/ # AI agents
│ ├── basic_agent.py # Base agent class
│ ├── context_memory_agent.py
│ └── manage_memory_agent.py
├── utils/ # Utilities
│ └── azure_file_storage.py
├── client/ # Web UI
│ └── index.html
├── requirements.txt # Python dependencies
├── host.json # Azure Functions config
├── run.ps1 # Windows run script (auto-created)
├── run.bat # Windows batch script (auto-created)
├── run.sh # Mac/Linux run script (auto-created)
└── local.settings.json # Azure settings (auto-created with YOUR values)
Issue | Solution |
---|---|
"Python 3.11 not found" | Script auto-installs it! Just wait 2-3 minutes |
"C:\Program Files" error | Fixed! Script handles spaces in paths |
"func: command not found" | Run: npm install -g azure-functions-core-tools@4 |
Port already in use | Edit run.ps1 or run.sh and change to func start --port 7072 |
"az login" needed | Run az login to deploy code to Azure (optional) |
- Use Python 3.11 (automatically installed by script)
- Don't use Python 3.13+ (causes compatibility issues with Azure Functions)
- Script specifically installs and uses Python 3.11 to avoid issues
- Function App: ~$0 (free tier covers most usage)
- Storage: ~$5/month
- OpenAI: Pay per token used (~$0.01 per 1K tokens)
Total: ~$5/month + OpenAI usage
- API keys are embedded securely in the generated setup script
- Never commit
local.settings.json
to Git (contains secrets) - Function requires authentication key for API access
- All traffic uses HTTPS
- Keys are unique to your deployment
- ✨ Auto-configuration - No manual editing of settings
- 🔧 Python path fix - Handles "Program Files" spaces
- 🐍 Python 3.11 auto-install - Windows script installs if missing
- 📦 Fixed package versions - Prevents compatibility issues
- 🚀 True one-click deploy - Everything configured automatically
- Fork the repo
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit changes (
git commit -m 'Add some AmazingFeature'
) - Push to branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
MIT License - See LICENSE
- Issues: GitHub Issues
- Discussions: GitHub Discussions
This project makes enterprise AI accessible to everyone by:
- Removing complexity - One-click deployment with zero configuration
- Handling all setup - Automatically installs and configures everything
- Providing memory - Your AI remembers context across conversations
- Enabling customization - Easy to add your own agents and features
Deploy your own AI assistant in under 3 minutes!
⭐ Star this repo if it helped you!
Made with ❤️ for the community