Token导航 LogoToken导航TokenDH.com
云服务敏感数据github未标认证来源可访问许可证需确认审计通过

deploying-to-azuredeploying TO Azure 部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

245

周安装

10

GitHub Stars

86

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:deploying-to-azure(deploying TO Azure 部署)
来源仓库:https://github.com/microsoft-foundry/foundry-agent-webapp
仓库路径:skills/deploying-to-azure
安装命令:
npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill deploying-to-azure
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill deploying-to-azure

简介

处理 Azure 容器应用部署日志分析与故障排查任务,自动委派子代理。

  • 适用于 RBAC 权限错误、多资源状态检查与容器启动失败诊断。
  • 通过 az containerapp logs show 等命令提取关键信息并生成修复建议。
  • 需具备 Azure CLI 访问权限,聚焦部署后阶段问题而非前期配置。
  • deploying-to-azure 属于云服务类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Deploying to Azure

Subagent Delegation for Deployment Analysis

Container logs and deployment output can be massive (1000+ lines). Delegate to subagent for:

  • Analyzing full deployment logs
  • Debugging container startup failures
  • RBAC permission troubleshooting
  • Multi-resource status checks

Delegation Pattern

runSubagent(
  prompt: "ANALYSIS task - analyze deployment issue.

    **Problem**: [describe the deployment failure]

    **Run these commands**:
    1. az containerapp logs show --name <app> --resource-group <rg> --tail 200
    2. az containerapp show --name <app> --resource-group <rg> --query 'properties.provisioningState'

    **Find**:
    - Error messages or stack traces
    - Resource provisioning failures
    - Configuration mismatches

    **Return** (max 15 lines):
    - Root cause (1-2 sentences)
    - Key error lines only (max 5)
    - Suggested fix command

    Do NOT include full log output.",
  description: "Debug: [deployment issue]"
)

When to Delegate vs Inline

Delegate to SubagentKeep Inline
Full log analysis (100+ lines)Quick status check
Multi-resource debuggingSingle az command
RBAC permission auditContainer image query
Startup failure diagnosisProvisioning state check

Quick Commands

CommandPurposeTime
azd upFull deployment (Entra app + infrastructure + container)10-12 min
azd deployCode-only deployment (Docker rebuild + push)3-5 min
azd provisionRe-run infrastructure + AI Foundry discovery5-7 min

Deployment Phases

  1. preprovision → AI Foundry auto-discovery + tenant detection. For CI: azd env set ENTRA_SERVICE_MANAGEMENT_REFERENCE "<guid>"
  2. provision → Deploy Azure resources via Bicep (infrastructure + Entra app via Microsoft Graph Bicep extension + placeholder container image)
  3. postprovision → Sets identifierUri on Entra app + updates redirect URIs + assigns RBAC to AI Foundry + generates local dev config
  4. predeploy → Builds container (local Docker or ACR cloud build)

Implementation:

  • infra/entra-app.bicep (Entra app registration via Microsoft Graph Bicep extension)
  • deployment/hooks/preprovision.ps1 (AI Foundry discovery)
  • deployment/hooks/postprovision.ps1 (Entra config + RBAC + local config generation)
  • deployment/hooks/predeploy.ps1 (container build + push)
  • deployment/hooks/modules/Get-AIFoundryAgents.ps1 (agent discovery via REST)

Docker Multi-Stage Build

Build order: React →.NET → Runtime

  • Frontend: deployment/docker/frontend.Dockerfile
  • Backend: deployment/docker/backend.Dockerfile
  • Custom npm registries: Add .npmrc to frontend/ directory

AI Foundry Resource Configuration

Auto-discovery (azd up): Searches subscription for AI Foundry resources → prompts to select if multiple → discovers agents via REST API → configures RBAC.

Change resource: Run azd provision to re-run discovery, or:

azd env set AI_FOUNDRY_RESOURCE_GROUP <rg>
azd provision

Container Infrastructure

  • Health Probes: Liveness (GET /api/health every 30s) and startup (GET /api/health every 10s, 5s initial delay) probes configured on the Container App
  • ACR Pull: Uses a user-assigned managed identity with AcrPull role — no admin credentials or secrets. The MI is created in main-infrastructure.bicep before the Container App, avoiding the chicken-and-egg problem.
  • Resource Defaults: 0.5 vCPU, 1GB RAM, 0-3 replicas (all parameterized in container-app.bicep)

Troubleshooting

