Skip to content

Commit 725db59

Browse files
committed
make azure app
1 parent 668ffbf commit 725db59

File tree

10 files changed

+168
-6
lines changed

10 files changed

+168
-6
lines changed

.github/workflows/master_netcoreblockly.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ jobs:
2020
uses: actions/setup-dotnet@v1
2121
with:
2222
dotnet-version: '7.x'
23-
include-prerelease: true
23+
include-prerelease: false
2424

2525
- name: Build with dotnet
26-
run: dotnet build --configuration Release
26+
run: |
27+
cd src
28+
cd NetCore2Blockly
29+
cd DeploySampleSiteAzure
30+
dotnet build --configuration Release
2731
2832
- name: dotnet publish
29-
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
33+
run: |
34+
cd src
35+
cd NetCore2Blockly
36+
cd DeploySampleSiteAzure
37+
dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
3038
3139
- name: Upload artifact for deployment job
3240
uses: actions/upload-artifact@v2
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace DeploySampleSiteAzure.Controllers
4+
{
5+
[ApiController]
6+
[Route("[controller]")]
7+
public class WeatherForecastController : ControllerBase
8+
{
9+
private static readonly string[] Summaries = new[]
10+
{
11+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12+
};
13+
14+
private readonly ILogger<WeatherForecastController> _logger;
15+
16+
public WeatherForecastController(ILogger<WeatherForecastController> logger)
17+
{
18+
_logger = logger;
19+
}
20+
21+
[HttpGet(Name = "GetWeatherForecast")]
22+
public IEnumerable<WeatherForecast> Get()
23+
{
24+
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
25+
{
26+
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
27+
TemperatureC = Random.Shared.Next(-20, 55),
28+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
29+
})
30+
.ToArray();
31+
}
32+
}
33+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.0" />
11+
<PackageReference Include="NetCore2Blockly" Version="5.2022.730.2029" />
12+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
13+
</ItemGroup>
14+
15+
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using NetCore2BlocklyNew;
2+
3+
var builder = WebApplication.CreateBuilder(args);
4+
5+
// Add services to the container.
6+
7+
builder.Services.AddControllers();
8+
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
9+
builder.Services.AddEndpointsApiExplorer();
10+
builder.Services.AddSwaggerGen();
11+
12+
var app = builder.Build();
13+
14+
// Configure the HTTP request pipeline.
15+
if (app.Environment.IsDevelopment())
16+
{
17+
app.UseSwagger();
18+
app.UseSwaggerUI();
19+
}
20+
21+
app.UseAuthorization();
22+
23+
app.MapControllers();
24+
app.UseBlocklyUI(app.Environment);
25+
//after app.MapControllers();
26+
app.UseBlocklyAutomation();
27+
28+
29+
app.Run();
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:51384",
8+
"sslPort": 0
9+
}
10+
},
11+
"profiles": {
12+
"http": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"launchUrl": "swagger",
17+
"applicationUrl": "http://localhost:5277",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
},
22+
"IIS Express": {
23+
"commandName": "IISExpress",
24+
"launchBrowser": true,
25+
"launchUrl": "swagger",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
}
30+
}
31+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace DeploySampleSiteAzure
2+
{
3+
public class WeatherForecast
4+
{
5+
public DateOnly Date { get; set; }
6+
7+
public int TemperatureC { get; set; }
8+
9+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10+
11+
public string? Summary { get; set; }
12+
}
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<body>
3+
<header>
4+
<meta http-equiv="refresh" content="1;url=/BlocklyAutomation/index.html" />
5+
</header>
6+
If not redirected, please navigate to <a href="/BlocklyAutomation">BlocklyAutomation</a>
7+
8+
9+
</body>
10+
</html>

src/NetCore2Blockly/NetCore2Blockly.sln

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30002.166
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33122.133
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A190D5B6-C2BF-4EAF-8ACC-FC8CAF7710CA}"
77
EndProject
@@ -23,7 +23,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore2BlocklyUnitTests",
2323
EndProject
2424
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore2BlocklyStorage.Sqlite", "NetCore2BlocklyStorage.Sqlite\NetCore2BlocklyStorage.Sqlite.csproj", "{DC8D0F30-C574-4B22-9357-3A42F651E9C0}"
2525
EndProject
26-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore2BlocklyNew", "NetCore2BlocklyNew\NetCore2BlocklyNew.csproj", "{8DE4C48C-9CF7-487F-8854-B34FA818EB23}"
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore2BlocklyNew", "NetCore2BlocklyNew\NetCore2BlocklyNew.csproj", "{8DE4C48C-9CF7-487F-8854-B34FA818EB23}"
27+
EndProject
28+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeploySampleSiteAzure", "DeploySampleSiteAzure\DeploySampleSiteAzure.csproj", "{11787BD7-05F3-4CB4-AF6B-FB6DBD88A5E7}"
2729
EndProject
2830
Global
2931
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -55,6 +57,10 @@ Global
5557
{8DE4C48C-9CF7-487F-8854-B34FA818EB23}.Debug|Any CPU.Build.0 = Debug|Any CPU
5658
{8DE4C48C-9CF7-487F-8854-B34FA818EB23}.Release|Any CPU.ActiveCfg = Release|Any CPU
5759
{8DE4C48C-9CF7-487F-8854-B34FA818EB23}.Release|Any CPU.Build.0 = Release|Any CPU
60+
{11787BD7-05F3-4CB4-AF6B-FB6DBD88A5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61+
{11787BD7-05F3-4CB4-AF6B-FB6DBD88A5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
62+
{11787BD7-05F3-4CB4-AF6B-FB6DBD88A5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
63+
{11787BD7-05F3-4CB4-AF6B-FB6DBD88A5E7}.Release|Any CPU.Build.0 = Release|Any CPU
5864
EndGlobalSection
5965
GlobalSection(SolutionProperties) = preSolution
6066
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)