【问题标题】:Azure app service connection string disappears on redeploymentAzure app service connection string disappears on redeployment
【发布时间】:2022-12-01 15:44:51
【问题描述】:

I add a connection string to my app service (configuration > connection strings > + New connection string > Save), and this works. But when I redeploy through my CI/CD github workflow, the connection string is gone.

Before a new deployment:

After a new deployement:

My workflow file:

on: [push]
name: workflow
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2 # checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
      - run: dotnet --version
      - run: dotnet tool restore
      - run: dotnet run --project tests/Server/Server.Tests.fsproj
  build-and-deploy:
    if: github.ref == 'refs/heads/deploy'
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout Github Action'
        uses: actions/checkout@v2

      - name: 'Login via Azure CLI'
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: 'Restore'
        run: dotnet tool restore

      - name: 'Deploy'
        run: dotnet run azure

【问题讨论】:

  • It's hard to answer this question without seeing your workflow file
  • 我将使用工作流脚本进行更新。所以你认为问题是部署擦除天蓝色的设置,@AbdulNiyasPM?

标签: azure azure-web-app-service github-actions


【解决方案1】:

I have deployed the .NET Core App to Azure App service using GitHub Actions.

  • Added new Connection String in Configuration => Connection Strings as you have mentioned.

  • When I tried to Sync (Redeploy) from Deployment Center, got the below alert.

  • It clearly says that old deployment changes will be updated with the new one.

  • But for me the Connection String is not missing.

  • 创建应用程序服务时,最初 Disable GitHub Actions 设置。

  • 稍后,从部署中心连接到GitHub

  • 如果我们不想错过部署后完成的任何configurations。不要使用Sync 选项重新部署应用程序,而是单击Disconnect

  • 重新连接并再次构建工作流程。

  • 可以看到可用的Connection Strings

【讨论】:

    猜你喜欢
    • 2022-12-27
    • 2015-09-17
    • 2021-07-17
    • 2022-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多