Static Web Apps ARM zipdeploy returns 405 Method Not Allowed

wanb 0 Reputation points
2026-11-24T02:30:45.1833333+00:00

An Azure Static Web App in West US 2, on the Standard plan, fails when deploying a prebuilt static app through the documented Static Sites ZIP deployment REST API.

Deployment flow

  1. Authenticate a service principal using the Microsoft Entra ID OAuth 2.0 client-credentials flow. Obtain separate tokens for Azure Storage and Azure Resource Manager.
  2. Package the static files into a ZIP with index.html at its root. Upload it to a private Blob container using PUT https://{account}.blob.core.windows.net/{container}/{blob} with x-ms-blob-type: BlockBlob.
  3. Send a HEAD request to the blob and verify its ETag and uploaded metadata.
  4. Obtain a user delegation key using POST https://{account}.blob.core.windows.net/?restype=service&comp=userdelegationkey, then generate a read-only, HTTPS-only Blob SAS URL valid for 30 minutes. Blob requests use x-ms-version: 2023-11-03.
  5. Send the following ARM request with the management token:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{siteName}/zipdeploy?api-version=2025-03-01

Content-Type: application/json

{

"properties": {

 "appZipUrl": "<short-lived read-only Blob SAS URL>",

 "provider": "aova",

 "deploymentTitle": "<deployment-id>"

}

}

Observed result

The Blob upload, metadata verification and user-delegation-key request succeeded. At 2026-11-23 16:17:27 UTC, Azure Activity Log recorded the ARM zipdeploy/action as failed with MethodNotAllowed. The log confirms the request method was POST and the path and API version were as shown above.

A later GET of the same ZIP using a newly generated SAS succeeded and matched the expected hash; this does not verify the original SAS used in the failed deployment. Storage-account metrics showed no GetBlob in the failure window, but these are aggregated metrics, not per-request logs.

A subsequent deployment with SWA CLI 2.1.0 and a deployment token succeeded on the same site. It used a different package and deployment path, so it is not a controlled comparison. We found no relevant Azure service-health event.

Questions

  1. Is this ARM ZIP deployment operation supported for this configuration, including service-principal authentication and a user-delegation SAS URL?
  2. Are there additional request requirements, such as supported provider values or other properties?
  3. Which internal endpoint and HTTP method returned 405, and did the service attempt to retrieve appZipUrl?

We can provide the correlation ID, trace ID and resource details privately to Microsoft support. Access tokens and SAS URLs will not be posted publicly.

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.

0 comments No comments

2 answers

Sort by: Newest
  1. wanb 0 Reputation points
    2026-11-24T03:33:32.3233333+00:00

    Comparative test completed: Both the original request body and the request body containing only appZipUrl returned an HTTP 405 error; the specific underlying cause remains undetermined.

    Both requests utilized the same site, application ZIP, SAS token, service principal, and API version. Subsequently, the ZIP file was downloaded from a local machine using the exact same SAS token; the request returned a 200 status code, and the SHA-256 hash matched. Therefore, removing the provider and deploymentTitle fields did not resolve the issue. While the SAS token is valid for local access, this does not confirm that the Azure backend is able to access it.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-24T02:31:55.4733333+00:00

    The request matches the documented site-level ZIP deployment contract, so the unexplained 405 MethodNotAllowed requires Microsoft support to trace the ARM correlation ID rather than another change to the ZIP layout or upload process.

    Supported operation and authentication

    The documented operation is:

    POST https://management.azure.com/subscriptions/[Subscription ID]/resourceGroups/[Resource Group] Group]/providers/Microsoft.Web/staticSites/{name}/zipdeploy?api-version=2025-03-01
    Authorization: Bearer <ARM-token>
    Content-Type: application/json
    

    Its documented body includes properties.appZipUrl, apiZipUrl, deploymentTitle, functionLanguage, and provider. Successful calls return 200 OK or 202 Accepted.^1^

    The same reference includes a Python example using DefaultAzureCredential with AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET, which is the service-principal client-credentials configuration. Therefore, service-principal authentication is supported for this ARM operation, subject to the principal having permission to invoke the action.^1^

    The public contract describes appZipUrl only as the URL of the zipped application content; it does not restrict it to an account-key SAS or exclude a user-delegation SAS.^2^ A readable HTTPS user-delegation SAS therefore fits the documented input shape, but the documentation does not explicitly certify particular SAS types, SAS fields, or storage-account network configurations.

    Request properties

    For an app-only deployment, perform one controlled retry using the smallest documented payload:

    curl --fail-with-body -i -X POST \
      -H "Authorization: Bearer $ARM_TOKEN" \
      -H "Content-Type: application/json" \
      --data "{\"properties\":{\"appZipUrl\":\"$APP_ZIP_URL\"}}" \
      "https://management.azure.com/subscriptions/[Subscription ID]/resourceGroups/[Resource Group] Group]/providers/Microsoft.Web/staticSites/$SITE_NAME/zipdeploy?api-version=2025-03-01"
    

    This is a diagnostic simplification, not a correction to a documented error:

    • appZipUrl is the relevant app-content field.
    • apiZipUrl and functionLanguage apply when API content exists.
    • deploymentTitle is a label.
    • provider identifies the submitting provider.^2^
    • No allowed-value enumeration is documented for provider; "ArcGIS Nova" is therefore not publicly documented as either required, reserved, or invalid.
    • kind is listed in the request model but is not marked required by the operation reference.^1^

    If targeting a named staging environment rather than the primary site, the route is different:

    POST .../staticSites/{name}/builds/{environmentName}/zipdeploy?api-version=2025-03-01
    

    The environment name must match the documented alphanumeric pattern.^3^ Your site-level route is correct for deployment to the primary site.

    What the available evidence establishes

    The Activity Log proves that ARM received a POST for the expected resource-provider action. It does not identify:

    • which downstream Static Web Apps endpoint returned 405;
    • which downstream HTTP method was used;
    • whether ZIP retrieval was attempted;
    • whether the response originated in ARM routing, Microsoft.Web, or a deployment backend.

    The absence of GetBlob in aggregated metrics is not enough to conclude that no retrieval occurred. Conversely, the later successful GET with a new SAS does not establish that the original SAS was valid during the failed request.

    Support escalation

    Open an Azure support request for Static Web Apps → Deployment and provide privately:

    1. ARM correlation ID and trace/request ID.
    2. Exact UTC timestamp and region (West US 2).
    3. Subscription, resource group, and Static Web App resource ID.
    4. Full response status, headers, and sanitized body.
    5. Confirmation that the called operation was Microsoft.Web/staticSites/zipdeploy/action.
    6. Whether a minimal appZipUrl-only retry also returns 405.
    7. Original SAS start/expiry times, permissions, resource scope, and signing type—without disclosing the signature or complete URL.
    8. Storage diagnostic logs for the original failure window, if available.

    Ask support to identify the failing downstream endpoint and method, determine whether appZipUrl retrieval was initiated, and confirm whether user-delegation SAS URLs are accepted by this operation in West US 2. Continue using the successful SWA CLI deployment-token path as the operational workaround; SWA CLI officially supports deployment tokens for automated deployments.^4^


    References

    1. Static Sites - Create Zip Deployment For Static Site - REST API (Azure App Service) | Microsoft Learn
    2. StaticSiteZipDeployment Class-Variables
    3. Static Sites - Create Zip Deployment For Static Site Build - REST API (Azure App Service) | Microsoft Learn
    4. Deploy a static web app with Azure Static Web Apps CLI
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.