fix: Configure APIM with VNet integration to access internal services#80
fix: Configure APIM with VNet integration to access internal services#80
Conversation
Change virtual_network_type from "None" to "Internal" (default) and set virtual_network_subnet_id to use APIMSubnet, enabling APIM to access Azure AI Foundry and other backend services deployed inside the VNet via private endpoints. Add configurable virtual_network_type and public_network_access_enabled variables to apim_definition with input validation. Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
|
@copilot can you please review the 5 failing checks and fix the errors in them |
… governance updates Private endpoints are not supported when virtual_network_type is Internal or External (they are unnecessary since APIM is already inside the VNet). Only configure private endpoints when virtual_network_type is None. Also applies AVM governance pre-commit changes (grept migration from .github/copilot-instructions.md to .agents/ directory). Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Clarify that when VNet integration is enabled, APIM directly accesses backend services within the VNet (not via private endpoints). Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Investigated all 5 failing checks: 4 example failures (default, default-byo-vnet, standalone, standalone-byo-vnet): The APIM module validation rejects private endpoints when 1 pr-check failure (grept changes): The AVM governance templates had pending updates (migration from Both fixes are in commits |
…from APIM subnet, add NSG outbound rules, add depends_on for NSG rules Three fixes for APIM Internal VNet deployment failures: 1. Remove firewall route table from APIM subnet when APIM uses VNet integration. Forced-tunneling through the firewall blocks APIM's required outbound access to Azure Storage during deployment. 2. Add NSG outbound rule for Azure Storage (port 443) and inbound rule for Azure Load Balancer health probes (port 6390), required per Azure APIM VNet integration documentation. 3. Add depends_on for NSG rules in the APIM module to prevent race condition where APIM deploys before NSG rules are applied. Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Reviewed the 4 failing checks from run 23124116926: 2 APIM deployment failures (
Also added NSG inbound rule for Azure Load Balancer health probes (port 6390), required for APIM VNet mode. 2 transient Azure failures ( Commit |
The KeyVault 401 Unauthorized errors (AKV10046: Unable to resolve the key used for signature validation) during GetCertificateContacts are caused by Azure RBAC not having propagated before certificate operations begin. The modules already had wait_for_rbac_before_key_operations and wait_for_rbac_before_secret_operations set to 60s, but wait_for_rbac_before_certificate_operations was missing. Added the 60s certificate operations wait to both: - main.genai_services.tf (main KeyVault module) - modules/example_hub_vnet/main.tf (hub KeyVault module) Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
|
@copilot can you please review the failing checks and fix the errors in them |
…bac_before_contact_operations The KeyVault AVM module v0.10.2 does not have a wait_for_rbac_before_certificate_operations variable. The correct argument name is wait_for_rbac_before_contact_operations, which matches the GetCertificateContacts API operation that was failing with 401 errors. Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
All 5 failures were caused by the same issue: Fixed in both |
|
@copilot can you please review the failing checks and fix the errors in them |
…erations The KeyVault AVM module's wait_for_rbac_before_secret_operations only creates a time_sleep when both role_assignments AND secrets are defined within the module. Since secrets are created by external jumpvm/buildvm modules, the internal time_sleep was never created. Fix by adding explicit time_sleep resources that depend on the KeyVault role assignments, ensuring RBAC propagation completes before the VM modules attempt to set secrets in the KeyVault. Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Address code review feedback to ensure time_sleep resets when RBAC changes occur by tracking both keyvault resource_id and principal_id. Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Reviewed the 3 failing jobs from run 23130664582 (commit 2 KeyVault 401 failures ( Fixed by adding explicit 1 idempotency failure ( Commits |
|
@copilot can you please review the failing checks and fix the errors in them |
…potf fixes Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Reviewed the 5 failing checks from run 23134450837: 1 code-related failure (pr-check): Three issues fixed:
4 transient Azure infrastructure failures:
All code-related issues fixed in commit |
|
@copilot can you please review the failing checks and fix the errors in them. Also please look into why the default examples is taking so long to complete, it seems to get stuck at api management creation |
…s conditional on SKU Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
Reviewed the 4 failing jobs from run 23151921897. The pr-check passed ✓. 1 APIM timeout (
3 transient Azure failures:
Commit |
|
@copilot can you please review the failing checks and fix the errors in them. Please revert api management sku back to premium so that the errors related availability zones are addressed |
…ium SKUs Co-authored-by: mbilalamjad <79409563+mbilalamjad@users.noreply.github.com>
All 5 failures had the same root cause: the APIM module validation rejects Fixed in commit
|
virtual_network_type,public_network_access_enabled)private_endpointsconditional (only whenvirtual_network_type == "None")public_network_access_enableddefault totrue(Azure blocksfalseduring creation)depends_onfor NSG rules in APIM modulecontact_operationsnotcertificate_operations)time_sleepfor KeyVault RBAC propagation before VM secret operationsdepends_onforbuildvmmodule on KeyVaulttimeprovider toexample_hub_vnetmodule required_providersnullfor non-Premium SKUs to satisfy module validation)Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.