-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds logic required to deploy to Azure using Continuous Deployment. * Yaml updates
- Loading branch information
Showing
11 changed files
with
165 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using ServerCore.DataModel; | ||
|
||
namespace ServerCore.Areas.Deployment | ||
{ | ||
public class DeploymentConfiguration | ||
{ | ||
internal static void ConfigureDatabase(IConfiguration configuration, IServiceCollection services) | ||
{ | ||
// Use SQL Database if in Azure, otherwise, use localdb | ||
if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development") | ||
{ | ||
|
||
services.AddDbContext<PuzzleServerContext> | ||
(options => options.UseLazyLoadingProxies() | ||
.UseSqlServer(configuration.GetConnectionString("PuzzleServerSQLConnectionString"))); | ||
} | ||
else | ||
{ | ||
services.AddDbContext<PuzzleServerContext> | ||
(options => options.UseLazyLoadingProxies() | ||
.UseSqlServer(configuration.GetConnectionString("PuzzleServerContextLocal"))); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
ServerCore/Connected Services/Key Vault/ConnectedService.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"ProviderId": "Microsoft.Azure.KeyVault", | ||
"Version": "15.8.0.0", | ||
"GettingStartedDocument": { | ||
"Uri": "https://go.microsoft.com/fwlink/?linkid=869667" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ServerCore/Properties/PublishProfiles/PuzzleServerTestDeploy - Web Deploy.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process | ||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<WebPublishMethod>MSDeploy</WebPublishMethod> | ||
<ResourceId>/subscriptions/3ffc52f4-eed1-4312-8170-9caf82ff0949/resourcegroups/PuzzleServerTestDeploy/providers/Microsoft.Web/sites/PuzzleServerTestDeploy</ResourceId> | ||
<ResourceGroup>PuzzleServerTestDeploy</ResourceGroup> | ||
<PublishProvider>AzureWebSite</PublishProvider> | ||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> | ||
<LastUsedPlatform>Any CPU</LastUsedPlatform> | ||
<SiteUrlToLaunchAfterPublish>https://puzzleservertestdeploy.azurewebsites.net</SiteUrlToLaunchAfterPublish> | ||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> | ||
<ExcludeApp_Data>False</ExcludeApp_Data> | ||
<ProjectGuid>67b91cce-4e3d-4f0f-8a76-eafd37c5f949</ProjectGuid> | ||
<MSDeployServiceURL>puzzleservertestdeploy.scm.azurewebsites.net:443</MSDeployServiceURL> | ||
<DeployIisAppPath>PuzzleServerTestDeploy</DeployIisAppPath> | ||
<RemoteSitePhysicalPath /> | ||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> | ||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod> | ||
<EnableMSDeployBackup>True</EnableMSDeployBackup> | ||
<UserName>$PuzzleServerTestDeploy</UserName> | ||
<_SavePWD>True</_SavePWD> | ||
<_DestinationType>AzureWebSite</_DestinationType> | ||
<InstallAspNetCoreSiteExtension>False</InstallAspNetCoreSiteExtension> | ||
<KeyVaultUri>https://PuzzleServerTestKeyVault.vault.azure.net</KeyVaultUri> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
<SelfContained>false</SelfContained> | ||
<_IsPortable>true</_IsPortable> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<_SelectedScaffolderID>Microsoft.AspNet.Scaffolding.Mvc.ModelBasedCrudRazorPageScaffolder</_SelectedScaffolderID> | ||
<_SelectedScaffolderCategoryPath>root/Common/RazorPage</_SelectedScaffolderCategoryPath> | ||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth> | ||
<WebStackScaffolding_DbContextDialogWidth>600</WebStackScaffolding_DbContextDialogWidth> | ||
<WebStackScaffolding_LayoutPageFile> | ||
</WebStackScaffolding_LayoutPageFile> | ||
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected> | ||
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected> | ||
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected> | ||
<WebStackScaffolding_DbContextTypeFullName>ServerCore.Models.PuzzleServerContext</WebStackScaffolding_DbContextTypeFullName> | ||
<NameOfLastUsedPublishProfile>PuzzleServerTestDeploy - Web Deploy</NameOfLastUsedPublishProfile> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters