-
Follow the first three steps of the tutorial here.
a. If there is there is an error pasting in the
StackExchangeRedisCache
code, install the NuGet packageMicrosoft.Extensions.Caching.StackExchangeRedis
and the error should clear up. -
In the tutorial step 3.7.3, use this as the code for the workflow step instead of the given code:
dotnet ef migrations bundle --runtime linux-x64 -p FaulknerCountyMuseumGallery.csproj -o ${{env.DOTNET_ROOT}}/myapp/migrate
. -
Comment out the line
DbInitializer.Initialize(context);
inProgram.cs
. -
For each of the models in the Models folder, add the data annotation tag
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
to the ID field (includeing ArtworkID, MediumID, etc.). -
Delete the Migrations folder to remove any existing SQLite migrations, which would otherwise conflict with the AzureSQL database.
-
Commit and push the current changes.
-
Once the workflow has deployed, do step 4 of the tutorial.
-
If the migration works, uncomment
DbInitializer.Initialize(context);
inProgram.cs
. -
Commit and push this change.
-
The site should be deployed fully.
If you have any other errors, the website doesn't deploy properly, or the SSH terminal won't open, the App Service Logs can be helpful for debugging. See the tutorial step five for instructions on how to enable and access the App Service Log Stream.