Add location and subscription parameters to env new commad#164
Merged
Conversation
karolz-ms
commented
Jul 22, 2022
ellismg
requested changes
Jul 22, 2022
Member
ellismg
left a comment
There was a problem hiding this comment.
Some small changes requested - if there's a compelling reason for us to include priniciaplId right now I won't push back more - but this is an area where I've been feeling we don't have a great design and so if we can elevate the concept less right now, that would be ideal.
Collaborator
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
Windows Standalone Binary
Container |
v1212
pushed a commit
to v1212/azure-dev
that referenced
this pull request
May 12, 2026
…aults - Fix gosec G304 warnings with nolint annotations for safe file reads - Fix gosec G104 by properly handling tmpFile.Close() errors - Fix gofmt formatting in excludeDirs map - Update runtime choices to python_3_12/3_11/3_13 per spec - Change --no-prompt deploy mode default to container (backward compat) - Change --no-prompt runtime default to python_3_12 - Align prompt labels with spec wording - Add container.resources + startupCommand to azure.yaml for code deploy
trangevi
pushed a commit
that referenced
this pull request
May 13, 2026
* feat(agents): add code deploy (ZIP upload) support for hosted agents Implements code-based deployment as a complementary mode to container deploy. Agents with code_configuration in agent.yaml are deployed via multipart ZIP upload instead of Docker/ACR, eliminating permission complexity. * feat(agents): add code deploy mode to 'azd ai agent init --from-code' Add deploy mode prompt (code vs container) to the init flow. When code deploy is selected, prompts for runtime, entry_point, and dependency_resolution, then generates agent.yaml with code_configuration and azure.yaml with language: python (no Docker). * fix(agents): address CI lint errors and align with spec #164 defaults - Fix gosec G304 warnings with nolint annotations for safe file reads - Fix gosec G104 by properly handling tmpFile.Close() errors - Fix gofmt formatting in excludeDirs map - Update runtime choices to python_3_12/3_11/3_13 per spec - Change --no-prompt deploy mode default to container (backward compat) - Change --no-prompt runtime default to python_3_12 - Align prompt labels with spec wording - Add container.resources + startupCommand to azure.yaml for code deploy * fix(agents): address Copilot review feedback on code deploy - Add .azure and .env/.env.* to ZIP exclusion list to prevent uploading secrets - Skip symlinks in WalkDir to avoid including files outside agent directory - Stream ZIP directly to temp file with io.MultiWriter for SHA-256, reducing memory usage - Clean up temp file on all error paths using deferred cleanup - Only fall back to create agent on 404; propagate auth/5xx/network errors - Use context-aware select/time.After in polling loop for responsive cancellation - Add dedicated CodeMissingCodeZipArtifact error code - Fix entry point auto-detection to use srcDir instead of cwd - Replace hardcoded multipart boundary with mime/multipart.Writer - Add unit tests for zipDeployRequest multipart format and headers * fix(agents): apply agent_endpoint/agent_card via PatchAgent for code deploy and set metadata Content-Type - Add PatchAgent call after code deploy create/update to apply agent_endpoint and agent_card fields (matching container deploy behavior) - Use CreatePart with explicit Content-Type: application/json for the metadata multipart part instead of CreateFormField - Update unit test to verify metadata part Content-Type header * fix(agents): resolve CI lint and cspell errors - Add //nolint:gosec to os.ReadFile in init_from_code.go - Handle req.Body.Close() return value in test transport - Suppress Close/Remove errors in deferred cleanup with _ = - Add 'mypy' to cspell.yaml words list * style: use map[string]any instead of map[string]interface{} * feat(agents): add code deploy support to template init flow Add deploy mode prompt (code vs container) to the template init flow, allowing users to choose code deploy when initializing from a template. Skip ACR configuration when code deploy is selected. Auto-derive startup command from entry_point for code deploy instead of prompting. * fix(agents): improve deploy mode prompt and clean agent.yaml on mode switch - Default to Container (Docker) for backward compatibility - Use clearer labels: 'Container (Docker)' / 'Code deploy (ZIP upload)' - Remove code_configuration from agent.yaml when switching to container mode * fix(agents): guard configureAcrConnection with skipACR check When skipACR is true (code deploy mode), skip the configureAcrConnection call entirely to prevent prompting users for ACR configuration. * fix(agents): resolve project path when init runs from subdirectory When running 'azd ai agent init' from a subdirectory with an existing agent.manifest.yaml, the addToProject function received targetDir='.' which wrote 'project: .' into azure.yaml. Since azure.yaml resolves paths relative to the project root, this caused the service to point to the wrong directory. Fix: resolve the actual relative path from project root to cwd when targetDir is '.', so azure.yaml gets the correct project path (e.g. 'src/hello-world-python-invocations' instead of '.'). * fix(agents): address PR #8146 review feedback (13 items) - T1: Hide code deploy for non-Python projects (isPythonProject check) - T2: Add TODO for region validation in code deploy - T3: Reorder runtime list to 3.11, 3.12, 3.13 - T4: Update entry point prompt wording - T6: Add descriptions to bundled/remote_build choices - J1: Consolidate promptCodeConfig into single shared function - J3: Use errors.AsType[*azcore.ResponseError] per Go 1.26 - J4: Extract shared deriveStartupCommand helper - V1: Rename to 'Container Image (Docker)' / 'Source Code (ZIP upload)' - V2: Unify HostedAgentDefinition with custom JSON marshal/unmarshal - V4: Fix error message to reference 'azd package' - V5: Extract prepareDeploy/finalizeDeploy shared helpers - C1+C3: Verify ZIP exclusions (.azure, .env) and temp file cleanup * fix(agents): add TODO for streaming ZIP in zipDeployRequest (C2) * fix: remove unused isContainerAgent method and accidental files * chore: remove accidentally committed files * fix(agents): restrict code deploy to supported regions and fix depRes default Add region validation for code deploy at both init-time (filter project list) and deploy-time (fail early with clear error). Supported regions: westus2, canadacentral, northcentralus. Unify dependency_resolution fallback default to 'remote_build' to match --no-prompt behavior. * fix(agents): deduplicate codeDeployRegions and handle empty AZURE_LOCATION Move CodeDeployRegions to project.config.go as a shared exported var, referenced by both init filtering and deploy validation. Add explicit check for empty AZURE_LOCATION with actionable error message. * fix(agents): improve deploy failure diagnostics and rename resource prompt - Include service error code/message and x-request-id in remote build failure errors - Rename 'container resource allocation' prompt to 'Select resources (CPU and Memory)' --------- Co-authored-by: Jian Wu <wujia@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change supports AZD integration with Visual Studio