Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.06k stars 1.19k forks source link

zip url deploy not working beginCreateZipDeploymentForStaticSiteAndWait #24353

Open davindersteltix opened 1 year ago

davindersteltix commented 1 year ago

I'm using the below code to deploy a static web app using the zip URL.

const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");

/**
 * This sample demonstrates how to Description for Deploys zipped content to a static site.
 *
 * @summary Description for Deploys zipped content to a static site.
 * x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2022-03-01/examples/StaticSiteZipDeploy.json
 */
async function deployASiteFromAZippedPackage() {
  const subscriptionId = ""; // made it empty for the issue
  const resourceGroupName = ""; // made it empty for the issue
  const name = "";
  const staticSiteZipDeploymentEnvelope = {
    appZipUrl: "myzipURL",
    deploymentTitle: "test",
    provider: "node",
  };
  const credential = new DefaultAzureCredential();
  console.log(credential);
  const client = new WebSiteManagementClient(credential, subscriptionId);
  const result =
    await client.staticSites.beginCreateZipDeploymentForStaticSiteAndWait(
      resourceGroupName,
      name,
      staticSiteZipDeploymentEnvelope
    );
  console.log(result);
}

deployASiteFromAZippedPackage().catch(console.error);

And getting the below error:

  "name": "RestError",
  "statusCode": 501,
  "request": {
    "url": "https://management.azure.com/subscriptions/dbb23b75-1396-4368-aa95-aac40adcd8b4/resourceGroups/appshare/providers/Microsoft.Web/staticSites/test5/zipdeploy?api-version=2022-03-01",
    "headers": {
      "content-type": "application/json",
      "accept": "application/json",
      "accept-encoding": "gzip,deflate",
      "user-agent": "azsdk-js-arm-appservice/13.0.3 core-rest-pipeline/1.10.0 Node/v16.17.1 OS/(arm64-Darwin-22.2.0)",
      "x-ms-client-request-id": "89b18f48-1d12-4f4f-9ce8-2985a1e179e9",
      "authorization": "REDACTED",
      "content-length": "274"
    },
    "method": "POST",
    "timeout": 0,
    "disableKeepAlive": false,
    "streamResponseStatusCodes": {},
    "withCredentials": false,
    "requestId": "89b18f48-1d12-4f4f-9ce8-2985a1e179e9",
    "allowInsecureConnection": false,
    "enableBrowserStreams": false
  },
  "details": {
    "Code": "NotImplemented",
    "Message": "The requested method is not implemented.",
    "Target": null,
    "Details": [
      {
        "Message": "The requested method is not implemented."
      },
      {
        "Code": "NotImplemented"
      },
      {
        "ErrorEntity": {
          "ExtendedCode": "51009",
          "MessageTemplate": "The requested method is not implemented.",
          "Parameters": [],
          "Code": "NotImplemented",
          "Message": "The requested method is not implemented."
        }
      }
    ],
    "Innererror": null
  }

Could please you let me know what I'm doing wrong?

Happy new Year and Thanks in Advance.

qiaozha commented 1 year ago

@kazrael2119 Can you help take a look at this issue ? Thanks

qiaozha commented 1 year ago

duplicate with https://github.com/Azure/azure-rest-api-specs-examples/issues/1678

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

qiaozha commented 1 year ago

This seems to be a service issue add CXP Attention here.

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp @AzureAppServiceCLI.

Mike-Crowley commented 6 days ago

Possibly the same issue as https://github.com/Azure/azure-rest-api-specs/issues/22267

Any update here? Is publishing SWA content via ZIP possible?