Index of every page on this site: llms.txt
All skills
microsoft avatar

/azure-upgrade

@0d60658
by microsoftmicrosoft/skills3.2k stars
373
Run it yourself

Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed Redis (AMR).

Use this Skill: https://skilld.dev/gh/microsoft/skills/azure-upgrade

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesservicesfunctionsconsumption-to-flexwindowsautomationconfiguration-inventory.md

≈1.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Configuration Inventory

Step 3: Pre-Migration — Collect Settings

💡 App settings themselves are migrated in Step 4c using a safe two-phase pattern. This section collects the other configuration (site config, identities, auth, access restrictions, deployment package) that must be replicated on the new app.

3a. Collect Application Configurations

Common site settings:

az functionapp config show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "{http20Enabled:http20Enabled, httpsOnly:httpsOnly, minTlsVersion:minTlsVersion, minTlsCipherSuite:minTlsCipherSuite, clientCertEnabled:clientCertEnabled, clientCertMode:clientCertMode, clientCertExclusionPaths:clientCertExclusionPaths}"

SCM basic publishing credentials policies:

az resource show --resource-group <RESOURCE_GROUP> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<APP_NAME> --query properties

Maximum scale-out limit:

az functionapp config appsettings list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?name=='WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT'].value" -o tsv

Runtime storage account:

AzureWebJobsStorage__accountName is safe to read directly when the source uses identity-based storage. Otherwise, extract AccountName from the secret-bearing AzureWebJobsStorage connection string in scoped memory. Display and record only the resolved storage resource metadata.

Bash:

(
  set -e
  trap 'unset storageConnection' EXIT
  storageName=$(az functionapp config appsettings list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?name=='AzureWebJobsStorage__accountName'].value | [0]" -o tsv)
  if [[ -z "$storageName" ]]; then
    storageAuthMode=connection-string
    storageConnection=$(az functionapp config appsettings list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?name=='AzureWebJobsStorage'].value | [0]" -o tsv)
    storageName=$(printf '%s' "$storageConnection" | awk -F';' '{for(i=1;i<=NF;i++){split($i,a,"="); if(tolower(a[1])=="accountname"){print a[2]; exit}}}')
  else
    storageAuthMode=identity-based
  fi
  if [[ ! "$storageName" =~ ^[a-z0-9]{3,24}$ ]]; then
    echo "Could not resolve a valid runtime storage account name." >&2
    exit 1
  fi
  storageJson=$(az graph query -q "resources | where type =~ 'microsoft.storage/storageaccounts' | where name =~ '$storageName' | project name, resourceGroup, subscriptionId, id" --query "data[0]" -o json)
  if [[ -z "$storageJson" || "$storageJson" == "null" ]]; then
    echo "Runtime storage account '$storageName' was not found in accessible subscriptions." >&2
    exit 1
  fi
  printf '%s\n' "$storageJson"
  printf 'Runtime storage authentication: %s\n' "$storageAuthMode"
)

PowerShell 7:

$storageConnection = $null
try {
    $storageName = az functionapp config appsettings list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?name=='AzureWebJobsStorage__accountName'].value | [0]" -o tsv
    if ([string]::IsNullOrWhiteSpace($storageName)) {
        $storageAuthMode = 'connection-string'
        $storageConnection = az functionapp config appsettings list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?name=='AzureWebJobsStorage'].value | [0]" -o tsv
        if ($storageConnection -match '(?:^|;)AccountName=([^;]+)') { $storageName = $Matches[1] }
    }
    else {
        $storageAuthMode = 'identity-based'
        $storageName = $storageName.Trim()
    }
    if ($storageName -notmatch '^[a-z0-9]{3,24}$') { throw 'Could not resolve a valid runtime storage account name.' }
    $storage = az graph query -q "resources | where type =~ 'microsoft.storage/storageaccounts' | where name =~ '$storageName' | project name, resourceGroup, subscriptionId, id" --query "data[0]" -o json | ConvertFrom-Json
    if ($null -eq $storage) { throw "Runtime storage account '$storageName' was not found in accessible subscriptions." }
    $storage | ConvertTo-Json
    Write-Output "Runtime storage authentication: $storageAuthMode"
}
finally {
    $storageConnection = $null
}

Record the safe name, resourceGroup, subscriptionId, id, and authentication mode. Never record or display the connection string. If the account cannot be resolved uniquely, stop and ask the user for its resource ID.

File share mount metadata:

az webapp config storage-account list --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[].{customId:name,accountName:value.accountName,shareName:value.shareName,type:value.type,mountPath:value.mountPath,state:value.state}" -o table

Record the custom ID, storage account name, share name, type, and mount path for every result. Windows Consumption doesn't support explicit storage mounts, even though the control plane can retain and return this metadata. Catalog it as not migrated and explain that it might be stale or never exercised by the source runtime. Don't retrieve storage keys or configure a target mount.

Custom domains (excluding the default *.azurewebsites.net):

az functionapp config hostname list --webapp-name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "[?!contains(name, 'azurewebsites.net')]" --output table

CORS settings:

az functionapp cors show --name <APP_NAME> --resource-group <RESOURCE_GROUP>

3b. Identify Managed Identities and Role Assignments

Get the system-assigned identity's principal ID:

az functionapp identity show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query principalId -o tsv

If the principal ID above is non-empty, list its role assignments (substitute <PRINCIPAL_ID>):

az role assignment list --assignee <PRINCIPAL_ID> --all

List user-assigned managed identities attached to the app:

az functionapp identity show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query userAssignedIdentities -o json

For each identity in the output, copy its principalId and list its role assignments using the same az role assignment list --assignee <PRINCIPAL_ID> --all command above.

3c. Check Built-in Authentication

az webapp auth show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "{enabled:enabled,unauthenticatedClientAction:unauthenticatedClientAction,defaultProvider:defaultProvider,tokenStoreEnabled:tokenStoreEnabled,allowedAudiences:allowedAudiences,allowedExternalRedirectUrls:allowedExternalRedirectUrls,isAuthFromFile:isAuthFromFile,providers:{aadClientId:clientId,githubClientId:gitHubClientId,googleClientId:googleClientId,facebookAppId:facebookAppId,twitterConsumerKey:twitterConsumerKey,microsoftAccountClientId:microsoftAccountClientId}}" -o json

Record only this nonsecret summary. Never query, display, or persist provider secret fields. If isAuthFromFile is true or the source uses a provider not represented by this projection, record that provider discovery requires manual review without displaying the auth file. Built-in authentication is handled in Step 4f.auth.

3d. Review Inbound Access Restrictions

az functionapp config access-restriction show --name <APP_NAME> --resource-group <RESOURCE_GROUP>

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts25d3 checks · Risk SAFE
  • Gen Agent Trust Hub25d

    This skill facilitates the assessment and automated upgrade of Azure workloads and Java SDK dependencies. It includes security considerations such as command execution and external resource retrieval, which are used appropriately within its intended functionality as a migration tool.

  • Socket25d

    No alerts

  • Snyk25d

    Risk: LOW · No issues

Signed by skilld at 0d60658. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
compatibility
python3.10+
metadata
{
  "author": "Microsoft",
  "version": "1.2.3"
}

README badge

README badge for microsoft/skills/azure-upgrade