IssueFix
VITE_ENTRA_SPA_CLIENT_ID not setRun azd up to generate .env files
AI_AGENT_ENDPOINT not configuredRun azd provision to re-discover AI Foundry
No AI Foundry resources foundCreate at https://ai.azure.com
Multiple AI Foundry resourcesRun azd provision to select different resource
Container not updatingCheck az containerapp logs show --name $app --resource-group $rg
Container fails health checkVerify /api/health endpoint returns 200 — check container logs for startup errors

Useful Commands

# Check current container image
az containerapp show --name $app --resource-group $rg `
    --query "properties.template.containers[0].image"

# View container logs
az containerapp logs show --name $app --resource-group $rg --tail 100

# Check RBAC assignments
$principalId = az containerapp show --name $app --resource-group $rg `
    --query "identity.principalId" -o tsv
az role assignment list --assignee $principalId

Preprovision Hook Details

File: deployment/hooks/preprovision.ps1

What it does:

  1. Discovers AI Foundry resources in subscription (prompts if multiple)
  2. Discovers agents via REST API using Get-AIFoundryAgents.ps1
  3. Auto-detects tenant ID
  4. Sets azd environment variables

Note: Entra app registration is handled by Bicep (infra/entra-app.bicep), not this hook.

Postprovision Hook Details

File: deployment/hooks/postprovision.ps1

What it does:

  1. Sets identifierUri (api://{clientId}) on Entra app — can't be done in Bicep because it references the auto-generated appId
  2. Updates Entra app redirect URIs (localhost + Container App FQDN)
  3. Assigns Cognitive Services User role to Container App's managed identity on AI Foundry resource (via Azure CLI, not Bicep)
  4. Generates local dev config files (.env.local for frontend, .env for backend)

Why RBAC via CLI?: Using Azure CLI for role assignment prevents azd from tracking the external AI Foundry resource group, avoiding accidental deletion on azd down.

Predeploy Hook Details

File: deployment/hooks/predeploy.ps1

What it does:

  1. Detects if Docker is available and running
  2. Uses local Docker build + push if available (~2 min)
  3. Falls back to ACR cloud build if Docker unavailable (~4-5 min)
  4. Updates Container App with new image (if it exists)
  5. Sets SERVICE_WEB_IMAGE_NAME env var for Bicep

Dockerfile Example

File: deployment/docker/frontend.Dockerfile (production build)

# Stage 1: Build React Frontend
FROM node:22-alpine AS frontend-builder
ARG ENTRA_SPA_CLIENT_ID
ARG ENTRA_TENANT_ID
WORKDIR /app/frontend
COPY frontend/ ./
RUN npm ci
# Remove local .env files to prevent localhost config
RUN rm -f .env.local .env.development .env
ENV NODE_ENV=production
ENV VITE_ENTRA_SPA_CLIENT_ID=$ENTRA_SPA_CLIENT_ID
ENV VITE_ENTRA_TENANT_ID=$ENTRA_TENANT_ID
RUN npm run build

# Stage 2: Build .NET Backend
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS backend-builder
WORKDIR /app
COPY backend/WebApp.sln ./
COPY backend/WebApp.Api/WebApp.Api.csproj ./backend/WebApp.Api/
COPY backend/WebApp.ServiceDefaults/WebApp.ServiceDefaults.csproj ./backend/WebApp.ServiceDefaults/
RUN dotnet restore backend/WebApp.Api/WebApp.Api.csproj
COPY backend/ ./backend/
RUN dotnet publish backend/WebApp.Api/WebApp.Api.csproj -c Release -o /app/publish

# Stage 3: Runtime - Single container serving API + static files
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine
WORKDIR /app
COPY --from=backend-builder /app/publish ./
COPY --from=frontend-builder /app/frontend/dist ./wwwroot
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Production
ENTRYPOINT ["dotnet", "WebApp.Api.dll"]

Related Skills

  • writing-csharp-code - Backend coding patterns for Container App configuration
  • writing-bicep-templates - Infrastructure templates for Azure resources
  • troubleshooting-authentication - Entra ID and RBAC debugging

Official Documentation

适合场景

01

Azure 资源规划

02

云服务升级

03

基础设施检查

04

企业云环境自动化

能力概览

能力 1

整理 Azure 服务操作流程

能力 2

提示 CLI/MCP 前置条件

能力 3

辅助云资源检查和规划

能力 4

保留官方服务来源线索

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.94%
按下载量换算28

Claude

27.92%
按下载量换算22

Cursor

19.29%
按下载量换算15

Gemini CLI

9.5%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills