Arcus Web API Documentation

website·Indexed 32 days ago

https://webapi.arcus-azure.net/

Documentation for Arcus Web API libraries, including Arcus.WebApi.Security for JWT, certificate, and shared access key authentication; Arcus.WebApi.Logging for request tracking and Azure Functions logging; and Arcus.WebApi.Hosting for JSON formatting. Covers versions v1.5.0 through v2.0.0, featuring integrations with Azure Key Vault and Azure Functions.

Tokens
76.1K
Snippets
393
Records
419
Agent score
45%

What's inside Arcus

  1. Overview of Arcus Web API library

    v1.7.0
    The Arcus Web API library (v1.7.0) simplifies the registration and configuration of common API functionality. It provides built-in support for shared access key authentication, HTTP correlation, request tracking, and strict JSON formatting. The library leverages Arcus Observability for its correlation and tracking capabilities.
  2. Overview of W3C HTTP Request Correlation

    The Arcus.WebApi.Logging library implements W3C Trace-Context correlation using the traceparent HTTP header. It tracks three types of IDs to maintain relationships across services:

    • Transaction ID: A constant ID used to describe the entire end-to-end transaction. All telemetry is tracked under this ID.
    • Operation ID: Describes a single operation within a specific service to link internal telemetry.
    • Operation Parent ID: Creates the parent/child link between services (e.g., when Service A calls Service B, Service A is the parent).

    When using W3C HTTP correlation, remote dependencies managed by Microsoft (such as HTTP, ServiceBus, and EventHubs) are tracked automatically without additional configuration.

  3. Overview of Arcus Web API library

    v1.6.0
    The Arcus Web API library (v1.6.0) simplifies the registration and configuration of complex application functionality. It provides built-in support for shared access key authentication, HTTP correlation, request tracking, and strict JSON formatting. It leverages Arcus Observability for its correlation and tracking capabilities.
  4. Overview of Arcus Web API library capabilities

    The Arcus Web API library (v2.0.0) simplifies the registration and configuration of common API boilerplate functionality. Key features include shared access key authentication, HTTP correlation, request tracking, and strict JSON formatting. It integrates with Arcus Observability to handle HTTP correlation and request tracking.
  5. Overview of HTTP Request Correlation

    v1.6.0

    The Arcus.WebApi.Correlation library implements distributed tracing by managing three types of correlation IDs to link telemetry across services:

    • Transaction ID: A constant ID that describes the entire end-to-end transaction. All telemetry for the full flow is tracked under this ID.
    • Operation ID: Describes a single operation within a specific service to link internal telemetry.
    • Operation Parent ID: Creates the parent/child relationship between services (e.g., when Service A calls Service B, Service A is the parent).

    By default, this is implemented using the RequestId and X-Transaction-ID HTTP headers. If a request already contains an X-Transaction-ID, that value is preserved and returned in the response.

  6. Arcus.WebApi Feature Overview

    v0.4.0

    Arcus.WebApi v0.4.0 provides the following core capabilities:

    • Security: Supports Shared Access Key and Certificate authentication.
    • Correlation: Ability to provide request and transaction correlation IDs.
    • Telemetry: Enrichment of telemetry information.
    • Logging: Handling and logging of unhandled exceptions.
    • OpenAPI: Integration with Swashbuckle to expose security definitions in documentation.
  7. Understand Hierarchical HTTP Correlation concepts

    v1.7.0

    Hierarchical HTTP correlation in Arcus.WebApi.Logging uses three types of IDs to link telemetry across services:

    • Transaction ID: A constant ID for the entire end-to-end transaction. All telemetry is tracked under this ID.
    • Operation ID: Describes a single operation within a specific service to link local telemetry.
    • Operation Parent ID: Creates the parent/child link between services (e.g., Service A is the parent of Service B).

    By default, this is implemented using the RequestId and X-Transaction-ID HTTP headers. If a request already contains an X-Transaction-ID, that value is preserved in the response.

  8. Arcus.WebApi Feature Overview

    v1.0.0

    Arcus.WebApi provides a suite of features for Azure-based web APIs, including:

    • Security: Support for Shared Access Key and Certificate authentication.
    • Correlation: Ability to provide request and transaction correlation IDs.
    • Telemetry: Enrichment of telemetry information.
    • Logging: Handling and logging of unhandled exceptions.
    • OpenAPI: Integration with Swashbuckle to expose security definitions in documentation.
  9. Arcus.WebApi v0.2.0 Feature Overview

    v0.2.0

    Arcus.WebApi v0.2.0 provides the following core capabilities:

    • Security: Supports Shared access key authentication and Certificate authentication.
    • Logging: Provides functionality for logging unhandled exceptions.
    • OpenAPI: Supports exposing security information within Swashbuckle documentation.
  10. Configure OAuth security definitions and operation filters in Swagger

    v0.4.0

    To indicate that an API is protected by OAuth and ensure that operations requiring authentication automatically inform consumers about potential 401 Unauthorized or 403 Forbidden responses, use the OAuthAuthorizeOperationFilter.

    Configure this within AddSwaggerGen by defining an OAuth2Scheme security definition and adding the OAuthAuthorizeOperationFilter as an operation filter, passing the required scopes as an argument.

    using Arcus.WebApi.OpenApi.Extensions;
    using Microsoft.Extensions.DependencyInjection;
    using Swashbuckle.AspNetCore.Swagger;
    
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSwaggerGen(setupAction =>
            {
                setupAction.SwaggerDoc("v1", new Info { Title = "My API v1", Version = "v1" });
                
                // Define the OAuth2 security scheme
                setupAction.AddSecurityDefinition("oauth2", new OAuth2Scheme
                {
                   Flow = "implicit",
                   AuthorizationUrl = $"{authorityUrl}connect/authorize",
                   Scopes = scopes
                });
                
                // Add the filter to automatically mark operations as secured and define required scopes
                setupAction.OperationFilter<OAuthAuthorizeOperationFilter>(new object[] {new [] {"myApiScope1", "myApiScope2"});
            });
        }
    }
  11. Implement W3C HTTP request correlation with Arcus.WebApi.Logging

    v1.7.0

    The Arcus.WebApi.Logging library implements W3C Trace-Context correlation using the traceparent HTTP header. It tracks three types of IDs:

    • Transaction ID: Constant across the entire transaction from start to end.
    • Operation ID: Unique to a single operation within a specific service.
    • Operation Parent ID: Creates the parent/child link when one service calls another.

    When using W3C HTTP correlation, remote dependencies managed by Microsoft (such as HTTP, ServiceBus, and EventHubs) are tracked automatically without additional configuration.

  12. Implement Hierarchical HTTP Correlation in Arcus.WebApi.Logging

    Hierarchical HTTP correlation allows tracking a transaction across multiple services using three types of IDs:

    • Transaction ID: Constant across the entire transaction; all telemetry is tracked under this ID.
    • Operation ID: Describes a single operation within a service to link local telemetry.
    • Operation Parent ID: Creates the parent/child link between services (e.g., Service A is the parent of Service B).

    By default, this uses the RequestId and X-Transaction-ID HTTP headers. If a request already contains an X-Transaction-ID, that value is preserved in the response.

    Note: This hierarchical method is deprecated. For newer implementations, use W3C HTTP correlation.