azure-functions-devsec
Skill này làm gì
Công cụ này giúp bạn tạo và quản lý các ứng dụng chạy trên đám mây mà không cần lo về máy chủ. Nó lý tưởng cho các tác vụ cần xảy ra khi có sự kiện, chẳng hạn khi một tệp được tải lên hoặc một tin nhắn đến.
Khi nào nên dùng
- ✓Khi bạn muốn một chương trình tự động chạy mà không cần máy chủ riêng.
- ✓Khi bạn xây dựng các phần nhỏ của hệ thống để phản ứng với sự kiện.
- ✓Khi bạn cần xử lý dữ liệu đến từ các dịch vụ đám mây khác.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-functions-devsec/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm sao để tạo một hàm chạy khi có tệp mới được thêm vào Azure Storage?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn xác định điều gì sẽ kích hoạt hàm, chẳng hạn một tệp được thêm vào, và hàm cần làm gì. Đám mây sẽ tự chạy đoạn mã khi sự kiện đó xảy ra.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Azure Functions
Build and deploy serverless applications with Azure Functions. Covers function app creation, trigger and binding configuration, deployment strategies, real code examples in Python and Node.js, and production best practices.
When to Use
- You need event-driven compute that scales automatically to zero.
- You are building APIs, webhooks, or background processing pipelines.
- You want per-execution billing without managing servers.
- You need to respond to Azure service events (Blob Storage, Service Bus, Cosmos DB changes).
- You are implementing lightweight microservices or scheduled tasks.
Prerequisites
# Install Azure CLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Install Azure Functions Core Tools v4
npm install -g azure-functions-core-tools@4
# Verify installation
func --version
# Login
az login
az account set --subscription "my-subscription-id"
# Create supporting resources
az group create --name functions-rg --location eastus
az storage account create \
--name myfuncstorageacct \
--resource-group functions-rg \
--location eastus \
--sku Standard_LRS
Function App Creation
Consumption Plan (Pay-per-execution)
# Python function app on Consumption plan
az functionapp create \
--resource-group functions-rg \
--consumption-plan-location eastus \
--runtime python \
--runtime-version 3.11 \
--functions-version 4 \
--name myapp-func \
--storage-account myfuncstorageacct \
--os-type Linux
# Node.js function app
az functionapp create \
--resource-group functions-rg \
--consumption-plan-location eastus \
--runtime node \
--runtime-version 20 \
--functions-version 4 \
--name myapp-node-func \
--storage-account myfuncstorageacct \
--os-type Linux
Premium Plan (VNet integration, no cold start)
# Create Premium plan
az functionapp plan create \
--resource-group functions-rg \
--name myapp-premium-plan \
--location eastus \
--sku EP1 \
--is-linux true
# Create function app on Premium plan
az functionapp create \
--resource-group functions-rg \
--plan myapp-premium-plan \
--runtime python \
--runtime-version 3.11 \
--functions-version 4 \
--name myapp-premium-func \
--storage-account myfuncstorageacct
Trigger and Binding Examples
HTTP Trigger -- Python
# function_app.py (v2 programming model)
import azure.functions as func
import json
import logging
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)
@app.route(route="users/{userId}", methods=["GET"])
def get_user(req: func.HttpRequest) -> func.HttpResponse:
user_id = req.route_params.get("userId")
logging.info(f"Fetching user: {user_id}")
if not user_id:
return func.HttpResponse(
json.dumps({"error": "userId is required"}),
status_code=400,
mimetype="application/json"
)
user = {"id": user_id, "name": "Jane Doe", "email": "jane@example.com"}
return func.HttpResponse(
json.dumps(user),
status_code=200,
mimetype="application/json"
)
@app.route(route="users", methods=["POST"])
def create_user(req: func.HttpRequest) -> func.HttpResponse:
try:
body = req.get_json()
except ValueError:
return func.HttpResponse(
json.dumps({"error": "Invalid JSON"}),
status_code=400,
mimetype="application/json"
)
logging.info(f"Creating user: {body.get('name')}")
return func.HttpResponse(
json.dumps({"id": "new-id", **body}),
status_code=201,
mimetype="application/json"
)
HTTP Trigger -- Node.js
// src/functions/httpTrigger.js (v4 programming model)
const { app } = require("@azure/functions");
app.http("getUser", {
methods: ["GET"],
authLevel: "function",
route: "users/{userId}",
handler: async (request, context) => {
const userId = request.params.userId;
context.log(`Fetching user: ${userId}`);
if (!userId) {
return { status: 400, jsonBody: { error: "userId is required" } };
}
const user = { id: userId, name: "Jane Doe", email: "jane@example.com" };
return { status: 200, jsonBody: user };
},
});
app.http("createUser", {
methods: ["POST"],
authLevel: "function",
route: "users",
handler: async (request, context) => {
const body = await request.json();
context.log(`Creating user: ${body.name}`);
…
Câu hỏi thường gặp
“Serverless” nghĩa là gì?
Nghĩa là bạn không phải quản lý máy chủ. Đám mây lo mọi thứ, và bạn chỉ trả tiền cho phần bạn sử dụng.
Các ngôn ngữ lập trình nào được hỗ trợ?
Ví dụ này dùng Python và Node.js, nhưng các ngôn ngữ khác cũng được hỗ trợ.
“Trigger” và “binding” là gì?
“Trigger” là sự kiện khởi động hàm (ví dụ, một tệp mới). “Binding” kết nối hàm với các dịch vụ khác (ví dụ, đọc một tệp).
Chi tiết
Mô tả gốc của tác giả
Build serverless applications on Azure Functions. Configure triggers, bindings, and deployment. Use when implementing serverless workloads on Azure.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #3932
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.