Publishing dotnet project to Azure KUDU Git using Bitbucket pipeline

I have a microservice dotnet project and I’m trying to publish every microservice to different App Service Azure.

The pipeline looks like that:

`
image: microsoft/dotnet:2.2-sdk

pipelines:
  branches:
      dev:               
        #- parallel: # Parallel Build & Deploy DEV
        - step:
            name: Build & Deploy COG.SSO DEV
            caches:
              - dotnetcore
            script:
              - export PROJECT_NAME=src/COG.SSO/COG.SSO.csproj
              - dotnet --version
              - dotnet restore $PROJECT_NAME
              - dotnet build $PROJECT_NAME
              - https://$AZURE_LOGIN_STAGING:$AZURE_PASSWORD_STAGING@$AZURE_APP_NAME_STAGING.scm.azurewebsites.net:443/$AZURE_APP_NAME.git

`

Pipeline works correctly and saying that finished successfully but changed files aren’t updated on the server after pushing

Another way to publish my project to azure is to use Publish Profiles:

  • step:
    name: Build & Deploy COG.SSO DEV
    caches:
    - dotnetcore
    script:
    - export PROJECT_NAME=src/COG.SSO/COG.SSO.csproj
    - dotnet --version
    - dotnet restore $PROJECT_NAME
    - dotnet build $PROJECT_NAME
    - cd ./src/COG.SSO
    - apt-get update
    - curl -sL https://deb.nodesource.com/setup_6.x | bash -
    - apt-get install -y nodejs
    - node -v
    - apt-get -qq update && apt-get -qq -y install bzip2
    - npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
    - npm install -g gulp-cli
    - dotnet publish COG.SSO.csproj /p:PublishProfile=‘exo-sso-dev - Web Deploy’ /p:Password=‘XXX’ /p:Configuration=Development

After publishing I’ve got such error:

COG.SSO -> /opt/atlassian/pipelines/agent/build/src/COG.SSO/bin/Development/netcoreapp2.2/publish/ /usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(171,5): error MSB6004: The specified task executable location "%ProgramW6432%/IIS/Microsoft Web Deploy V3/msdeploy.exe" is invalid. [/opt/atlassian/pipelines/agent/build/src/COG.SSO/COG.SSO.csproj

Also, I need to say that publishing from Visual Studio works correctly.
Have anybody some ideas?