1.Register a new application:-
- Under Manage, select App registrations.
- Click on New registration.
- Enter a name for your application (e.g., Terraform).
- For Redirect URI, leave it as is (you don't need to set this for Terraform).
- Click Register.
- Create a Client Secret
- Generate a client secret:
- In the application registration page, go to Certificates & secrets.
- Under Client secrets, click New client secret.
- Add a description and set an expiry period.
- Click Add.
- Copy the Value of the client secret and store it securely. This will be used as the client_secret.
- Assign a Role to the Application
Navigate to your subscription:
In the Azure portal, go to Subscriptions. Select the subscription you want to use with Terraform. Assign a role to the application:
- Click on Access control (IAM).
- Click Add role assignment.
- Select a role (e.g., Contributor).
- Under Assign access to, select User, group, or service principal.
- Search for the name of your registered application.
- Select the application and click Save.
- Note the Subscription ID:
In the subscription overview, note down the Subscription ID. This will be used as the subscription_id.
Once you have gathered all the necessary values, you can configure your provider "azurerm" block in your Terraform configuration file:
- It is a type of data which you want to use it on tfvars file
- this is achived by defining varibles
- you could either define empty or strongly typed
- Define the structure
- Initialze the data structure
- figure out how to achive tha data structure
Key Differences Between list and set
List: Ordered collection of elements. The order in which elements are specified is preserved. Set: Unordered collection of unique elements. The order is not preserved and elements must be unique.
List: Can contain duplicate elements. Set: Cannot contain duplicate elements; all elements must be unique.
List: Supports indexing to access elements by their position (e.g., list[0]). Set: Does not support indexing because there is no guaranteed order.