Git Product home page Git Product logo

azure-app-creation's Introduction

Azure Application Setup Script

This script helps you create an application in Azure, set up a service principal, and assign a custom role with the required permissions.

Prerequisites

  • Azure CLI installed and configured on your machine.
  • Access to an Azure subscription.

Usage

  1. Clone the repository:

    git clone https://github.com/Hrouhani/your-repository-name.git
    cd your-repository-name
    
    
  2. Run the script:

    python3 azure-app.py
    
    
  3. Follow the prompts to input your Azure subscription ID, role name, and application name.

What the Script Does

  1. Sets the Azure subscription: The script starts by setting the specified Azure subscription using the Azure CLI command az account set --subscription.

  2. Logs in to Azure: It prompts the user to log in to Azure, which opens a browser window for authentication using the Azure CLI command az login.

  3. Creates an application, service principal, and certificate: The script creates an Azure AD application, a service principal, and a certificate using the command az ad sp create-for-rbac --name.

  4. Copies the certificate file to the script's directory: The certificate file created is copied to the directory where the script is running.

  5. Creates a custom role (mondoo-role.json): It generates a JSON file defining a custom role with specific permissions required for the application.

  6. Assigns the custom role to the application: The custom role is assigned to the newly created application using the command az role assignment create.

  7. Creates an application manifest (app-manifest.json): The script creates a JSON file defining the required resource accesses for the application.

  8. Updates the application with the required resource accesses: It updates the application to include the necessary permissions defined in the manifest using the command az ad app update.

  9. Grants administrator consent: Finally, the script grants administrator consent to the application for the required permissions using the command az ad app permission admin-consent.

azure-app-creation's People

Contributors

hrouhani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.