private tryParseNewPublishProfile()

in src/handlers/parameterValidator.ts [162:183]


    private tryParseNewPublishProfile(xmlResult: any, out: IScmCredentials): boolean {
        // uri: waws-prod-mwh-007.publish.azurewebsites.windows.net:443
        const options = xmlResult.publishData.publishProfile.filter((p: any) => {
            return p.$.publishMethod === "MSDeploy"
        });
        if ((options || []).length == 0) {
            Logger.Error('The new publish profile does not contain MSDeploy publish method.');
            return false;
        }
        const msDeploy = options[0].$;
        const publishUrl: string = msDeploy.publishUrl.split(":")[0];
        if (publishUrl.indexOf(".publish.") >= 0) {
            // appName contains slot name setting
            const appName = msDeploy.userName.substring(1).replace('__', '-');
            out.uri = `https://${msDeploy.userName}:${msDeploy.userPWD}@${appName}.scm.azurewebsites.net`;
            out.username = msDeploy.userName;
            out.password = msDeploy.userPWD;
            out.appUrl = msDeploy.destinationAppUrl;
            return true;
        }
        return false;
    }