Multiple subscriptions causing issues with Service Principal Generation

I have 2 subscriptions in my azure account. One is active (100 Credit) and the other is disabled (l). I’m walking through the steps on the docker docs for “Docker for Azure” and am running into issues trying to setup the Service Principal.

When I run the command docker run -ti docker4x/create-sp-azure sp-name rg-name rg-region, I login fine. The console output is as follows:

info: Executing command login
/info: To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code EEFZSNHZH to authenticate.
|info: Added subscription Developer Program Benefit
info: Added subscription 100 Credit
info: Setting subscription “Developer Program Benefit” as default

info: login command OK
The following subscriptions were retrieved from your Azure account

  1. c2e5f08e-8c77-4dac-95f0-e483fcc00bf2:100_Credit
    Please select the subscription option number to use for Docker swarm resources: 1
    Using subscription c2e5f08e-8c77-4dac-95f0-e483fcc00bf2
  • Getting resource group swarm1-rg
  • Creating resource group swarm1-rg
    error: The subscription ‘47dcc78f-8ffd-4ef9-8e42-41dd3c838c64’ is disabled and therefore marked as read only. You cannot perform any write actions on this subscription until it is re-enabled.
    error: Error information has been recorded to /root/.azure/azure.err
    error: group create command failed

Even though I’m explicitly using the non-default subscription…when it’s creating the resource group…it’s still using the default subscription…which is disabled. Why?

This has been resolved with the latest docker4x/create-sp-azure image

1 Like