Open Closed

Deployment fails, when using your tutorial #7527


User avatar
0
start created

following the example:

https://docs.abp.io/en/commercial/latest/startup-templates/application/azure-deployment/step3-deployment-github-action?UI=NG&DB=EF&Tiered=No

the run migration part fails: - name: Run migrations run: dotnet run -- "${{ secrets.CONNECTION_STRING }}" working-directory: ./aspnet-core/src/Demo.AzureAppsAngular.DbMigrator # Replace with your project name

What do I have to change how in AZURE

  • ABP Framework version: latest
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:

"Run dotnet run -- "***" [19:10:55 INF] Started database migrations... [19:10:55 INF] Migrating schema for host database... Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes (https://docs.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database). at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)"

  • Steps to reproduce the issue:

29 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you troubleshoot based on following the message and links?

    An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes (https://docs.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database

    Thanks

  • User Avatar
    0
    start created

    I would love that you put those things in the tutorial, because for a new comer - as me - it's important that the initial examples work.

    This is the reason why I chose abp, to get a fully working example (and product)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Thanks. We will update the document.

  • User Avatar
    0
    start created

    But back to my problem,

    always when I rerun the github aciton, github changes the IP.

    [10:55:38 INF] Started database migrations... [10:55:38 INF] Migrating schema for host database... Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open server 'xxmustafa18072024server' requested by the login. Client with IP address '20.62.206.238' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior run

    I update the azure firewall settings afterwards, but it has no effect

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Client with IP address '20.62.206.238' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.

    I'm not an Azure expert. Can you google this message?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Have you allowed the 20.62.206.238?

  • User Avatar
    0
    start created

    The point is - like i wrote - every time I do the github action, the IP changes.

    I know the ip only, when it fails not before (so i can enter it)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Sorry, I have no experience with that.

  • User Avatar
    0
    start created

    can you solve that one https://stackoverflow.com/questions/78775803/could-not-find-x-bundles-even-the-installation-is-fresh ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please install the ABP CLI and run the abp install-libs command to restore the assets.

    https://docs.abp.io/en/abp/latest/CLI https://docs.abp.io/en/abp/latest/CLI#install-libs

  • User Avatar
    0
    start created

    Yes, I did it.

    but still having the same problem

  • User Avatar
    0
    start created

    additionally I get

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    There is an error during the run abp install-libs

    Please delete the yarn.lock or packages.lock files and retry.

  • User Avatar
    0
    start created

    Ok, the error disappeared, but I still get :

    or this

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please check&share the logs of localhost:44371

  • User Avatar
    0
    start created

    where to find it

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    YourWebProject/Logs/logs.txt

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please delete the Logs.txt files. And set the log level to Debug, then reproduce the cors error and share again.

    Thanks.

    
    public class Program
    {
        public async static Task<int> Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Debug()
                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                .Enrich.FromLogContext()
                .WriteTo.Async(c => c.File("Logs/logs.txt"))
                .WriteTo.Async(c => c.Console())
                .CreateLogger();
                ```
    
  • User Avatar
    0
    start created

    for which project

    ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The localhost:44371 project.

    but you can change code and share the logs of Host and AuthServer at the same time.

  • User Avatar
    0
    start created

    So this is in 3 Projects:

    And I have to replace in all 3 Projects your entire code?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    And I have to replace in all 3 Projects your entire code?

    You can do this. Remove all existing Logs.txt files and share again.

    Thanks.

  • User Avatar
    0
    start created

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The logs show that the cors check is successful.

    Do you have an online angular URL so I can see the cors error?

    Or please share the HTTP request and response of the https://localhost:44371/api/abp/application-configuration , you can view them in Chrome dev-tool.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I mean the full request and response info include the headers.

    And do you have an online angular URL so I can see the cors error?

    Thanks.

Made with ❤️ on ABP v9.1.0-preview. Updated on October 11, 2024, 07:13