public async extractZIP()

in src/appservice-rest/Kudu/azure-app-kudu-service.ts [178:204]


    public async extractZIP(webPackage: string, physicalPath: string): Promise<void> {
        physicalPath = physicalPath.replace(/[\\]/g, "/");
        physicalPath = physicalPath[0] == "/" ? physicalPath.slice(1): physicalPath;
        var httpRequest: WebRequest = {
            method: 'PUT',
            uri: this._client.getRequestUri(`/api/zip/${physicalPath}/`),
            headers: {
                'Content-Type': 'multipart/form-data',
                'If-Match': '*'
            },
            body: fs.createReadStream(webPackage)
        };

        try {
            var response = await this._client.beginRequest(httpRequest);
            core.debug(`extractZIP. Data: ${JSON.stringify(response)}`);
            if(response.statusCode == 200) {
                return ;
            }
            else {
                throw response;
            }
        }
        catch(error) {
            throw Error("Failed to deploy App Service package using kudu service.\n" + this._getFormattedError(error));
        }
    }