Skip to main content
Glama

azure_secrets_setup

Configure GitHub secrets to enable automated Azure deployments by securely storing required credentials and connection details.

Instructions

Set up GitHub secrets for Azure deployment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.js:1545-1617 (registration)
    Registration of the azure_secrets_setup MCP tool, including schema and inline handler implementation.
      "azure_secrets_setup",
      "Set up GitHub secrets for Azure deployment",
      {
        resource_group: { type: "string", description: "Azure resource group" },
        acr_name: { type: "string", description: "Azure Container Registry name" },
        sp_name: { type: "string", description: "Service principal name", default: "github-actions" }
      },
      async ({ resource_group, acr_name, sp_name }) => {
        // Get subscription ID
        const subId = await runCommand("az account show --query id -o tsv");
        if (!subId.success) {
          return {
            content: [{
              type: "text",
              text: `Not logged in to Azure!\n\nRun: az login`
            }]
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `AZURE GITHUB SECRETS SETUP
    ==========================
    
    Run these commands to set up secrets for GitHub Actions:
    
    STEP 1: Create Service Principal
    ---------------------------------
    az ad sp create-for-rbac --name "${sp_name}" \\
      --role contributor \\
      --scopes /subscriptions/${subId.stdout}/resourceGroups/${resource_group} \\
      --json-auth > azure-creds.json
    
    STEP 2: Add AZURE_CREDENTIALS secret
    ------------------------------------
    gh secret set AZURE_CREDENTIALS < azure-creds.json
    rm azure-creds.json  # Delete after setting secret!
    
    STEP 3: Grant ACR Access
    ------------------------
    # Get the service principal ID
    SP_ID=$(az ad sp list --display-name "${sp_name}" --query [0].appId -o tsv)
    
    # Grant push/pull access to ACR
    az role assignment create \\
      --assignee $SP_ID \\
      --role AcrPush \\
      --scope $(az acr show -n ${acr_name} --query id -o tsv)
    
    STEP 4: Optional - Add individual secrets
    -----------------------------------------
    gh secret set AZURE_ACR_NAME -b "${acr_name}"
    gh secret set AZURE_ACR_LOGIN_SERVER -b "${acr_name}.azurecr.io"
    gh secret set AZURE_RESOURCE_GROUP -b "${resource_group}"
    gh secret set AZURE_SUBSCRIPTION_ID -b "${subId.stdout}"
    
    VERIFY SECRETS:
    ---------------
    gh secret list
    
    SECURITY NOTES:
    ---------------
    - Service principal has contributor access to the resource group only
    - Rotate credentials periodically: az ad sp credential reset --id $SP_ID
    - For production, consider using managed identities instead`
          }]
        };
      }
    );
    
    // ============================================
    // GITHUB ACTIONS TOOLS
  • Handler function that checks Azure login, retrieves subscription ID using runCommand helper, and returns step-by-step text instructions for creating service principal, setting GitHub secrets, and granting ACR access.
        // Get subscription ID
        const subId = await runCommand("az account show --query id -o tsv");
        if (!subId.success) {
          return {
            content: [{
              type: "text",
              text: `Not logged in to Azure!\n\nRun: az login`
            }]
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `AZURE GITHUB SECRETS SETUP
    ==========================
    
    Run these commands to set up secrets for GitHub Actions:
    
    STEP 1: Create Service Principal
    ---------------------------------
    az ad sp create-for-rbac --name "${sp_name}" \\
      --role contributor \\
      --scopes /subscriptions/${subId.stdout}/resourceGroups/${resource_group} \\
      --json-auth > azure-creds.json
    
    STEP 2: Add AZURE_CREDENTIALS secret
    ------------------------------------
    gh secret set AZURE_CREDENTIALS < azure-creds.json
    rm azure-creds.json  # Delete after setting secret!
    
    STEP 3: Grant ACR Access
    ------------------------
    # Get the service principal ID
    SP_ID=$(az ad sp list --display-name "${sp_name}" --query [0].appId -o tsv)
    
    # Grant push/pull access to ACR
    az role assignment create \\
      --assignee $SP_ID \\
      --role AcrPush \\
      --scope $(az acr show -n ${acr_name} --query id -o tsv)
    
    STEP 4: Optional - Add individual secrets
    -----------------------------------------
    gh secret set AZURE_ACR_NAME -b "${acr_name}"
    gh secret set AZURE_ACR_LOGIN_SERVER -b "${acr_name}.azurecr.io"
    gh secret set AZURE_RESOURCE_GROUP -b "${resource_group}"
    gh secret set AZURE_SUBSCRIPTION_ID -b "${subId.stdout}"
    
    VERIFY SECRETS:
    ---------------
    gh secret list
    
    SECURITY NOTES:
    ---------------
    - Service principal has contributor access to the resource group only
    - Rotate credentials periodically: az ad sp credential reset --id $SP_ID
    - For production, consider using managed identities instead`
          }]
        };
      }
    );
    
    // ============================================
  • Input schema for the tool parameters: resource_group, acr_name, and sp_name.
      resource_group: { type: "string", description: "Azure resource group" },
      acr_name: { type: "string", description: "Azure Container Registry name" },
      sp_name: { type: "string", description: "Service principal name", default: "github-actions" }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a setup/mutation action but doesn't specify if it requires authentication, has side effects, or involves rate limits. This is a significant gap for a tool that likely modifies system state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core purpose without redundancy, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the likely complexity of setting up GitHub secrets for Azure (involving permissions, environment variables, etc.), the description is too sparse. With no annotations, no output schema, and minimal behavioral info, it leaves critical gaps for proper tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, but that's acceptable here. Baseline is 4 for zero parameters, as it avoids unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set up') and resource ('GitHub secrets for Azure deployment'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'github_secrets_set' or 'azure_setup_guide', which could have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'github_secrets_set' or 'azure_setup_guide'. It lacks context about prerequisites, timing, or exclusions, leaving the agent with minimal usage cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rideRTD/RTD-DevOps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server