- Deploy the updated hosted agent code.
- Invoke the agent and verify that it returns a response.
This quickstart focuses on GitHub Actions. The pipeline template includes comments for values that vary by project, such as the hosted agent code root folder, Foundry project endpoint, model deployment, and test prompt. Update those values to match your repository and environment layout.
Set up a GitHub pipeline for hosted agents
You can use GitHub Actions with Azure Developer CLI (azd) to deploy and validate hosted agent changes. The workflow uses GitHub OpenID Connect (OIDC) to sign in to Azure, configures the azd environment, deploys the agent, shows the hosted agent status, and sends a smoke-test message.
Prerequisites
Set up pipeline with GitHub
-
Create a
.github/workflows/hosted-agent-cd.ymlfile in your repository with the following content: -
In GitHub, go to Settings > Secrets and variables > Actions and add the following repository variables:
AZURE_CLIENT_IDAZURE_TENANT_IDAZURE_SUBSCRIPTION_IDAZURE_LOCATIONFOUNDRY_PROJECT_ENDPOINTAZURE_AI_PROJECT_IDFOUNDRY_MODEL_NAME
AZURE_CLIENT_ID, which comes from your OIDC application registration, you can find these values in your project.azure/<project-name>/.envfile. You can also get the project endpoint, project ID, and model deployment name from the corresponding agent details page in the Foundry portal. - Add any additional variables or secrets required by your hosted agent project.
-
Update the workflow placeholders.
In
hosted-agent-cd.yml, update the following values:AGENT_PROJECT_DIR: The repository-relative path to the root folder for your hosted agent code.AZD_ENV_NAME: The stagingazdenvironment name for deployment.AGENT_TEST_PROMPT: A smoke-test prompt that should produce a reliable response from your agent.- Optional
azd env setlines: Any additional environment values required by your agent.
-
Run the pipeline.
Push code to the
mainbranch or run the workflow manually from the GitHub Actions page.