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 5 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.
Empty file.
46 changes: 46 additions & 0 deletions Apps/W1/File - Azure BLOB Storage Connector/app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": "c9ce86fe-cb70-4b79-be03-d21856b1a4ca",
"name": "File - Azure BLOB Storage Connector",
"publisher": "Microsoft",
"brief": "Enable all users to use a Azure Blob Storage to save files from Business Central.",
"description": "This app enables all users to store files in the smae azure blob storage in Business Central.",
"version": "22.1.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": "22.0.0.0",
"internalsVisibleTo": [

],
"dependencies": [
{
"id": "c9c54414-80c3-4cc9-98c6-589158882774",
"name": "File Access",
"publisher": "Microsoft",
"version": "22.1.0.0"
}
],
"screenshots": [

],
"platform": "22.0.0.0",
"idRanges": [
{
"from": 80100,
"to": 80199
},
{
"from": 2147483647,
"to": 2147483647
}
],
"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,84 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

/// <summary>
/// Displays an account that was registered via the Blob Storage connector.
/// </summary>
page 80100 "Blob Storage Account"
{
SourceTable = "Blob Storage Account";
Caption = 'Azure Blob Storage Account';
Permissions = tabledata "Blob Storage 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(StorageAccountNameField; Rec."Storage Account Name")
{
ApplicationArea = All;
Caption = 'Storage Account Name';
ToolTip = 'Specifies the Azure Storage name.';
}

field(Password; Password)
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
{
ApplicationArea = All;
Caption = 'Password';
Editable = PasswordEditable;
ExtendedDatatype = Masked;
ToolTip = 'Specifies the shared key to access the Storage Blob.';

trigger OnValidate()
begin
Rec.SetPassword(Password);
end;
}

field(ContainerNameField; Rec."Container Name")
{
ApplicationArea = All;
Caption = 'Container Name';
ToolTip = 'Specifies the Azure Storage Container name.';
}
}
}

actions
{
area(processing)
{
//TODO Add File Browser
}
}

var
[InDataSet]
PasswordEditable: Boolean;
[NonDebuggable]
[InDataSet]
Password: Text;

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

if not IsNullGuid(Rec."Password Key") then
Password := '***';
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

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

Caption = 'Azure Blob Storage Account';

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

field(2; Name; Text[250])
{
DataClassification = CustomerContent;
Caption = 'Name of account';
}
field(3; "Storage Account Name"; Text[2048])
{
Caption = 'Storage Account Name';
}
field(4; "Container Name"; Text[2048])
{
Caption = 'Container Name';
}
field(8; "Password Key"; Guid)
{
DataClassification = SystemMetadata;
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
}
}

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

var
UnableToGetPasswordMsg: Label 'Unable to get Blob Storage Account Key';
UnableToSetPasswordMsg: Label 'Unable to set Blob Storage Account Key';

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

[NonDebuggable]
procedure SetPassword(Password: Text)
begin
if IsNullGuid(Rec."Password Key") then
Rec."Password Key" := CreateGuid();

if not IsolatedStorage.Set(Format(Rec."Password Key"), Password, DataScope::Company) then
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
Error(UnableToSetPasswordMsg);
end;

[NonDebuggable]
procedure GetPassword(PasswordKey: Guid) Password: Text
begin
if not IsolatedStorage.Get(Format(PasswordKey), DataScope::Company, Password) then
Error(UnableToGetPasswordMsg);
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

/// <summary>
/// Displays an account that is being registered via the Blob Storage connector.
/// </summary>
page 80101 "Blob Storage Account Wizard"
{
Caption = 'Setup Azure Blob Storage Account';
SourceTable = "Blob Storage Account";
SourceTableTemporary = true;
Permissions = tabledata "Blob Storage Account" = rimd;
PageType = NavigatePage;
Extensible = false;
Editable = true;

layout
{
area(Content)
{
group(TopBanner)
{
Editable = false;
ShowCaption = false;
Visible = TopBannerVisible;
field(NotDoneIcon; MediaResources."Media Reference")
{
ApplicationArea = All;
Editable = false;
ShowCaption = false;
ToolTip = ' ';
Caption = ' ';
}
}

field(NameField; Rec.Name)
{
ApplicationArea = All;
Caption = 'Account Name';
ToolTip = 'Specifies the name of the Azure Blob Storage account.';
ShowMandatory = true;
NotBlank = true;

trigger OnValidate()
begin
IsNextEnabled := BlobStorageConnectorImpl.IsAccountValid(Rec);
end;
}

field(StorageAccountNameField; Rec."Storage Account Name")
{
ApplicationArea = All;
Caption = 'Storage Account Name';
ToolTip = 'Specifies the Azure Storage name.';
ShowMandatory = true;

trigger OnValidate()
begin
IsNextEnabled := BlobStorageConnectorImpl.IsAccountValid(Rec);
end;
}

field(PasswordField; Password)
{
ApplicationArea = All;
Caption = 'Password';
ExtendedDatatype = Masked;
ToolTip = 'Specifies the shared key of the Storage Blob.';
ShowMandatory = true;
}

field(ContainerNameField; Rec."Container Name")
{
ApplicationArea = All;
Caption = 'Container Name';
ToolTip = 'Specifies the container to use of the Storage Blob.';
ShowMandatory = true;

trigger OnLookup(var Text: Text): Boolean
var
BlobStorageConnectorImpl: Codeunit "Blob Storage Connector Impl.";
begin
BlobStorageConnectorImpl.LookUpContainer(Rec, Password, Text);
exit(true);
end;

trigger OnValidate()
begin
IsNextEnabled := BlobStorageConnectorImpl.IsAccountValid(Rec);
end;
}
}
}

actions
{
area(processing)
{
action(Back)
{
ApplicationArea = All;
Caption = 'Back';
ToolTip = 'Back';
Image = Cancel;
InFooterBar = true;

trigger OnAction()
begin
CurrPage.Close();
end;
}

action(Next)
{
ApplicationArea = All;
Caption = 'Next';
Image = NextRecord;
Enabled = IsNextEnabled;
InFooterBar = true;
ToolTip = 'Next';

trigger OnAction()
begin
BlobStorageConnectorImpl.CreateAccount(Rec, Password, BlobStorageAccount);
CurrPage.Close();
end;
}
}
}

var
BlobStorageAccount: Record "File Account";
MediaResources: Record "Media Resources";
BlobStorageConnectorImpl: Codeunit "Blob Storage Connector Impl.";
[NonDebuggable]
[InDataSet]
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
Password: Text;
IsNextEnabled: Boolean;
TopBannerVisible: Boolean;

trigger OnOpenPage()
begin
Rec.Init();
Rec.Insert();

if MediaResources.Get('ASSISTEDSETUP-NOTEXT-400PX.PNG') and (CurrentClientType() = ClientType::Web) then
IceOnly marked this conversation as resolved.
Show resolved Hide resolved
TopBannerVisible := MediaResources."Media Reference".HasValue();
end;

internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean
begin
if IsNullGuid(BlobStorageAccount."Account Id") then
exit(false);

FileAccount := BlobStorageAccount;

exit(true);
end;
}
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.
// ------------------------------------------------------------------------------------------------

/// <summary>
/// Enum extension to register the Blob Storage connector.
/// </summary>
enumextension 80100 "Blob Storage Connector" extends "File Connector"
{
/// <summary>
/// The Blob Storage connector.
/// </summary>
value(2147483647; "Blob Storage") // Max int value so it appears last //FIXME Id from Module
{
Caption = 'Blob Storage';
Implementation = "File Connector" = "Blob Storage Connector Impl.";
}
}
Loading