1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Github Action for SQL Database

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 10, 2024.

  1. Stack

    Stack Membro Participativo

    I am using the Github action to automate my Azure SQL database changes and tried my 'yaml' code like the following but it gives framework error as given below.

    Github Yaml code,

    name: SQL-Action
    on:
    push:
    branches:
    - SQL
    pull_request:
    types: [opened, synchronize, reopened]
    branches:
    - dev
    env:
    AZURE_FUNCTIONAPP_PACKAGE_PATH: Project/publish
    CONFIGURATION: Release
    DOTNET_CORE_VERSION: 6.0.x
    DOTNETFRAMEWORK_VERSION: 4.8
    WORKING_DIRECTORY: Project
    SQL_WORKING_DIRECTORY: Project.Database
    TEST_DIRECTORY: Project.Test

    jobs:
    build:
    name: Build
    runs-on: self-hosted-win

    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
    uses: actions/setup-dotnet@v1
    with:
    dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
    - name: Clean
    run: dotnet clean "${{ env.SQL_WORKING_DIRECTORY }}/Project.Database.sqlproj" --configuration ${{ env.CONFIGURATION }}
    - name: Build SQL Database project
    run: dotnet build "${{ env.SQL_WORKING_DIRECTORY }}/Project.Database.sqlproj" --configuration ${{ env.CONFIGURATION }} /p:VisualStudioVersion=17.3.2

    - name: Restore
    run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
    - name: Publish SQL Database changes
    uses: azure/sql-action@v1
    with:
    server-name: xxxx.database.windows.net
    connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
    dacpac-package: "${{ env.WORKING_DIRECTORY }}/Project.Database/bin/${{ env.CONFIGURATION }}/Project.Database.dacpac"


    The error in the build task,

    MSBuild version 17.3.2+561848881 for .NET
    Determining projects to restore...
    Nothing to do. None of the projects specified contain packages to restore.


    C:\Users\ContainerAdministrator\AppData\Local\Microsoft\dotnet\sdk\6.0.408\Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
    0 Warning(s)
    1 Error(s)

    Time Elapsed 00:00:04.72
    Error: Process completed with exit code 1.

    Continue reading...

Compartilhe esta Página