Advanced (Atualizado: 19/07/2026)

Audite Azure DevOps Pipelines com Claude Code para agências

Fluxo de agência para PR, ManualValidation, aprovação de produção e rollback.

Audite Azure DevOps Pipelines com Claude Code para agências

Em uma agência web, pull request, URL de staging, aprovação do cliente e run do Azure Pipelines ficam em abas diferentes. Uma mudança pequena pode ir para produção porque todos acharam que outra pessoa conferiu. Este artigo transforma branch policies, ManualValidation e approvals em uma tabela de publicação.

Onde releases de agência falham

  • Separe aprovação de PR, revisão de staging, aprovação do cliente e aprovação de produção.
  • Use branch policies para proteger main ou release antes do merge.
  • Use ManualValidation para pausar e revisar staging URL e rollback.
  • Use environment approvals como porta antes de produção.
  • Claude Code resume YAML e diffs; cliente, preço, legal, data e rollback ficam com pessoas.

The source base is Microsoft Learn for pipeline deployment approvals, ManualValidation@1, release approvals, branch policies, and the tasks reference. For an internal release-flow pattern, see the agency cloud release article.

O que Claude Code prepara e humanos aprovam

Em uma agência web, pull request, URL de staging, aprovação do cliente e run do Azure Pipelines ficam em abas diferentes. Uma mudança pequena pode ir para produção porque todos acharam que outra pessoa conferiu. Este artigo transforma branch policies, ManualValidation e approvals em uma tabela de publicação. Claude Code should read pipeline YAML, PR template, diff summary, staging checklist, branch policy notes, and environment approval notes. It should output a release table that names branch, build, staging deploy, manual validation, production environment, approver, timeout, rollback note, and evidence link.

Humans keep client acceptance, ad claims, pricing, legal copy, publish timing, emergency exceptions, and rollback decision. This distinction keeps the agent from acting like the release owner. The agent prepares evidence; the agency decides.

Três casos de uso

Use case 1

Entrada: PR URL, diff, build, reviewers, branch policy, página alvo. Saída: tabela de PR, produção e cliente. Revisão humana: preços, texto legal, anúncios, aprovação do cliente, horário e rollback.

Use case 2

Entrada: staging URL, email, screenshots, diff, rollback, prazo. Saída: instructions de ManualValidation@1 e checklist. Revisão: mobile, formulário, imagens, links, analytics e OK do cliente.

Use case 3

Entrada: production environment, approvers, branch control, business hours, exclusive lock, canal. Saída: ordem, owner, timeout e contato. Revisão: sem autoaprovação, noite, campanha e owner de rollback.

Prompt para copiar

You are auditing an Azure DevOps release flow for a web agency.
Inputs: azure-pipelines.yml, PR template, branch policy memo, production environment approvals memo, staging URL checklist, and a recent rollback or rework note.
Output:
1. Three-column table: PR review, staging/client review, production approval.
2. ManualValidation@1 instruction text with staging URL, diff, rollback note, owner, and deadline.
3. Production environment approvals and checks proposal.
4. Branch policy list: reviewer, build validation, comment resolution, status check.
5. One first action that can be done in 30 minutes.
Rules: do not let the agent approve client acceptance, pricing, legal wording, publish timing, or production release.

Código de verificação

const pipelineText = [
  "trigger:",
  "  branches:",
  "    include:",
  "      - main",
  "stages:",
  "  - stage: Build",
  "    jobs:",
  "      - job: build",
  "        steps:",
  "          - script: npm ci && npm run build",
  "  - stage: DeployStaging",
  "    jobs:",
  "      - job: deploy_staging",
  "        steps:",
  "          - script: echo deploy staging",
  "  - stage: ClientCheck",
  "    jobs:",
  "      - job: wait_for_client",
  "        pool: server",
  "        steps:",
  "          - task: ManualValidation@1",
  "            inputs:",
  "              notifyUsers: [email protected]",
  "              instructions: Check staging URL, PR diff, rollback note, and client approval.",
  "  - stage: DeployProduction",
  "    jobs:",
  "      - deployment: production",
  "        environment: production",
  "        strategy:",
  "          runOnce:",
  "            deploy:",
  "              steps:",
  "                - script: echo deploy production"
].join(String.fromCharCode(10));

const required = [
  { name: "main branch trigger", pattern: /- main/ },
  { name: "staging stage", pattern: /DeployStaging/ },
  { name: "manual validation", pattern: /ManualValidation@1/ },
  { name: "server pool for manual validation", pattern: /pool:\s*server/ },
  { name: "production environment", pattern: /environment:\s*production/ },
  { name: "rollback note in approval text", pattern: /rollback/i }
];

const findings = [];
for (const rule of required) {
  if (!rule.pattern.test(pipelineText)) {
    findings.push({ item: rule.name, fix: "add this gate before production release" });
  }
}

const productionIndex = pipelineText.indexOf("DeployProduction");
const validationIndex = pipelineText.indexOf("ManualValidation@1");
if (productionIndex !== -1 && validationIndex !== -1 && validationIndex > productionIndex) {
  findings.push({
    item: "approval order",
    fix: "place client/manual validation before production deployment"
  });
}

console.table(findings);
if (findings.length > 0) process.exitCode = 1;

Pitfall: erros comuns

The first cause is treating PR approval as production approval. The fix is to separate code review, staging review, client acceptance, and production approval by name and owner.

The second cause is relying on notification recipients as if they were approvers. The fix is to inspect environment approval and project permissions separately from notifyUsers.

The third cause is approving without a rollback note. The fix is to add rollback commit, previous artifact, owner, and contact path to the approval text.

The fourth cause is bypassing branch policy under pressure. The fix is to define an emergency exception path with time limit, approver, evidence, and follow-up review.

Perguntas frequentes

Q. Should we use ManualValidation or environment approval? A. Use ManualValidation for an in-stage pause such as staging URL review. Use environment approvals and checks as the production gate.

Q. Should client approval live inside Azure DevOps? A. If the client does not use Azure DevOps, store the approval URL or message link in the release memo and tie it to the pipeline run.

Q. Does a small content change need branch policy? A. Yes. Pricing pages, hiring pages, and ad landing pages can affect leads and revenue even when the code diff is small.

Q. Can Claude Code approve the release? A. No. It can summarize diff, list missing evidence, and draft checklists. Humans approve production.

Caminho para consultoria

Para agências, valor não é mais YAML. É menos publicação errada e melhor evidência para cliente. Leve PR recente, YAML, checklist de staging e memo de rollback para a consultoria. Use Claude Code training and consultation if the team needs help turning PRs, pipeline YAML, staging checks, and rollback memos into a repeatable release workflow.

O que verifiquei

Verifiquei Microsoft Learn sobre approvals, ManualValidation@1, release approvals, branch policies e task reference. O código local verifica ManualValidation, server pool, production environment e rollback note. Primeiro passo: separar PR, staging e produção em três colunas.

#claude-code #agência #Azure DevOps #CI/CD #release
Grátis

PDF grátis: cheatsheet do Claude Code

Informe seu e-mail e baixe uma página com comandos, hábitos de revisão e workflows seguros.

Cuidamos dos seus dados e não enviamos spam.

Masa

Sobre o autor

Masa

Engenheiro focado em workflows práticos com Claude Code.