Manage Microsoft Foundry Routines via azd
mainazure.ai.routines extension for azd allows you to manage Microsoft Foundry Routines directly from your terminal. This is currently in Preview.repository·main·Indexed 19 days ago
https://github.com/azure/azure-devA developer-centric CLI designed to streamline building, deploying, and operating Azure applications. Includes extensions for managing Microsoft Foundry Projects, AI agents, connections, and the Azure AI Inspector for local agent debugging.
azure.ai.routines extension for azd allows you to manage Microsoft Foundry Routines directly from your terminal. This is currently in Preview.azd Training Extension is an extension for the Azure Developer CLI (azd) designed to manage and execute Microsoft Foundry training jobs. It allows developers to integrate training job workflows directly into their azd environment.azd AI Builder extension is a guided, scenario-driven assistant for the Azure Developer CLI (azd). It helps you discover and provision the appropriate Azure resources required for specific AI use cases, such as Retrieval-Augmented Generation (RAG) systems, intelligent agents, or custom AI workflows. The extension uses LLM-aware prompts and best-practice architectures to guide you from Proof of Concept (POC) to production.The azure.ai.skills extension allows you to manage Microsoft Foundry skills (reusable behavioral guidelines for agents) from your terminal. Skills are versioned and immutable.
When you create a skill, it uploads the first default version. When you update a skill, it uploads a new immutable version and promotes it to the default_version. You can revert to or access older versions using --set-default-version <version> or by downloading a specific version with azd ai skill download --version <ver>.
# Example: Creating a skill from a directory
azd ai skill create my-skill --file ./skill-src/
# Example: Updating a skill with inline instructions
azd ai skill update my-skill --instructions "New instructions here"azure.ai.connections extension for the Azure Developer CLI (azd) allows you to manage Microsoft Foundry Connections directly from your terminal. This feature is currently in Preview.A CommandJob is the fundamental job type in the Azure AI ML SDK. It executes a single command on a specified compute target with defined inputs, outputs, and environment configuration.
A CommandJob is composed of four functional layers:
When a parent command (like root) defines persistent flags, store them in a global variable within that package. Child commands can then reference this global variable directly to access the flag values.
// In root.go
var rootFlags struct {
Debug bool
NoPrompt bool
}
func NewRootCommand() *cobra.Command {
cmd := &cobra.Command{...}
cmd.PersistentFlags().BoolVar(&rootFlags.NoPrompt, "no-prompt", false, "...")
return cmd
}
// In child commands
func runInit(ctx context.Context, flags *initFlags) error {
if rootFlags.NoPrompt {
// Use no-prompt mode
}
return nil
}Local provision validation is a client-side check that executes during azd provision after Bicep compilation but before the template is sent to Azure.
The Workflow:
ValidatePreflight API.The infra.provider field is emitted with different data types depending on the command being executed. When writing queries, you must account for both scalar strings and string arrays.
provision / up / down: Emits a string array (string[]) containing the sorted, de-duplicated set of IaC providers (e.g., ["bicep", "terraform"]).infra generate / infra synth: Emits a single string (string) representing the value from azure.yaml's infra.provider (defaults to "auto"). Non-built-in providers are bucketed as "custom".Important Nuances:
"custom" before de-duplication. A project using two different extension providers will appear as ["custom"].cmd.provision) and is not inherited by child commands like cmd.deploy or cmd.package.When viewing pull request jobs, you may see suffixes like b1 or ib1. These are automatically added by the matrix creation logic to handle batching:
bX (e.g., b1, b2): Indicates a batch of direct packages. Packages are grouped by their matrix configuration (from their ci.yml) and then split into batches based on a configurable batchSize (defaulting to 10).ibX (e.g., ib1): Indicates a batch of indirect packages. These are also batched, but instead of using the full test matrix, the system deterministically selects a single item from the resolved test matrix to assign the batch to.When implementing Go logic in azd:
fmt.Errorf with the %w verb to provide actionable context and maintain trace IDs.context.Context through function calls to ensure proper cancellation and telemetry support.func (s *Service) Run(ctx context.Context) error {
if err := s.doWork(ctx); err != nil {
return fmt.Errorf("failed to provision resources: %w", err)
}
return nil
}When you select the Cancel the Azure deployment option, the final state of your resources depends on how quickly Azure processes the request. The following outcomes are possible:
| Outcome | Description |
|---|---|
| Cancellation confirmed | Azure transitions the deployment to Canceled within the 5-minute budget. azd exits with a non-zero status. |
| Cancel raced succeeded | Azure reached Succeeded before the cancel request took effect. Your resources are deployed; azd will report this with a success-toned message. |
| Cancel raced failed | Azure reached Failed before the cancel request took effect. azd reports the failure and provides the portal URL. |
| Cancel raced deleted | The deployment record was deleted (e.g., by an external actor) before the cancel could take effect. |
| Cancel still pending | Azure did not reach a terminal state within the 5-minute budget. azd warns you that cancellation may still complete and provides the portal URL. |
| Cancel request failed | The ARM Cancel API returned an error. The deployment is likely still running; use the provided portal URL to check status. |