jclouds/providers/azurecompute-arm
Andrew Gaul 107741f786 JCLOUDS-1629: Upgrade to Guice 7.0.0
This also changes from javax to jakarta annotations.
2024-02-26 15:27:29 +09:00
..
src JCLOUDS-1629: Upgrade to Guice 7.0.0 2024-02-26 15:27:29 +09:00
README.md Update maven coordinates for promoted Azure ARM 2018-01-08 15:11:22 +01:00
bnd.bnd Onboard bnd-configuration files, one per module 2020-10-26 19:58:41 +09:00
pom.xml Next development version 2.6.0-SNAPSHOT 2022-03-26 18:30:06 +09:00

README.md

Azure Compute ARM Provider

Build status for azurecompute-arm module: Build Status

Setting Up Test Credentials

Create a Service Principal

Install and configure Azure CLI following these steps.

Using the Azure CLI, run the following commands to create a service principal

# Enter your Microsoft account credentials when prompted
az login

# Set current subscription to create a service principal
az account set --subscription <Subscription-id>

# Create an AD application with your information.
az ad app create --display-name <name> --password <password> --homepage <home-page> --identifier-uris <identifier-uris>

# For example: az ad app create --display-name "jcloudsarm" --password abcd --homepage "https://jcloudsarm" --identifier-uris "https://jcloudsarm"

# Output will include a value for `Application Id`, which will be used for the live tests

# Create a Service Principal
az ad sp create --id <Application-id>

# Output will include a value for `Object Id`, to be used in the next step 

Run the following commands to assign roles to the service principal

# Assign roles for this service principal
az role assignment create --role Contributor --assignee <ObjectId>

Look up the the tenant Id

az account show

# output will be a JSON which will include the `Tenant id`

Verify service principal

az login -u <Application-id> -p <password> --service-principal --tenant <Tenant-id>

Run Live Tests

Use the following to run one live test:

mvn -Dtest=<name of the live test> \
    -Dtest.azurecompute-arm.identity="<Application-id>" \
    -Dtest.azurecompute-arm.credential="<password>" \
    -Dtest.azurecompute-arm.endpoint="https://management.azure.com/subscriptions/<Subscription-id>" \
    -Dtest.oauth.endpoint="https://login.microsoftonline.com/<Tenant-id>/oauth2/token"
    integration-test -Plive

Use the following to run all the live tests:


mvn clean verify -Plive \
    -Dtest.azurecompute-arm.identity="<Application-id>"" \
    -Dtest.azurecompute-arm.credential="<password>"" \
    -Dtest.azurecompute-arm.endpoint="https://management.azure.com/subscriptions/<Subscription-id>"" \
    -Dtest.oauth.endpoint=https://login.microsoftonline.com/<Tenant-id>/oauth2/token

How to use it

Azure Compute ARM provider works exactly as any other jclouds provider. Notice that as Azure supports dozens of locations, operations like listImages can be really time-consuming. To limit the scope of such operations there are some additional properties you may want to use:

jclouds.azurecompute.arm.publishers

which is by default Canonical,RedHat

and

jclouds.regions

which is by default null. If you want to target only the north europe region, you can use

jclouds.regions="northeurope"