Skip to content

Add comprehensive documentation for DeliveryTargets and NuGet/GitHub Packages in AL-Go #1823

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
22 changes: 14 additions & 8 deletions Scenarios/DeliveryTargets.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ GitHub Packages provides a free NuGet feed for each GitHub organization. This is

Create an organizational secret named `GitHubPackagesContext` with the following compressed JSON format:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we want a warning here too to better catch attention that making the secret multi-line will break stuff.

Copy link
Author

Choose a reason for hiding this comment

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

Added a warning about multi-line JSON breaking AL-Go functionality as curly brackets get masked in logs. 7c6f864

Copy link
Contributor

Choose a reason for hiding this comment

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

Warning is fine, but maybe it looks better to place it either right above or right below the tip?

Copy link
Author

Choose a reason for hiding this comment

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

Repositioned the warning to be right below the tip for better visibility. e9cb037


> [!WARNING]
> The secret must be in compressed JSON format (single line). Multi-line JSON will break AL-Go functionality as curly brackets will be masked in logs.

```json
{"token":"ghp_YOUR_TOKEN_HERE","serverUrl":"https://nuget.pkg.github.com/YOUR_ORG/index.json"}
{"token":"ghp_<your_token>","serverUrl":"https://nuget.pkg.github.com/<your_org>/index.json"}
```

Replace:

- `YOUR_TOKEN_HERE` with your personal access token
- `YOUR_ORG` with your GitHub organization name
- `<your_token>` with your personal access token
- `<your_org>` with your GitHub organization name

> [!TIP]
> Use the BcContainerHelper function `New-ALGoNuGetContext` to create a correctly formatted JSON structure.
Expand Down Expand Up @@ -96,14 +99,17 @@ For custom NuGet feeds (e.g., Azure DevOps Artifacts, private NuGet servers), us

Create a secret named `NuGetContext` with the following format:

> [!NOTE]
> Replace `<your_token>`, `<your_org>`, `<your_project>`, and `<your_feed>` with your actual values.

```json
{"token":"YOUR_NUGET_TOKEN","serverUrl":"https://pkgs.dev.azure.com/YOUR_ORG/YOUR_PROJECT/_packaging/YOUR_FEED/nuget/v3/index.json"}
{"token":"<your_token>","serverUrl":"https://pkgs.dev.azure.com/<your_org>/<your_project>/_packaging/<your_feed>/nuget/v3/index.json"}
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a comment here about replacing YOUR_NUGET_TOKEN, YOUR_ORG and YOUR_FEED to keep it consistent with the text above?

Copy link
Author

Choose a reason for hiding this comment

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

Added a note explaining what values to replace in the JSON example (token, org, project, feed). 7c6f864

Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably keep the text 'YOUR_NUGET_TOKEN' but wrapped in <>.

Copy link
Author

Choose a reason for hiding this comment

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

Changed token format back to <YOUR_NUGET_TOKEN> wrapped in angle brackets as requested. e9cb037

Common NuGet feed URLs:

- **Azure DevOps**: `https://pkgs.dev.azure.com/{org}/{project}/_packaging/{feedName}/nuget/v3/index.json`
- **GitHub Packages**: `https://nuget.pkg.github.com/{org}/index.json`
- **Azure DevOps**: `https://pkgs.dev.azure.com/<org>/<project>/_packaging/<feedName>/nuget/v3/index.json`
- **GitHub Packages**: `https://nuget.pkg.github.com/<org>/index.json`
- **NuGet.org**: `https://api.nuget.org/v3/index.json`

### Step 2: Configure Dependency Resolution (Optional)
Expand All @@ -114,7 +120,7 @@ Unlike GitHub Packages, NuGet feeds configured with `NuGetContext` are not autom
{
"trustedNuGetFeeds": [
{
"url": "https://pkgs.dev.azure.com/YOUR_ORG/YOUR_PROJECT/_packaging/YOUR_FEED/nuget/v3/index.json",
"url": "https://pkgs.dev.azure.com/<your_org>/<your_project>/_packaging/<your_feed>/nuget/v3/index.json",
"authTokenSecret": "NuGetContext",
"patterns": ["*"]
}
Expand Down Expand Up @@ -152,7 +158,7 @@ Unlike GitHub Packages, NuGet feeds configured with `NuGetContext` are not autom
**Repository Secret**: `NuGetContext`

```json
{"token":"YOUR_AZURE_DEVOPS_TOKEN","serverUrl":"https://pkgs.dev.azure.com/contoso/BusinessCentral/_packaging/BC-Apps/nuget/v3/index.json"}
{"token":"<your_token>","serverUrl":"https://pkgs.dev.azure.com/contoso/BusinessCentral/_packaging/BC-Apps/nuget/v3/index.json"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to above. your_token is more generic that the previous your_azure_devops_token.

Copy link
Author

Choose a reason for hiding this comment

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

Made the token name more specific by changing it to <YOUR_AZURE_DEVOPS_TOKEN> for Azure DevOps examples. e9cb037

```

**AL-Go-Settings.json**:
Expand Down
2 changes: 1 addition & 1 deletion Workshop/ContinuousDelivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ For comprehensive documentation on setting up NuGet and GitHub Packages delivery
1. **Create Personal Access Token**: Create a classic personal access token with `write:packages` scope
1. **Create Organizational Secret**: Create `GitHubPackagesContext` secret with format:
```json
{"token":"ghp_YOUR_TOKEN","serverUrl":"https://nuget.pkg.github.com/YOUR_ORG/index.json"}
{"token":"ghp_<your_token>","serverUrl":"https://nuget.pkg.github.com/<your_org>/index.json"}
```
1. **Run CI/CD**: Your apps will automatically be published to GitHub Packages after successful builds

Expand Down
Loading