Generating Watson Machine Learning credentials for a legacy service instance

Starting with the V2 machine learning service, introduced on September 1, 2020, you no longer need service credentials to authenticate with the apps and services that use the IBM Watson Machine Learning service.

For details on associating and using a V2 service instance, see Watson Machine Learning Service instance.

For details on using IBM Cloud credentials for authentication, see Authentication.

Accessing assets using a V1 machine learning service instance

If you are a Lite user, your machine learning instance is automatically converted to a v2 machine learning instance. You can use existing credentials for a legacy V1 Watson Machine Learning service instance, but you will be unable to generate credentials for the v1 service instance.

If you are a Standard/Professional plan user and you want to continue to use your v1 service instance, you can generate credentials using the IBM Cloud CLI.

Sample: generating legacy credentials using the IBM Cloud CLI

Use these IBM Cloud CLI commands to generate credentials for a V1 Watson Machine Learning service instance if you are a Standard or Professional plan user.

  1. Enter the following to list instances in your account to get the details on your V1 Watson Machine Learning service instance:

    $ ibmcloud resource  service-instances 
    

    returns:

    Retrieving instances with type service_instance in all resource groups in all locations under account User1's Account as user1@example.com...
    OK
    Name                                Location   State    Type   
    cloud-object-storage-eo             global     active   service_instance   
    Watson OpenScale-04                 us-south   active   service_instance   
    Machine Learning-AutoAI             us-south   active   service_instance   
    Machine Learning-AutoAI-Standard    us-south   active   service_instance   
    TES-WML-standard                    us-south   active   service_instance   
    IBM Log Analysis with LogDNA-test   us-south   active   service_instance   
    Lite-eu-gb-WML                      eu-gb      active   service_instance   
    to_ove                              us-south   active   service_instance   
    Cloudant-5x                         us-south   active   service_instance   
    pm-20-rh                            eu-de      active   service_instance   
    Machine Learning-ha                 jp-tok     active   service_instance 
    
  2. Get existing credentials:

    $ ibmcloud resource  service-keys --instance-name TES-WML-standard --output json 
    

    returns:

    [
        {
            "guid": "5555cf-636a-4234-b537-0ec2bd36aafc",
            "id": "crn:v1:bluemix:public:pm-20:us-south:a/c1fb2a86e45a7abeca169dbc09d39:cfe4d88d-18b1-44d1-9c2d-ea3e1c090:resource-key:645196cf-636a-4-b537-0ec2bd36aafc",
            "url": "/v2/resource_keys/6cf-636a-4234-b537-0ec2bd36aafc",
            "created_at": "2020-06-12T08:39:37.848115318Z",
            "updated_at": "2020-06-12T08:39:37.848115318Z",
            "deleted_at": null,
            "name": "Service credentials-1",
            "account_id": "c1f673b2a7abeca169dbc09d39",
            "resource_group_id": "65f273127",
            "source_crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1feca169dbc09d39:cfe4d88d-18b1-44d1-9c2d-ea39c090::",
            "state": "active",
            "credentials": {
                "apikey": "XXXXXXXXXXXXXXXXXXXXXX",
                "iam_apikey_description": "Auto-generated for key 646cf-636a-4234-b537-0ec2d36aafc",
                "iam_apikey_name": "Service credentials-1",
                "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
                "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/c1f5a7abeca169dbc09d39::serviceid:ServiceId-daecbc20-f69f-4b3c-b5e2-638a13",
                "instance_id": "cfd-18b1-44d1-9c2d-ea39f9e1c090",
                "url": "https://us-south.ml.cloud.ibm.com"
            },
            "iam_compatible": true,
            "resource_instance_url": "/v2/resource_instances/c8d-18b1-44d1-9c2d-ea39f9e1c090",
            "crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a86e45a7abeca9d39:cfe4d88d-18b1-44d1-9c2d-e9e1c090:resource-key:645194234-b537-0ec2bd36aafc"
        }
    ]
    
  3. Create new credentials:

    $ bx resource  service-key-create NEW-TEST-KEY Writer --instance-name TES-WML-standard 
    

    returns:

    Creating service key of service instance TES-WML-standard under account User1's Account as User1@example.com...
    OK
    Service key crn:v1:bluemix:public:pm-20:us-south:a/c1fc09d39:cfe-44d1-9c2d-ea39f9e1c090:resource-key:8a334a5d-b7ad-43017cbc4095 was created.
    Name:          NEW-TEST-KEY   
    ID:            crn:v1:bluemix:public:pm-20:us-south:a/c1a86e45bc09d39:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090:resource-key:8a335d-b7ad-43017cbc4095   
    Created At:    Tue Sep  8 15:08:31 UTC 2020   
    State:         active   
    Credentials:                                   
                   apikey:                   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxX2      
                   iam_apikey_description:   Auto-generated for key 8a33d418-11e9-4a5d-b7ad-43017cbc4095      
                   iam_apikey_name:          NEW-TEST-KEY      
                   iam_role_crn:             crn:v1:bluemix:public:iam::::serviceRole:Writer      
                   iam_serviceid_crn:        crn:v1:bluemix:public:iam-identity::a/c1f673b2a7abeca169dbc09d39::serviceid:ServiceId-9b1c361e-0938-48ea-99a7-ce6eaba53558      
                   instance_id:              cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090      
                   url:                      https://us-south.ml.cloud.ibm.com  
    
  4. Get list of credentials one more time to make sure it was updated:

    $ ibmcloud resource  service-keys --instance-name TES-WML-standard --output json 
    

    returns:

    [
        {
            "guid": "645196cf-636a-4234-b537-0ec2bd36aafc",
            "id": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a7abeca169dbc09d39:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090:resource-key:645196cf-636a-4234-b537-0ec2bd36aafc",
            "url": "/v2/resource_keys/645196cf-636a-4234-b537-0ec2bd36aafc",
            "created_at": "2020-06-12T08:39:37.848115318Z",
            "updated_at": "2020-06-12T08:39:37.848115318Z",
            "deleted_at": null,
            "name": "Service credentials-1",
            "account_id": "c1f673b2a7abeca169dbc09d39",
            "resource_group_id": "6329d4ad7b31477da6dcb0925f273127",
            "source_crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a7abeca169dbc09d39:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090::",
            "state": "active",
            "credentials": {
                "apikey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1",
                "iam_apikey_description": "Auto-generated for key 645196cf-636a-4234-b537-0ec2bd36aafc",
                "iam_apikey_name": "Service credentials-1",
                "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
                "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/c1f673b2a7abeca169dbc09d39::serviceid:ServiceId-daecbc20-f69f-4b3c-b5e2-631b1a948a13",
                "instance_id": "cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090",
                "url": "https://us-south.ml.cloud.ibm.com"
            },
            "iam_compatible": true,
            "resource_instance_url": "/v2/resource_instances/cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090",
            "crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a8ca169dbc09d39:cfe4d88d-18b1-4ea39f9e1c090:resource-key:645196cf-37-0ec2bd36aafc"
        },
        {
            "guid": "8a318-11e9-4a5d-b7ad-430095",
            "id": "crn:v1:bluemix:public:pm-20:us-south:a/c1fe45a7c09d39:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090:resource-key:8a-4a5d-b7ad-43017cbc4095",
            "url": "/v2/resource_keys/8a33d418-11e9-4a5d-b7ad-43017cbc4095",
            "created_at": "2020-09-08T15:08:31.30178073Z",
            "updated_at": "2020-09-08T15:08:31.30178073Z",
            "deleted_at": null,
            "name": "NEW-TEST-KEY",
            "account_id": "c1f673b2a7abeca169dbc09d39",
            "resource_group_id": "6329d4ad7b31477da6dcb0925f273127",
            "source_crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a7abeca169dbc09d39:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090::",
            "state": "active",
            "credentials": {
                "apikey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2",
                "iam_apikey_description": "Auto-generated for key 8a3-11e9-4a5d-b7ad-44095",
                "iam_apikey_name": "NEW-TEST-KEY",
                "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
                "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/c1f673b29dbc09d39::serviceid:ServiceId-9b1c361e-0938-48ea-99a7-ce58",
                "instance_id": "cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090",
                "url": "https://us-south.ml.cloud.ibm.com"
            },
            "iam_compatible": true,
            "resource_instance_url": "/v2/resource_instances/cfe4d88d-1-ea39f9e1c090",
            "crn": "crn:v1:bluemix:public:pm-20:us-south:a/c1f673b2a86e439:cfe4d88d-18b1-44d1-9c2d-ea39f9e1c090:resource-key:8a9-4a5d-b7ad-43017cbc4095"
        }
    ]
    

You can use these credentials to authenticate with your V1 service instance.