Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions cli/azd/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ func registerCommonDependencies(container *ioc.NestedContainer) {
container.MustRegisterScoped(grpcserver.NewDeploymentService)
container.MustRegisterScoped(grpcserver.NewEventService)
container.MustRegisterSingleton(grpcserver.NewUserConfigService)
container.MustRegisterSingleton(grpcserver.NewComposeService)
container.MustRegisterSingleton(grpcserver.NewWorkflowService)

// Required for nested actions called from composite actions like 'up'
registerAction[*cmd.ProvisionAction](container, "azd-provision-action")
Expand Down
91 changes: 83 additions & 8 deletions cli/azd/docs/extension-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ Table of Contents
- [Managing Extensions](#managing-extensions)
- [Developing Extensions](#developing-extensions)
- [Developer Artifacts](#developer-artifacts)
- [gRPC Services](#grpc-services)
- [Project Service](#project-service)
- [Environment Service](#environment-service)
- [User Config Service](#user-config-service)
- [Deployment Service](#deployment-service)
- [Prompt Service](#prompt-service)
- [Event Service](#event-service)
- [Compose Service](#compose-service)
- [Workflow Service](#workflow-service)

## Capabilities

Expand Down Expand Up @@ -326,6 +335,8 @@ The following are a list of available gRPC services for extension developer to i
- [Deployment Service](#deployment-service)
- [Prompt Service](#prompt-service)
- [Event Service](#event-service)
- [Compose Service](#compose-service)
- [Workflow Service](#workflow-service)

### Project Service

Expand All @@ -345,9 +356,13 @@ Gets the current project configuration.
- `services`: map of *ServiceConfig*
- `infra`: *InfraOptions*

*See [project.proto](../grpc/proto/project.proto).*
#### AddService
Adds a new service to the project.

------------------------------------------
- **Request:** *AddServiceRequest*
- Contains:
- `service`: *ServiceConfig*
- **Response:** *EmptyResponse*

### Environment Service

Expand Down Expand Up @@ -467,8 +482,6 @@ Removes a config value at a given path.
- `path` (string)
- **Response:** *EmptyResponse*

------------------------------------------

### User Config Service

This service manages user-specific configuration retrieval and updates.
Expand Down Expand Up @@ -527,8 +540,6 @@ Removes a user configuration value.
- Contains:
- `status` (string)

------------------------------------------

### Deployment Service

This service provides operations for deployment retrieval and context management.
Expand Down Expand Up @@ -565,8 +576,6 @@ Retrieves the current deployment context.
- `resourceGroup` (string)
- `resources` (repeated string)

------------------------------------------

### Prompt Service

This service manages user prompt interactions for subscriptions, locations, resources, and confirmations.
Expand Down Expand Up @@ -738,3 +747,69 @@ Clients can subscribe to events and receive notifications via a bidirectional st
- `service_name`: The name of the service.
- `status`: Status such as "running", "completed", or "failed".
- `message`: Optional additional details.

### Compose Service

This service manages composability resources in an AZD project.

#### ListResources

Lists all configured composability resources.

- **Request:** *EmptyRequest*
- **Response:** *ListResourcesResponse*
- Contains a list of **ComposedResource**

#### GetResource

Retrieves the configuration of a specific composability resource.

- **Request:** *GetResourceRequest*
- Contains:
- `name` (string)
- **Response:** *GetResourceResponse*
- Contains:
- `resource`: *ComposedResource*

#### ListResourceTypes

Lists all supported composability resource types.

- **Request:** *EmptyRequest*
- **Response:** *ListResourceTypesResponse*
- Contains a list of **ComposedResourceType**

#### GetResourceType

Retrieves the schema of a specific composability resource type.

- **Request:** *GetResourceTypeRequest*
- Contains:
- `type_name` (string)
- **Response:** *GetResourceTypeResponse*
- Contains:
- `resource_type`: *ComposedResourceType*

#### AddResource

Adds a new composability resource to the project.

- **Request:** *AddResourceRequest*
- Contains:
- `resource`: *ComposedResource*
- **Response:** *AddResourceResponse*
- Contains:
- `resource`: *ComposedResource*

### Workflow Service

This service executes workflows defined within the project.

#### Run

Executes a workflow consisting of sequential steps.

- **Request:** *RunWorkflowRequest*
- Contains:
- `workflow`: *Workflow* (with `name` and `steps`)
- **Response:** *EmptyResponse*
1 change: 1 addition & 0 deletions cli/azd/grpc/proto/compose.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ message ComposedResource {
string name = 1;
string type = 2;
bytes config = 3;
repeated string uses = 4;
}

// ComposedResourceType represents a type of composability resource.
Expand Down
8 changes: 8 additions & 0 deletions cli/azd/grpc/proto/project.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ import "models.proto";
service ProjectService {
// Gets the current project.
rpc Get(EmptyRequest) returns (GetProjectResponse);

// AddService adds a new service to the project.
rpc AddService(AddServiceRequest) returns (EmptyResponse);
}

// GetProjectResponse message definition
message GetProjectResponse {
ProjectConfig project = 1;
}

// AddServiceRequest message definition
message AddServiceRequest {
ServiceConfig service = 1;
}
33 changes: 33 additions & 0 deletions cli/azd/grpc/proto/workflow.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";

package azdext;

option go_package = "github.com/azure/azure-dev/cli/azd/pkg/azdext;azdext";

import "models.proto";

service WorkflowService {
// ListResources retrieves all configured composability resources in the current project.
rpc Run(RunWorkflowRequest) returns (EmptyResponse);
}

// RunWorkflowRequest is a request to run a workflow.
message RunWorkflowRequest {
Workflow workflow = 1;
}

// Workflow is a collection of steps to be executed in order.
message Workflow {
string name = 1;
repeated WorkflowStep steps = 2;
}

// WorkflowStep is a single step in a workflow.
message WorkflowStep {
WorkflowCommand command = 1;
}

// WorkflowCommand is a command to be executed in a workflow step.
message WorkflowCommand {
repeated string args = 1;
}
Loading