Azure-Samples / Azure-Samples/hve-workshop-railpen

Build the walking skeleton: upload a file to a container

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## What

Build the walking skeleton of the uploader: one command that takes a file path, uploads it to a container, and reports what happened.

This is the first slice of #1. It deliberately does not answer what happens when the blob already exists, because that decision is still open on the parent.

## Why this slice first

It proves the whole path end to end, from argument parsing through configuration binding to a real write against the emulator. Every later slice is a policy change on top of a path that already works.

## How

- Create the solution, the library project, the CLI project, and the test project against `net8.0`
- Define `IBlobUploader` with `ExistsAsync` and `UploadAsync`, and implement it over `BlobContainerClient`
- Add `UploadService` with an `UploadAsync` that opens the file, writes it, and returns an `UploadResult`
- Bind `UploaderOptions` from `appsettings.json` with `UseDevelopmentStorage=true`
- Parse `` and optional `--container` in `Program.cs`
- Return exit code 0 on success and 2 on failure, leaving 1 reserved
- Create the container if it does not exist, so a first run on a clean emulator works
- Keep the connection string out of every message and log line

Assume the container is empty. Existing blob handling is out of scope for this slice.

## Out of scope

Existing blob handling, retry and backoff, chunked upload, SAS generation, server side encryption, container lifecycle policies, real Azure authentication.

## Testing

- [ ] Policy test against the `IBlobUploader` fake: an upload into an empty container succeeds and reports the byte count
- [ ] Policy test: a missing source file fails with an actionable message, not a stack trace
- [ ] Policy test: no captured output contains the connection string
- [ ] The opt-in Azurite integration test uploads and then reads the blob back
- [ ] `dotnet test --filter "Category!=Integration"` passes with no emulator running

## Done when

Someone who has just cloned the repository can start Azurite, run one command, and see the file land in the container.

## Estimate

S, 3 hours (set at 09:50).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the solution structure, Program.cs argument handling, and appsettings.json configuration, then trace UploadService through IBlobUploader and BlobContainerClient. Add the policy tests and opt-in Azurite integration test described in the issue, and verify with dotnet test --filter "Category!=Integration" plus a real upload and readback.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cli, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.