Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Blob Storage, Azure File Share and SharePoint Online Connector Apps #23225

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7584061
Initial commit
IceOnly May 3, 2023
6ecfacc
Add File Browser
IceOnly May 4, 2023
25bc19c
Add File System Codeunit
IceOnly May 5, 2023
959f05e
Add documentation and small changes
IceOnly May 5, 2023
4bb4080
Fix up action
IceOnly May 5, 2023
4acb5f1
Remove all indataset
IceOnly Oct 6, 2023
74c5ece
Store Assisted Setup Image in a locked label
IceOnly Oct 6, 2023
f7af2e7
Add review changes
IceOnly Oct 6, 2023
c4cd06b
Add pagination support
IceOnly Oct 6, 2023
24725be
Rename Module
IceOnly Oct 6, 2023
763a7a0
Add directory support to Storage Blob Implementation
IceOnly Oct 6, 2023
e67351e
Use actionref in Account Browser
IceOnly Oct 6, 2023
ac6c08e
Add permissions
IceOnly Oct 6, 2023
4d88e2c
Add permission sets
IceOnly Oct 6, 2023
c5fc386
Fix application area
IceOnly Oct 6, 2023
248542b
Add namespace and disclaimer to all files
IceOnly Oct 9, 2023
3a5573f
Merge branch 'main' of https://github.com/microsoft/ALAppExtensions i…
IceOnly Oct 9, 2023
06d382a
Fix version
IceOnly Oct 9, 2023
32793d8
Remove system apps
IceOnly Feb 29, 2024
d256d81
Remove app.json
IceOnly Feb 29, 2024
5965d1b
Update app.json
IceOnly Feb 29, 2024
4bda136
Fix app.json
IceOnly Feb 29, 2024
7c10d31
Update to BC24
IceOnly Feb 29, 2024
a02efa8
Rename app
IceOnly Feb 29, 2024
1008fbd
Add file share connector
IceOnly Feb 29, 2024
474d088
Add both auth types
IceOnly Mar 1, 2024
bfca361
Apply interface changes
IceOnly Mar 1, 2024
d399759
Fix auth case type
IceOnly Mar 1, 2024
b82e490
Fix File Exists
IceOnly Mar 1, 2024
5864984
Add SharePoint Connector
IceOnly Mar 1, 2024
3b82bc0
Fix sharepoint connector
IceOnly Mar 1, 2024
e6e5ec9
Add review suggestions
IceOnly Mar 3, 2024
56d5525
Remove nondebuggable from SecretText Get And Set procedures
IceOnly Mar 5, 2024
7a31007
Remove old analyse variables
IceOnly Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Apps/W1/File - SharePoint Connector/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# File SharePoint Connector
This conenctor allows access to Sahre Point Files and Folder.
A proper App Registration with Sites.ReadWrite.All permission is needed.
31 changes: 31 additions & 0 deletions Apps/W1/File - SharePoint Connector/app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"id": "34bfcef7-f8ed-449f-94be-74024cadba3b",
"name": "File - SharePoint Connector",
"publisher": "Microsoft",
"brief": "Enable all users to use SharePoint Folders to save files from Business Central.",
"description": "This app enables all users to store files in SharePoint Folders with Business Central.",
"version": "25.0.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?linkid=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?linkid=2134520",
"url": "https://go.microsoft.com/fwlink/?linkid=724011",
"logo": "ExtensionLogo.png",
"application": "24.0.0.0",
"internalsVisibleTo": [],
"dependencies": [],
"screenshots": [],
"platform": "24.0.0.0",
"idRanges": [
{
"from": 80300,
"to": 80399
}
],
"target": "OnPrem",
"resourceExposurePolicy": {
"allowDebugging": false,
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2134520"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionsetextension 80300 "SharePoint - Admin" extends "File System - Admin"
{
IncludedPermissionSets = "SharePoint - Edit";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionset 80302 "SharePoint - Edit"
{
Assignable = false;
Access = Public;
Caption = 'SharePoint - Edit';

IncludedPermissionSets = "SharePoint - Read";

Permissions =
tabledata "SharePoint Account" = imd;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionset 80300 "SharePoint - Objects"
{
Assignable = false;
Access = Public;
Caption = 'SharePoint - Objects';

Permissions =
table "SharePoint Account" = X,
codeunit "SharePoint Connector Impl." = X,
page "SharePoint Account Wizard" = X,
page "SharePoint Account" = X;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

permissionset 80301 "SharePoint - Read"
{
Assignable = false;
Access = Public;
Caption = 'SharePoint - Read';

IncludedPermissionSets = "SharePoint - Objects";

Permissions =
tabledata "SharePoint Account" = r;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

/// <summary>
/// Displays an account that was registered via the SharePoint connector.
/// </summary>
page 80300 "SharePoint Account"
{
SourceTable = "SharePoint Account";
Caption = 'SharePoint Account';
Permissions = tabledata "SharePoint Account" = rimd;
PageType = Card;
Extensible = false;
InsertAllowed = false;
DataCaptionExpression = Rec.Name;

layout
{
area(Content)
{
field(NameField; Rec.Name)
{
ApplicationArea = All;
Caption = 'Account Name';
ToolTip = 'Specifies the name of the storage account connection.';
ShowMandatory = true;
NotBlank = true;
}

field("Tenant Id"; Rec."Tenant Id")
{
ApplicationArea = All;
ToolTip = 'Specifies the Tenant Id of the App Registration.';
}

field("Client Id"; Rec."Client Id")
{
ApplicationArea = All;
ToolTip = 'Specifies the the Client Id of the App Registration.';
}

field(SecretField; ClientSecret)
{
ApplicationArea = All;
Caption = 'Password';
Editable = ClientSecretEditable;
ExtendedDatatype = Masked;
ToolTip = 'Specifies the the Client Secret of the App Registration.';

trigger OnValidate()
begin
Rec.SetClientSecret(ClientSecret);
end;
}

field("SharePoint Url"; Rec."SharePoint Url")
{
ApplicationArea = All;
Caption = 'SharePoint Url';
ToolTip = 'Specifies the the url to your SharePoint site.';
}

field("Base Relative Folder Path"; Rec."Base Relative Folder Path")
{
ApplicationArea = All;
ToolTip = 'Specifies the Base Relative Folder Path to use for this account.';
}
}
}

var
ClientSecretEditable: Boolean;
[NonDebuggable]
ClientSecret: Text;

trigger OnOpenPage()
begin
Rec.SetCurrentKey(Name);

if not IsNullGuid(Rec."Client Secret Key") then
ClientSecret := '***';
end;

trigger OnAfterGetCurrRecord()
begin
ClientSecretEditable := CurrPage.Editable();
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.FileSystem;

/// <summary>
/// Holds the information for all file accounts that are registered via the SharePoint connector
/// </summary>
table 80300 "SharePoint Account"
{
Access = Internal;

Caption = 'SharePoint Account';

fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IceOnly could you maybe add the 2nd Authentication Type for SharePoint that was added recently .
This would require a few new Fields: Enum SharePointAuthType , a "Certificate Password Key" and a Certificate Password (Blob)

See: microsoft/BCApps#705

{
field(1; "Id"; Guid)
{
DataClassification = SystemMetadata;
Caption = 'Primary Key';
}

field(2; Name; Text[250])
{
DataClassification = CustomerContent;
Caption = 'Name of account';
}
field(4; "SharePoint Url"; Text[2048])
{
Caption = 'SharePoint Url';
}
field(5; "Base Relative Folder Path"; Text[2048])
{
Caption = 'Base Relative Folder Path';
}
field(6; "Tenant Id"; Text[36])
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
{
Caption = 'Tenant Id';
}
field(7; "Client Id"; Text[36])
{
Caption = 'Client Id';
}
field(8; "Client Secret Key"; Guid)
{
DataClassification = SystemMetadata;
}
}

keys
{
key(PK; Id)
{
Clustered = true;
}
}

var
UnableToGetClientMsg: Label 'Unable to get SharePoint Account Client Secret.';
UnableToSetClientSecretMsg: Label 'Unable to set SharePoint Client Secret.';

trigger OnDelete()
begin
if not IsNullGuid(Rec."Client Secret Key") then
if IsolatedStorage.Delete(Rec."Client Secret Key") then;
end;

[NonDebuggable]
procedure SetClientSecret(ClientSecret: SecretText)
begin
if IsNullGuid(Rec."Client Secret Key") then
Rec."Client Secret Key" := CreateGuid();

if not IsolatedStorage.Set(Format(Rec."Client Secret Key"), ClientSecret, DataScope::Company) then
Error(UnableToSetClientSecretMsg);
end;

[NonDebuggable]
procedure GetClientSecret(ClientSecretKey: Guid) ClientSecret: SecretText
begin
if not IsolatedStorage.Get(Format(ClientSecretKey), DataScope::Company, ClientSecret) then
Error(UnableToGetClientMsg);
end;
}
Loading
Loading