GetArmParameters();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/Network/BastionsForm.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Core.Models
2 | @using Blazor.Diagrams.Core
3 | @using Blazor.Diagrams.Core.Models
4 | @using AzureDesignStudio.Core.Components
5 |
6 |
18 |
19 | @code {
20 | [CascadingParameter]
21 | public NodeModel Node { get; set; } = null!;
22 | [CascadingParameter]
23 | public Diagram Diagram { get; set; } = null!;
24 |
25 | private BastionsModel bastion => (BastionsModel)Node;
26 | }
27 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/Network/VirtualNetworkPort.cs:
--------------------------------------------------------------------------------
1 | using Blazor.Diagrams.Core.Geometry;
2 | using Blazor.Diagrams.Core.Models;
3 |
4 | namespace AzureDesignStudio.Core.Network
5 | {
6 | public class VirtualNetworkPort : PortModel
7 | {
8 | public VirtualNetworkPort(NodeModel parent, PortAlignment alignment, Point? position = null, Size? size = null)
9 | : base(parent, alignment, position, size)
10 | {
11 | }
12 |
13 | public override bool CanAttachTo(PortModel port)
14 | {
15 | if (!base.CanAttachTo(port) || port is not VirtualNetworkPort)
16 | return false;
17 |
18 | foreach (var sibling in Parent.Ports)
19 | {
20 | // Only one vnet-peering can be established.
21 | if (sibling.Links.Any(l => l.SourcePort?.Parent.Id == port.Parent.Id
22 | || l.TargetPort?.Parent.Id == port.Parent.Id))
23 | return false;
24 | }
25 |
26 | return true;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/SQL/SqlDatabaseForm.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Core.Components
2 | @using Blazor.Diagrams.Core
3 | @using Blazor.Diagrams.Core.Models
4 |
5 |
14 |
15 | @code {
16 | [CascadingParameter]
17 | public NodeModel Node { get; set; } = null!;
18 | [CascadingParameter]
19 | public Diagram Diagram { get; set; } = null!;
20 |
21 | private SqlDatabaseModel sqlDatabase => (Node as SqlDatabaseModel)!;
22 | }
23 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/SQL/SqlServerForm.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Core.Components
2 | @using Blazor.Diagrams.Core
3 | @using Blazor.Diagrams.Core.Models
4 |
5 |
8 |
9 | @code {
10 | [CascadingParameter]
11 | public NodeModel Node { get; set; } = null!;
12 | [CascadingParameter]
13 | public Diagram Diagram { get; set; } = null!;
14 |
15 | private SqlServerModel sqlServer => (Node as SqlServerModel)!;
16 | }
17 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/Storage/StorageAccountForm.razor:
--------------------------------------------------------------------------------
1 | StorageAccountForm
2 |
3 | @code {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/Web/AppServicePlanForm.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Core.Components
2 | @using Blazor.Diagrams.Core
3 | @using Blazor.Diagrams.Core.Models
4 |
5 |
8 |
9 | @code {
10 | [CascadingParameter]
11 | public NodeModel Node { get; set; } = null!;
12 | [CascadingParameter]
13 | public Diagram Diagram { get; set; } = null!;
14 |
15 | private AppServicePlanModel appsvcPlan => (Node as AppServicePlanModel)!;
16 |
17 | private void HandleOSChange(string value)
18 | {
19 | foreach(var child in appsvcPlan.Children)
20 | {
21 | if (child is WebAppModel w)
22 | {
23 | w.RuntimeStack = null!;
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/Web/FunctionAppForm.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Core.Network
2 | @inherits WebAppForm
3 |
4 | @{
5 | base.BuildRenderTree(__builder);
6 | }
7 |
8 | @code {
9 | private FunctionAppModel funcApp = null!;
10 | protected override void OnInitialized()
11 | {
12 | funcApp = (Node as FunctionAppModel)!;
13 |
14 | ChildContent =
15 | @
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
25 | ;
26 |
27 | base.OnInitialized();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Core/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Components.Web
2 | @using AntDesign;
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "dotnet-ef": {
6 | "version": "6.0.4",
7 | "commands": [
8 | "dotnet-ef"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model AzureDesignStudio.Server.Pages.ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/Pages/Error.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using System.Diagnostics;
4 |
5 | namespace AzureDesignStudio.Server.Pages
6 | {
7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8 | [IgnoreAntiforgeryToken]
9 | public class ErrorModel : PageModel
10 | {
11 | public string? RequestId { get; set; }
12 |
13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14 |
15 | private readonly ILogger _logger;
16 |
17 | public ErrorModel(ILogger logger)
18 | {
19 | _logger = logger;
20 | }
21 |
22 | public void OnGet()
23 | {
24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:44698",
7 | "sslPort": 44367
8 | }
9 | },
10 | "profiles": {
11 | "AzureDesignStudio.Server": {
12 | "commandName": "Project",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | },
17 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
18 | "applicationUrl": "https://localhost:7203;http://localhost:5203",
19 | "dotnetRunMessages": true
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "environmentVariables": {
25 | "ASPNETCORE_ENVIRONMENT": "Development"
26 | }
27 | },
28 | "Docker": {
29 | "commandName": "Docker",
30 | "launchBrowser": true,
31 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
32 | "publishAllPorts": true,
33 | "useSSL": true
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/Utils/AdsTelemetryInitializer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ApplicationInsights.Channel;
2 | using Microsoft.ApplicationInsights.Extensibility;
3 |
4 | namespace AzureDesignStudio.Server.Utils
5 | {
6 | public class AdsTelemetryInitializer : ITelemetryInitializer
7 | {
8 | public void Initialize(ITelemetry telemetry)
9 | {
10 | telemetry.Context.Cloud.RoleName = "ads-server";
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.Server/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "AzureAdB2C": {
3 | "Instance": "https://azdesignapp.b2clogin.com/",
4 | "ClientId": "",
5 | "Domain": "",
6 | "Scopes": "",
7 | "SignUpSignInPolicyId": ""
8 | },
9 | "KeyVaultName": "",
10 | "KeyVaultKeyName": "",
11 | "ApplicationInsights": {
12 | "ConnectionString": "",
13 | "LogLevel": {
14 | "Default": "Information"
15 | }
16 | },
17 | "Logging": {
18 | "LogLevel": {
19 | "Default": "Warning",
20 | "Microsoft.AspNetCore": "Warning"
21 | }
22 | },
23 | "AllowedHosts": "*"
24 | }
25 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SharedModels/design_view_model.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | option csharp_namespace = "AzureDesignStudio.SharedModels.Protos";
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | service Design {
8 | rpc Save(SaveDesignRequest) returns(SaveDesignResponse);
9 | rpc GetSaved(google.protobuf.Empty) returns(GetSavedDesignResponse);
10 | rpc Load(LoadDesignRequest) returns(LoadDesignResponse);
11 | rpc Delete(DeleteDesignRequest) returns(DeleteDesignResponse);
12 | }
13 |
14 | message SaveDesignRequest {
15 | string name = 1;
16 | string data = 2;
17 | }
18 |
19 | message SaveDesignResponse {
20 | int32 status_code = 1;
21 | }
22 |
23 | message GetSavedDesignResponse {
24 | int32 status_code = 1;
25 | repeated string names = 2;
26 | }
27 |
28 | message LoadDesignRequest {
29 | string name = 1;
30 | }
31 |
32 | message LoadDesignResponse {
33 | int32 status_code = 1;
34 | string data = 2;
35 | }
36 |
37 | message DeleteDesignRequest {
38 | string name = 1;
39 | }
40 |
41 | message DeleteDesignResponse {
42 | int32 status_code = 1;
43 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SourceGeneration/Models/DtoTypeModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace AzureDesignStudio.SourceGeneration.Models
4 | {
5 | internal class DtoTypeProperty
6 | {
7 | public string Identifier { get; set; } = default!;
8 | public string Type { get; set; } = default!;
9 | }
10 | internal class DtoTypeModel
11 | {
12 | public string Namespace { get; set; } = default!;
13 | public string ClassName { get; set; } = default!;
14 | public string DtoBase { get; set; } = default!;
15 | public IList Usings { get; set; } = default!;
16 | public IList Properties { get; set; } = default!;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SourceGeneration/Models/MapProfileModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace AzureDesignStudio.SourceGeneration.Models
6 | {
7 | internal class MapModel
8 | {
9 | public string TypeKey { get; set; } = default!;
10 | public string SourceType { get; set; } = default!;
11 | public string DestinationType { get; set; } = default!;
12 | }
13 | internal class MapProfileModel
14 | {
15 | public IList Maps { get; set; } = default!;
16 | public HashSet Usings { get; set; } = default!;
17 | public string Namespace { get; set; } = default!;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SourceGeneration/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SourceGeneration/Templates/AzureNodeDto.scriban:
--------------------------------------------------------------------------------
1 | //
2 | // This code was generated by AzureDesignStudio.SourceGeneration.
3 | // Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
4 | //
5 |
6 | {{ for using in Usings ~}}
7 | using {{ using }};
8 | {{ end ~}}
9 |
10 | namespace {{ Namespace }}
11 | {
12 | public class {{ ClassName }} : {{ DtoBase }}
13 | {
14 | {{ for property in Properties ~}}
15 | public {{ property.Type }} {{ property.Identifier }} { get; set; } = default!;
16 | {{ end ~}}
17 | }
18 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio.SourceGeneration/Templates/AzureNodeProfile.scriban:
--------------------------------------------------------------------------------
1 | //
2 | // This code was generated by AzureDesignStudio.SourceGeneration.
3 | // Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
4 | //
5 |
6 | {{ for using in Usings ~}}
7 | using {{ using }};
8 | {{ end ~}}
9 |
10 | namespace {{ Namespace }}
11 | {
12 | public partial class AzureNodeProfile
13 | {
14 | private partial void CreateAzureNodeMaps()
15 | {
16 | {{~ for map in Maps }}
17 | {{ if !(map.TypeKey | string.empty) ~}}
18 | CreateMapForAzureNode<{{ map.SourceType }}, {{ map.DestinationType }}>({{ map.TypeKey}});
19 | {{ end; end ~}}
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/App.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @if (context.User.Identity?.IsAuthenticated != true)
7 | {
8 |
9 | }
10 | else
11 | {
12 | You are not authorized to access this resource.
13 | }
14 |
15 |
16 |
17 |
18 |
19 | Not found
20 |
21 | Sorry, there's nothing at this address.
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/IconComponent.razor:
--------------------------------------------------------------------------------
1 | @inject IHttpClientFactory clientFactory
2 |
3 |
4 |
5 | @code {
6 | [Parameter]
7 | public string IconPath { get; set; } = null!;
8 |
9 | RenderFragment component =
10 | @
11 | ;
12 |
13 | protected override async Task OnInitializedAsync()
14 | {
15 | if (!string.IsNullOrEmpty(IconPath))
16 | {
17 | var httpClient = clientFactory.CreateClient("AzureDesignStudio.ResourceAccess");
18 | var svgMarkup = await httpClient.GetStringAsync(IconPath);
19 | component = builder =>
20 | {
21 | builder.AddMarkupContent(0, svgMarkup);
22 | };
23 | }
24 |
25 | await base.OnInitializedAsync();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/NodeDrawerTemplate.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Services
2 | @inject AdsContext adsContext
3 |
4 |
5 |
6 | @ChildContent
7 |
8 |
9 |
10 | @code {
11 | [Parameter]
12 | public NodeModel Node { get; set; } = null!;
13 | [Parameter]
14 | public RenderFragment ChildContent { get; set; } =
15 | @;
16 | }
17 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/Stencil.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Models
2 | @using AzureDesignStudio.Services
3 | @inject ILogger logger
4 | @inject IConfiguration configuration
5 | @inject AdsContext adsContext
6 |
7 |
8 |
9 |

10 |
@Model.Label
11 |
12 |
13 |
14 | @code {
15 | [Parameter]
16 | public StencilModel Model { get; set; } = null!;
17 |
18 | void HandleDragStart(DragEventArgs e)
19 | {
20 | adsContext.DraggedStencilKey = Model.Key;
21 | logger.LogInformation($"Drag start. Key: {adsContext.DraggedStencilKey}");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/Stencil.razor.css:
--------------------------------------------------------------------------------
1 | .ads-stencil {
2 | display: table-cell;
3 | width: 69px;
4 | height: 71px;
5 | padding: 6px 6px 4px;
6 | }
7 |
8 | .ads-stencil:hover {
9 | background-color: lightgrey;
10 | }
11 |
12 | .ads-stencil > img {
13 | display: block;
14 | width: 69px;
15 | height: 45px;
16 | margin-left: auto;
17 | margin-right: auto;
18 | }
19 |
20 | .ads-stencil-label {
21 | text-align: center;
22 | font-size: 11px;
23 | overflow: hidden;
24 | white-space: nowrap;
25 | text-overflow: ellipsis;
26 | width: 69px;
27 | height: 26px;
28 | line-height: 26px;
29 | margin: auto;
30 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/StencilPanel.razor.css:
--------------------------------------------------------------------------------
1 | ::deep .ads-icon-panel-container {
2 | clear: both;
3 | }
4 |
5 | ::deep .ads-icon-panel-container .ant-tabs-card .ant-tabs-tab {
6 | padding: 5px;
7 | }
8 |
9 | ::deep .ads-icon-panel-container .ant-tabs-left .ant-tabs-nav {
10 | min-width: 40px;
11 | }
12 |
13 | ::deep .ads-icon-panel-container>.ant-tabs-left> .ant-tabs-nav .ant-tabs-tab {
14 | padding: 6px 2px;
15 | }
16 | ::deep .ads-icon-panel-container .ant-tabs-tab .anticon {
17 | margin-right: 0px;
18 | }
19 |
20 | ::deep .ads-icon-panel-container .ant-tabs-tab-btn {
21 | font-size: 24px;
22 | width: 32px;
23 | line-height: 32px;
24 | }
25 |
26 | ::deep .ads-icon-panel-container .ant-tabs-left .ant-tabs-content-holder {
27 | border-top: 1px solid #f0f0f0;
28 | border-left: 1px solid #f0f0f0;
29 | border-bottom: 1px solid #f0f0f0;
30 | }
31 |
32 | ::deep .ads-icon-panel-container .ant-tabs-left .ant-tabs-content-holder .ant-tabs-content .ant-tabs-tabpane {
33 | padding-left: 0px;
34 | height: calc(100vh - 94px);
35 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Components/TopMenu.razor.css:
--------------------------------------------------------------------------------
1 | ::deep .ant-menu-horizontal {
2 | background-color: #484644;
3 | color: #ffffff;
4 | border-bottom: 0px;
5 | }
6 | ::deep .ant-menu-horizontal .ant-menu-item {
7 | padding: 0px 12px;
8 | margin-top: 0px;
9 | float: right;
10 | }
11 | ::deep .ant-menu-horizontal .ant-menu-item:hover {
12 | background-color: #0e0d0d;
13 | color: #ffffff;
14 | }
15 | ::deep .ant-menu-horizontal > .ant-menu-item::after {
16 | display: none;
17 | }
18 | ::deep .ant-menu-horizontal .ant-menu-item-selected,
19 | ::deep .ant-menu-horizontal .ant-menu-item-selected:hover {
20 | color: #000000;
21 | background-color: #ffffff;
22 | }
23 | ::deep .ant-menu-horizontal .ant-menu-item .anticon {
24 | font-size: 24px;
25 | }
26 |
27 | ::deep .ant-menu-horizontal .ant-menu-item .anticon + span {
28 | margin-left: 3px;
29 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Models/CodeDrawerContent.cs:
--------------------------------------------------------------------------------
1 | using AzureDesignStudio.Core.Models;
2 |
3 | namespace AzureDesignStudio.Models
4 | {
5 | public enum CodeDrawerContentType
6 | {
7 | Json = 0,
8 | Bicep
9 | }
10 | public class CodeDrawerContent
11 | {
12 | public CodeDrawerContentType Type { get; set; }
13 | public string Content { get; set; } = string.Empty;
14 | public IArmTemplate? ArmTemplate { get; set; } = default!;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Models/DeploymentParameters.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace AzureDesignStudio.Models
4 | {
5 | public record ArmParameter
6 | {
7 | public string Name { get; set; } = default!;
8 | }
9 | public record DeploymentParameters
10 | {
11 | [Required]
12 | public string ResourceGroup { get; set; } = default!;
13 | public IDictionary Parameters { get; set; } = null!;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Models/StencilModel.cs:
--------------------------------------------------------------------------------
1 | namespace AzureDesignStudio.Models
2 | {
3 | public class StencilModel
4 | {
5 | public string Key { get; set; } = default!;
6 | public string Name { get; set; } = default!;
7 | public string IconPath { get; set; } = default!;
8 | public string Label { get; set; } = default!;
9 | public string? ReferenceArchPath { get; set; } = null;
10 | public StencilCategory Category { get; set; }
11 | }
12 |
13 | public enum StencilCategory
14 | {
15 | Networking = 0,
16 | Compute,
17 | Database,
18 | Storage,
19 | Others,
20 | Gallery
21 | }
22 |
23 | public record StencilPanelModel
24 | {
25 | public string Key { get; set; } = default!;
26 | public string IconPath { get; set; } = default!;
27 | public StencilCategory Category { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Models/WindowSize.cs:
--------------------------------------------------------------------------------
1 | namespace AzureDesignStudio.Models
2 | {
3 | public class WindowSize
4 | {
5 | public int Width { get; set; }
6 | public int Height { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Pages/Index.razor.css:
--------------------------------------------------------------------------------
1 | .ads-toggle-sider-button {
2 | height: 44px;
3 | float: right;
4 | }
5 |
6 | .ads-toggle-sider-button > div {
7 | border: 1px solid transparent;
8 | padding: 5px 8px;
9 | font-size: 24px;
10 | line-height: 32px;
11 | }
12 |
13 | .ads-toggle-sider-button > div:hover {
14 | color: #1c92fe;
15 | }
16 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:53465/",
7 | "sslPort": 44361
8 | }
9 | },
10 | "profiles": {
11 | "AzureDesignStudio": {
12 | "commandName": "Project",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | },
17 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
18 | "applicationUrl": "https://localhost:7158;http://localhost:5158",
19 | "dotnetRunMessages": true
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "environmentVariables": {
25 | "ASPNETCORE_ENVIRONMENT": "Development"
26 | },
27 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Shared/MainLayout.razor:
--------------------------------------------------------------------------------
1 | @using AzureDesignStudio.Components
2 | @inherits LayoutComponentBase
3 |
4 |
5 |
16 | @Body
17 |
18 |
19 | @code {
20 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/Shared/RedirectToLogin.razor:
--------------------------------------------------------------------------------
1 | @inject NavigationManager Navigation
2 |
3 | @code {
4 | protected override void OnInitialized()
5 | {
6 | Navigation.NavigateTo($"authentication/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}");
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using System.Net.Http.Json
3 | @using Microsoft.AspNetCore.Components.Authorization
4 | @using Microsoft.AspNetCore.Components.Forms
5 | @using Microsoft.AspNetCore.Components.Routing
6 | @using Microsoft.AspNetCore.Components.Web
7 | @using Microsoft.AspNetCore.Components.Web.Virtualization
8 | @using Microsoft.AspNetCore.Components.WebAssembly.Http
9 | @using Microsoft.JSInterop
10 | @using AzureDesignStudio
11 | @using AzureDesignStudio.Shared
12 | @using AntDesign
13 | @using Blazor.Diagrams.Core
14 | @using Blazor.Diagrams.Core.Models
15 | @using Blazor.Diagrams.Components
16 | @using BlazorApplicationInsights
17 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "AzureAdB2C": {
3 | "Authority": "https://azdesignapp.b2clogin.com/azdesignapp.onmicrosoft.com/B2C_1_adssigninup",
4 | "ClientId": "53903153-545a-408e-a16d-1cc5a8b304e9",
5 | "ValidateAuthority": false
6 | },
7 | "B2CScope": "https://azdesignapp.onmicrosoft.com/b29c5bdd-7bd6-4f43-835f-e2c9c358491e/Server.Access",
8 | "ResourceRoot": "https://cdn.azuredesign.app/",
9 | "Logging": {
10 | "LogLevel": {
11 | "Default": "Warning",
12 | "Microsoft.AspNetCore": "Warning"
13 | },
14 | "BlazorApplicationInsights.ApplicationInsightsLoggerProvider": {
15 | "LogLevel": {
16 | "Default": "Information",
17 | "System.Net.Http.HttpClient": "Warning"
18 | }
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chunliu/AzureDesignStudio/2bd69d90d6c8806d53021409a5b0f3b2a44c38db/src/AzureDesignStudio/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chunliu/AzureDesignStudio/2bd69d90d6c8806d53021409a5b0f3b2a44c38db/src/AzureDesignStudio/wwwroot/icon-192.png
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chunliu/AzureDesignStudio/2bd69d90d6c8806d53021409a5b0f3b2a44c38db/src/AzureDesignStudio/wwwroot/icon-512.png
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "AzureDesignStudio",
3 | "short_name": "AzureDesignStudio",
4 | "start_url": "./",
5 | "display": "standalone",
6 | "background_color": "#ffffff",
7 | "theme_color": "#03173d",
8 | "prefer_related_applications": false,
9 | "icons": [
10 | {
11 | "src": "icon-512.png",
12 | "type": "image/png",
13 | "sizes": "512x512"
14 | },
15 | {
16 | "src": "icon-192.png",
17 | "type": "image/png",
18 | "sizes": "192x192"
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/src/AzureDesignStudio/wwwroot/service-worker.js:
--------------------------------------------------------------------------------
1 | // In development, always fetch from the network and do not enable offline support.
2 | // This is because caching would make development more difficult (changes would not
3 | // be reflected on the first load after each change).
4 | self.addEventListener('fetch', () => { });
5 |
--------------------------------------------------------------------------------
/src/Configurations/main/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: ads-main
5 | namespace: ads
6 | labels:
7 | app: ads-main
8 | spec:
9 | replicas: 2
10 | selector:
11 | matchLabels:
12 | app: ads-main
13 | template:
14 | metadata:
15 | labels:
16 | app: ads-main
17 | spec:
18 | serviceAccountName: adssvcaccount
19 | containers:
20 | - name: ads-main
21 | image: chunliu.azurecr.io/ads-server:0.4.3-7
22 | imagePullPolicy: IfNotPresent
23 | resources:
24 | limits:
25 | memory: 2Gi
26 | cpu: 750m
27 | ports:
28 | - containerPort: 80
29 | protocol: TCP
30 | env:
31 | - name: ASPNETCORE_HTTPS_PORT
32 | value: "443"
33 |
--------------------------------------------------------------------------------
/src/Configurations/main/ingress.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: networking.k8s.io/v1
2 | kind: Ingress
3 | metadata:
4 | name: ads-main-ingress
5 | namespace: ads
6 | labels:
7 | name: ads-main
8 | annotations:
9 | cert-manager.io/cluster-issuer: letsencrypt-issuer
10 | nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
11 | nginx.ingress.kubernetes.io/limit-rps: "30"
12 | spec:
13 | ingressClassName: nginx
14 | tls:
15 | - hosts:
16 | - www.azuredesign.app
17 | secretName: tls-main-secret
18 | rules:
19 | - host: www.azuredesign.app
20 | http:
21 | paths:
22 | - pathType: ImplementationSpecific
23 | path: /
24 | backend:
25 | service:
26 | name: ads-main-svc
27 | port:
28 | number: 80
29 |
--------------------------------------------------------------------------------
/src/Configurations/main/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: ads-main-svc
5 | namespace: ads
6 | labels:
7 | app: ads-main
8 | spec:
9 | type: ClusterIP
10 | selector:
11 | app: ads-main
12 | ports:
13 | - port: 80
14 | targetPort: 80
15 | protocol: TCP
16 |
--------------------------------------------------------------------------------
/src/DockerBuild.ps1:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env pwsh
2 |
3 | Write-Host "Get Nerdbank Git Version."
4 |
5 | nbgv get-version -f json | Out-File .\nbgv-version.json
6 |
7 | .\GenerateVersioningTargets.ps1
8 |
9 | docker build -f ./AzureDesignStudio.Server/Dockerfile -t azuredesignstudioserver --force-rm .
10 |
11 | Remove-Item -Path .\nbgv-version.json, .\Directory.Build.targets
12 |
13 | Write-Host "Build completed."
--------------------------------------------------------------------------------
/src/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3 | "version": "0.4",
4 | "cloudBuild": {
5 | "setVersionVariables": false
6 | }
7 | }
--------------------------------------------------------------------------------