Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment Failure With Release V1.2 With Fresh Clone Code #886

Open
ravikhunt opened this issue Oct 10, 2024 · 6 comments
Open

Deployment Failure With Release V1.2 With Fresh Clone Code #886

ravikhunt opened this issue Oct 10, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@ravikhunt
Copy link

Summary: Upon deploying the fresh latest clone of release V1.2, the deployment fails with errors indicating that the Storage Account and Key Vault are not found. This is occurring despite it being a fresh deployment with no prior state file, where Terraform should ideally create a new resource group along with all other associated services.

Steps to Reproduce:

  1. Clone the project repository.
  2. Checkout to the latest release V1.2.
  3. Initiate the deployment process.
  4. The deployment ends up with errors related to missing resources (e.g., Storage Account, Key Vault not found).

Expected Behavior: For a fresh deployment, without an existing state file, Terraform should create a new resource group along with all necessary services such as Storage Account and Key Vault, without referencing or expecting existing resources.

Actual Behavior: The deployment fails with errors suggesting that the required resources (Storage Account, Key Vault) are not found, preventing a successful deployment.

Error Message: (Screenshot attached )
Image

@bjakems
Copy link
Contributor

bjakems commented Oct 10, 2024

Hi Ravi,

Please try the deployment again after deleting all of these terraform artifacts. I've seen this issue before, but never have experienced it after all of these TF artifacts from a previous deployment are removed.
Image

@ravikhunt
Copy link
Author

ravikhunt commented Oct 10, 2024 via email

@bjakems
Copy link
Contributor

bjakems commented Oct 10, 2024

Please try to create a new Codespace and attempt the deployment from there. Also, examine the TF plan to see if Terraform is attempting to reuse or create the resources. Since it's a net new environment, the Storage Account and Key Vault should be marked as create in the TF plan.

@bjakems bjakems added the question Further information is requested label Oct 10, 2024
@bjakems bjakems self-assigned this Oct 10, 2024
@ravikhunt
Copy link
Author

ravikhunt commented Oct 14, 2024

HI bjakems

I cloned New codespace and tried to attempt the deployment from there
It is hitting with the same error,
and here is some of the content from the TF plan files

Image

What I feel maybe is from this 5 on main.tf file there is no
depends_on = [
module.kvModule
]

for 3 modules which give an error, functions, and storage

When I have taken a look at the old version V1.1.1 KV module is on
depends_on = [
module.kvModule
] for the

// Function App
module "functions" {
source = "./core/host/functions"
depends_on = [
module.kvModule
]
}

The above is my understanding and findings,
could you please let me know your thoughts on this

@attila-kocsis
Copy link

Hi Ravi,

Please try the deployment again after deleting all of these terraform artifacts. I've seen this issue before, but never have experienced it after all of these TF artifacts from a previous deployment are removed. Image

This solved the issue for me, thanks @bjakems

@bjakems
Copy link
Contributor

bjakems commented Oct 15, 2024

@ravikhunt are you using the latest code in the main branch with no changes? Version 1.2 introduces managed identity instead of using secrets in Key Vault where possible. Additionally, Terraform will automatically build its own dependency chain and depends_on is not required if the module accesses the other resources data in its arguments.
What values have you configured in your local.env file (please do NOT include any Subscription IDs, keys, secrets, etc)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants