Dude, This is amazing...! I'm currently deploying a new app for my job and this video was so refreshing..!
@SomeoneElsesCloud
3 жыл бұрын
Awesome! Hope it helps mate ✌️😊
@sumeetgupta3011
Жыл бұрын
Dude you just nailed it🤑
@SomeoneElsesCloud
Жыл бұрын
Thanks mate ✌️
@marsamuk
Жыл бұрын
Hi. What’ll happen if you enable trigger to the main branch and make a code change and commit. Will it re-create the same resources? From what I understand it won’t because the current resources will exist in tfstate. Trying to understand how this will work in a prod environment when code changes should deploy new infra. Thanks
@SomeoneElsesCloud
Жыл бұрын
If you have created the resources via code in the main branch, then they will be written to the state file. So if you are making inline changes, i.e changing the vm sku size, then the plan should tell you what is it changing, most like a non destructive change with a vm sku size I think. The state file becomes the source of truth. So in this case with PR reviews, you could include plans in the description, that way the reviewer can see if there are destructive changes before approving! I definately would recommend stage gates before just blindly merging code especially to production but in short if you are pushing the same code unchanged and it has already been deployed, then theorectically, no it should tell you there are no changes. Hope that helps!
@FalcoPunch182
2 жыл бұрын
Hi, I recently did an internal article at my workplace with the exact same topic and approach. I also advocated for the CHarles Zipp extension. One question here: how is the agent or pipeline allowed to write the state to the storage account? I solved this by adding "commandOptions: '-backend-config=access_key=$(storageaccountsecretkey)'" to the terraform init command. And the storageaccountsecretkey is in a variable group, that is linked to an Azure Key Vault. How does your solution not need the primary key for the storage account?
@SomeoneElsesCloud
2 жыл бұрын
Hey Seb, so when I create the demos, obviously I do the simplest form especially in a getting started type of video. This "could" be an open ended question! lol I believe its able to run due to the following reasons?? - Backend configuration is using the standard service principal auth method - The service principal has contributor access to the storage account So it comes down to how its setup in your environment? The storage account key is generally required if you are not using a service principal to auth the AzureRM provider "I believe". Obviously I am used again the easiest, which is just a secret for auth. I am using example 1 and you are using example 4: www.terraform.io/docs/language/settings/backends/azurerm.html Just had a light bulb moment... You might need to create an empty backend block and that could be your problem, see my code: github.com/someoneelsescloud/ep12_terraform_azure_pipelines/blob/master/backend.tf Hopefully its one of these! lol Sunny
@srujanmettu
2 жыл бұрын
HI Sunny , 1. After created something i ran the same pipeline again but it failed and says the resourse already created instead of showing nothing to deploy. 2. How can we destroy the configuration we created above ? adding the extra stage in yaml file with destroy? Can you explain Thanks in advance!
@SomeoneElsesCloud
2 жыл бұрын
If it says it already exists, something went wrong with your first run, either it errored during creation and didn't write it to state or maybe even your back end config didn't setup up properly. Hard to just guess. You can replace the words Apply in the last task with Destroy. But if its related to the above, you might have problems if the resources aren't in your state file as Terraform would not know about them.
@srujanmettu
2 жыл бұрын
@@SomeoneElsesCloud Thanks for the reply and clarificatoin. I am able to resolve it :)
@SomeoneElsesCloud
2 жыл бұрын
@@srujanmettu out of curiosity, what was your problem??
@srujanmettu
2 жыл бұрын
@@SomeoneElsesCloud I did a mistake within the yaml file and Depends on i kept wrong. Just a request how can we do the same actions the we perform in release pipelines in yaml file? for example approvers ? Thanks in advance
@Motivatedpeoplezz
2 жыл бұрын
Hey Sonny, how could i reach out to you? Need some help with something. Thanks
@SomeoneElsesCloud
2 жыл бұрын
Hey mate, send me an email. Link is on the about page! ✌️
@Motivatedpeoplezz
2 жыл бұрын
@@SomeoneElsesCloud sent mate.
@vinayhegde9888
2 жыл бұрын
You are Legend Boss!!!!! Thanks a Lot🤗 got stuck with this error: ##[error]Error: Unable to locate executable file: 'az'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable. how to add azcli extension in new VM? note: able to execute in self hosted with azcli installed. Plz help.
@SomeoneElsesCloud
2 жыл бұрын
Hey Vinay, sorry what do you mean? Are you trying to run Azure CLI commands in your pipeline on Microsoft hosted agents? If so are you using the Azure CLI task? docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-cli?view=azure-devops
@vinayhegde9888
2 жыл бұрын
@@SomeoneElsesCloud one more step added to install azcli then it is working fine.
Пікірлер: 23