Import a BACPAC File to Create a New Database

I used a SQL Express 2016 to import a bacpac file from Azure.
(Export the db from the Azure Portal first). And the SQL Server Management studio 17.

Initially imported into SQL Express 2014 but got some warnings/errors regarding the import, so SQL 2016 works better.

1. Access to a bacpac file locally / on azure storage
2. Use the UI wizard in Management Studio. (See below)

To launch the wizard, use the following steps:
  1. Connect to the instance of SQL Server, whether on-premise or in SQL Database.
  2. In Object Explorer, right-click on Databases, and then select the Import Data-tier Application menu item to launch the wizard.
  3. Complete the wizard dialogs: Introduction Page. Import Settings Page.

    Source: Import a BACPAC File to Create a New User Database | Microsoft Docs

I got this error when starting up the website:
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The certificate chain was issued by an authority that is not trusted.

Solved the error by setting TrustServerCertificate=false in the connectionstring.

More info here:

Accessing Azure Web App with FTP

Login to azure portal

Goto your web app

Select the tab “Deployment credentials” and set username and password to be used for FTP access. (remember to save).

Goto the “Overview” tab (the top tab)
In the right column you find:

Notice that the user name will be [web app name]\[my username]
That should be all you need to access the web app with ftp or ftps.


Set up staging environments for web apps in Azure App Service | Microsoft Docs

When using deployment slots in Azure Web Apps the appsettings and connectionsstrings are changed when swapping slots.

E.g. the production environment slot has the “production” version of appsettings and connectionstrings and the pre production slot has its own version of those settings in the web.config file.

This is default behaviour, unless you use the app settings in the Azure portal for the environments (overrides web.config file) or check the “Slot setting”. (setting will “stick” with the swap).

Read more here:

Slot config:
Set up staging environments for web apps in Azure App Service | Microsoft Docs

Configure web sites:


Session problems when setting up Azure Web App Service

I had a problem with a web app service on Azure, the session state was not functioning properly.

2 instances where running for the website and the Session affinity cookie was set to Off, that was the problem, ARR makes sure that the user stays on the correct webserver for the duration of the session.

I had to turn it ON, see link below for where to find it.

Disable Session affinity cookie (ARR cookie) for Azure web apps