GithubHelp home page GithubHelp logo

isabella232 / hybrid-resourcemanager-python-manage-resources Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/hybrid-resourcemanager-python-manage-resources

0.0 0.0 0.0 13 KB

An example illustrating how to use Python to manipulate resources and resource groups in Hybrid cloud environments. Eg. AzureStack

License: MIT License

Python 100.00%

hybrid-resourcemanager-python-manage-resources's Introduction

page_type languages products description urlFragment
sample
python
azure
This sample explains how to manage your resources and resource groups in Azure Stack using the Azure Python SDK.
Hybrid-ResourceManager-Python-Manage-Resources

Hybrid-ResourceManager-Python-Manage-Resources

This sample explains how to manage your resources and resource groups in Azure Stack using the Azure Python SDK.

On this page

  • Run this sample
  • What is example.py doing?
    • List resource groups
    • Create a resource group
    • Update a resource group
    • Create a key vault in the resource group
    • List resources within the group
    • Export the resource group template
    • Delete a resource group

Run this sample

  1. If you don't already have it, install Python.

  2. We recommend to use a virtual environnement to run this example, but it's not mandatory. You can initialize a virtualenv this way:

    pip install virtualenv
    virtualenv mytestenv
    cd mytestenv
    source bin/activate
    
  3. Clone the repository.

    git clone https://github.com/Azure-Samples/Hybrid-ResourceManager-Python-Manage-Resources.git
    
  4. Install the dependencies using pip.

    cd Hybrid-ResourceManager-Python-Manage-Resources
    pip install -r requirements.txt
    
  5. Create a service principal to work against AzureStack. Make sure your service principal has contributor/owner role on your subscription.

  6. Export these environment variables into your current shell.

    export AZURE_RESOURCE_LOCATION={your resource location}
    export AZURE_TENANT_ID={your tenant id}
    export AZURE_CLIENT_ID={your client id}
    export AZURE_CLIENT_SECRET={your client secret}
    export AZURE_SUBSCRIPTION_ID={your subscription id}
    export ARM_ENDPOINT={your AzureStack Resource Manager Endpoint}
    
  7. Run the sample.

    python example.py
    

hybrid-resourcemanager-python-manage-resources's People

Contributors

microsoftopensource avatar msftgits avatar v-rajagt-zz avatar viananth 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.