I have a .NET Core 6.0 webapp and I am using GoDaddy s windows deluxe hosting which gives me Plesk to administer my sites. I can download a *.publishsettings
file for each site I have, which looks like this
<?xml version="1.0"?>
<publishData>
<publishProfile profileName="example.com - Web Deploy"
publishMethod="MSDeploy"
publishUrl="https://example.com:8172/msdeploy.axd?site=example.com"
msdeploySite="example.com"
userName="<redacted>"
destinationAppUrl="http://example.com"
controlPanelLink="https://example.shr.prod.phx3.secureserver.net:8443"
/>
</publishData>
When I import that into Visual Studio it generates this *.pubxml
file, to which I added the <UserPWD>
node.
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://example.com</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c16666a7-f6aa-406d-af77-effb1be3f08f</ProjectGuid>
<MSDeployServiceURL>https://example.com:8172/msdeploy.axd?site=example.com</MSDeployServiceURL>
<DeployIisAppPath>example.com</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>REDACTED</UserName>
<UserPWD>REDACTED</UserPWD>
<_SavePWD>true</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
I ve saved that *.pubxml
file as a github secret called PUBLISH_PROFILE_PROD
, and then I have this github action for deployment making use of the Azure webapps-deploy action
name: ? Deploy website to PROD
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore: [".vscode/**", "README.md", ".*"]
permissions:
contents: write
jobs:
web-deploy:
name: ? Deploy Prod
runs-on: ubuntu-latest
steps:
- name: ? Get latest code
uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish --configuration Release --no-restore
- name: Deploy
uses: azure/webapps-deploy@v2.2.10
with:
app-name: example.com
publish-profile: ${{ secrets.PUBLISH_PROFILE_PROD }}
package: ./bin/Release/net6.0/publish
When this action runs, it fails with this error:
Error: Failed to fetch credentials from Publish Profile. For more details on how to set publish profile credentials refer https://aka.ms/create-secrets-for-GitHub-workflows
Error: Deployment Failed, Error: Publish profile does not contain kudu URL
Am I doing something wrong, is my server not accepting this, or is there some other problem?
(I have opened a discussion about this on the github action page as well)