Unzip a website

Osmond Bullen 1 Reputation point
2023-08-20T12:32:48.7533333+00:00

I am creating a website on the Azure website portal. I uploaded the site to my Azure app using CLI, My question is how do I unzip the file using KUDU? I followed the article "[Copying and unzipping files using Kudu on Azure App Service] " . The error I am getting is cannot find the file. The command is unzip, Docmentation: To upload a file and also unzip it there are two options. You can upload the file using the method above by dragging the file in. Then in the command window run the unzip command. Any help? Thanks.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,646 questions
{count} votes

2 answers

Sort by: Most helpful
  1. TP 116.6K Reputation points
    2023-08-20T13:01:21.79+00:00

    Hi Osmond,

    First you need to determine precisely where you uploaded the zip file to. For example, I'm guessing you uploading it to wwwroot. So in the Kudu command window the path would be C:\home\site\wwwroot<yourfile>.zip

    Once you know the exact file path your file is saved in you can use the unzip command in Kudu command prompt. Before unzipping the files you want to plan out where you want them. c:\home\site\wwwroot is the root folder of your site, so this is where you would want the entry point (index.html or similar) to be saved.

    For example, you could first switch to the directory where your zip file is saved (substitute the path yours is saved in) using below command:

    cd c:\home\site\wwwroot

    Next unzip the files using below command:

    unzip <yourzipfilename>

    If you are unsure how to use the unzip command, you can type unzip -hh to give you a list of command line switches and help text.

    Other options you may consider are unzipping the files on your local PC and uploading them using FTP or Kudu, deploying via GitHub/Bitbucket/etc., deploying via Visual Studio or VS Code. In below article, on left hand side you can click on various different deployment options to see more information:

    https://learn.microsoft.com/en-us/azure/app-service/deploy-ftp?tabs=portal

    Please click Accept Answer if the above was useful.

    Thanks.

    -TP


  2. SnehaAgrawal-MSFT 22,516 Reputation points
    2023-08-30T07:41:02.4133333+00:00

    @Osmond Bullen Just checking if you have chance to see recent response suggested by TP-

    To unzip a file using Kudu on Azure App Service, you can follow these steps:

    1. Open the Kudu console for your app by navigating to https://<app_name>.scm.azurewebsites.net/DebugConsole.
    2. Navigate to the directory where your zip file is located. You can use the cd command to change directories. For example, if your zip file is located in the site/wwwroot directory, you can navigate to that directory by running the command cd site\wwwroot.
    3. Once you are in the directory where your zip file is located, you can use the unzip command to extract the contents of the zip file. For example, if your zip file is named myapp.zip, you can extract its contents by running the command unzip myapp.zip.

    If you are getting an error that the file cannot be found, make sure that you are in the correct directory and that the file name is spelled correctly. You can use the ls command to list the files in the current directory and verify that the file is present.

    Please let us know if further query or issue remains.

    Please accept as "Yes" if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments

Your answer

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