Authenticating to your Azure account
As with any other service, you have to create an account in Azure to obtain the credentials required to programmatically authenticate and interact with the Azure service via Ansible. You will need to create a construct known as a service principal in your Azure account. A service principal functions similarly to a user but is specifically designed for API-based interactions.
Begin by creating a service principal and assigning it the Contributor role through Azure’s access management system. This role provides the necessary permissions to create and manage resources in your Azure account. To authenticate Ansible with the Azure API using the service principal, you must supply the following four key components:
- Client ID
- Tenant ID
- Subscription ID
- Service principal password
By completing these steps, you’ll establish the foundation for secure and automated interaction with Azure using Ansible...