Skip to content

Commit ef64311

Browse files
author
Dmitriy Kozlov
committed
merged multiple projects into single one.
1 parent ad59b5d commit ef64311

29 files changed

+41
-360
lines changed

.deployment

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[config]
2-
project = Dynamics365/BusinessCentral/Dynamics365.BusinessCentral.csproj
2+
project = FunctionApp/FunctionApp.csproj

Dynamics365/BusinessCentral/Startup.cs

-24
This file was deleted.
File renamed without changes.

Dynamics365/BusinessCentral/Authorize.cs FunctionApp/Dynamics365/BusinessCentral/Authorize.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public Authorize(IOptions<AppSettings> settings)
3030
_settings = settings.Value.AzureApp;
3131
}
3232

33-
[FunctionName("Dynamics365-BusinessCentral-Authorize")]
33+
[FunctionName("D365-BC-Authorize")]
3434
public async Task<IActionResult> Run(
3535
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
3636
ILogger log)
@@ -53,7 +53,7 @@ public async Task<IActionResult> Run(
5353

5454
_ = await app.AcquireTokenByAuthorizationCode(scopes, code).ExecuteAsync();
5555

56-
return new OkResult();
56+
return new OkObjectResult("The app is authorized to perform operations on behalf of your account.");
5757
}
5858

5959
var url = new StringBuilder();

Dynamics365/BusinessCentral/Customers.cs FunctionApp/Dynamics365/BusinessCentral/Customers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Customers(IOptions<AppSettings> settings, GraphServiceClientProvider grap
3232
_graphProvider = graphProvider;
3333
}
3434

35-
[FunctionName("Dynamics365-BusinessCentral-Customers")]
35+
[FunctionName("D365-BC-Customers")]
3636
public async Task<IActionResult> Run(
3737
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
3838
ILogger log)

Dynamics365/BusinessCentral/Items.cs FunctionApp/Dynamics365/BusinessCentral/Items.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Items(IOptions<AppSettings> settings, GraphServiceClientProvider graphPro
3232
_graphProvider = graphProvider;
3333
}
3434

35-
[FunctionName("Dynamics365-BusinessCentral-Items")]
35+
[FunctionName("D365-BC-Items")]
3636
public async Task<IActionResult> Run(
3737
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
3838
ILogger log)

Dynamics365/BusinessCentral/Vendors.cs FunctionApp/Dynamics365/BusinessCentral/Vendors.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Vendors(IOptions<AppSettings> settings, GraphServiceClientProvider graphP
3232
_graphProvider = graphProvider;
3333
}
3434

35-
[FunctionName("Dynamics365-BusinessCentral-Vendors")]
35+
[FunctionName("D365-BC-Vendors")]
3636
public async Task<IActionResult> Run(
3737
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
3838
ILogger log)

Dynamics365/BusinessCentral/Dynamics365.BusinessCentral.csproj FunctionApp/FunctionApp.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
5-
<AssemblyName>Plumsail.DataSource.Dynamics365.BusinessCentral</AssemblyName>
6-
<RootNamespace>Plumsail.DataSource.Dynamics365.BusinessCentral</RootNamespace>
5+
<AssemblyName>Plumsail.DataSource.FunctionApp</AssemblyName>
6+
<RootNamespace>Plumsail.DataSource</RootNamespace>
77
</PropertyGroup>
88
<ItemGroup>
99
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
File renamed without changes.
File renamed without changes.
File renamed without changes.

FunctionApp/Startup.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
2+
using Microsoft.Extensions.Configuration;
3+
using Microsoft.Extensions.DependencyInjection;
4+
using System;
5+
using D365_BC = Plumsail.DataSource.Dynamics365.BusinessCentral;
6+
using SP = Plumsail.DataSource.SharePoint;
7+
8+
[assembly: FunctionsStartup(typeof(Plumsail.DataSource.FunctionApp.Startup))]
9+
namespace Plumsail.DataSource.FunctionApp
10+
{
11+
public class Startup : FunctionsStartup
12+
{
13+
public override void Configure(IFunctionsHostBuilder builder)
14+
{
15+
IConfigurationRoot configuration = new ConfigurationBuilder()
16+
.SetBasePath(Environment.CurrentDirectory)
17+
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
18+
.AddEnvironmentVariables()
19+
.Build();
20+
21+
builder.Services.Configure<D365_BC.Settings.AppSettings>(configuration.GetSection("Dynamics365.BusinessCentral"));
22+
builder.Services.AddTransient<D365_BC.GraphServiceClientProvider>();
23+
24+
builder.Services.Configure<SP.Settings.AppSettings>(configuration.GetSection("SharePoint"));
25+
builder.Services.AddTransient<SP.GraphServiceClientProvider>();
26+
}
27+
}
28+
}
File renamed without changes.

Plumsail.DataSource.sln

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharePoint", "SharePoint\Sh
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dynamics365.BusinessCentral", "Dynamics365\BusinessCentral\Dynamics365.BusinessCentral.csproj", "{B0CB2C8F-B264-4AA4-8CBE-35F32791E870}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionsApp", "FunctionsApp\FunctionsApp.csproj", "{EFCE1BCA-A1D8-46D5-8681-5D96C16FC760}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunctionApp", "FunctionApp\FunctionApp.csproj", "{0FAFFD8B-D101-4438-963D-31F778E2CFCB}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,10 +23,10 @@ Global
2323
{B0CB2C8F-B264-4AA4-8CBE-35F32791E870}.Debug|Any CPU.Build.0 = Debug|Any CPU
2424
{B0CB2C8F-B264-4AA4-8CBE-35F32791E870}.Release|Any CPU.ActiveCfg = Release|Any CPU
2525
{B0CB2C8F-B264-4AA4-8CBE-35F32791E870}.Release|Any CPU.Build.0 = Release|Any CPU
26-
{EFCE1BCA-A1D8-46D5-8681-5D96C16FC760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27-
{EFCE1BCA-A1D8-46D5-8681-5D96C16FC760}.Debug|Any CPU.Build.0 = Debug|Any CPU
28-
{EFCE1BCA-A1D8-46D5-8681-5D96C16FC760}.Release|Any CPU.ActiveCfg = Release|Any CPU
29-
{EFCE1BCA-A1D8-46D5-8681-5D96C16FC760}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{0FAFFD8B-D101-4438-963D-31F778E2CFCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{0FAFFD8B-D101-4438-963D-31F778E2CFCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{0FAFFD8B-D101-4438-963D-31F778E2CFCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{0FAFFD8B-D101-4438-963D-31F778E2CFCB}.Release|Any CPU.Build.0 = Release|Any CPU
3030
EndGlobalSection
3131
GlobalSection(SolutionProperties) = preSolution
3232
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)