1. Application Passwords for CI/CD Pipelines in AI Development


    In the context of CI/CD pipelines, application passwords are generally used to provide an automated way for software processes and tools to authenticate securely to other services. A CI/CD pipeline, which stands for Continuous Integration and Continuous Deployment, will often need to have access to various cloud services and resources to run tests, deployments, and other necessary tasks. For AI development, this might include access to data stores, computation resources, or AI training environments.

    In a Pulumi application, we would use the ApplicationPassword types provided by some of the cloud providers in the pulumi ecosystem to create and manage these passwords. For instance, if you are using Azure Active Directory (azuread) to manage application resources, you could make use of the ApplicationPassword resource which allows you to define passwords for an Azure AD application.

    Here is a program in Python that demonstrates how to create an application password for an Azure AD application using Pulumi. This password can then be used by your CI/CD pipeline to authenticate to other Azure services securely:

    import pulumi import pulumi_azuread as azuread # Create an Azure AD application app = azuread.Application('example-app', display_name='example-app') # Create a password for the Azure AD application app_password = azuread.ApplicationPassword('example-app-password', application_object_id=app.object_id, display_name='example-cicd-password', # Passwords are auto-generated by default, no value field is necessary # Optional: Specify end_date if you want the password to be valid for a certain duration end_date='2299-12-31T23:59:59Z' # Using a far future date for longevity ) # Export the password value pulumi.export('password', app_password.value) # Export the Application ID, useful for CI/CD pipeline configurations pulumi.export('application_id', app.application_id)

    This program does the following:

    1. Creates a new Azure AD application named example-app.
    2. Adds a password credential to this application by creating an ApplicationPassword resource.
    3. The password value of this credential is auto-generated and exported as an output which you can use in your CI/CD pipeline configuration.
    4. The application ID is also exported; this is the unique identifier for your application within Azure AD and is often needed alongside the password to authenticate.

    Please note:

    • The application password value is sensitive and should be handled securely. In Pulumi, it's marked as a secret automatically.
    • end_date is set to a distant future date to ensure long-term validity. However, it's best practice to rotate these regularly.
    • You should use a service principal (not shown in this example) to assign a role to the application that has the minimum required permissions for your specific use case.

    Remember to install the Pulumi Azure AD provider package by running pip install pulumi_azuread.

    Before running the Pulumi program, make sure you have the appropriate Azure credentials configured on your system so Pulumi can authenticate with Azure and create resources on your behalf.

    Lastly, since Pulumi manages the state of your infrastructure, changes to the code (like the need to rotate passwords) will result in updates to the actual cloud resources on the next pulumi up execution.