Unable to create Watson Discovery Service through Bluemix app - ibm-cloud

While I try to create a bluemix application and then click to create and add a new Discovery service to the same application I get "422 - failed to get credentials service. How do I resolve this ?

Can you check to see that your service has credentials? You can do this by going to your service instance in bluemix and clicking on the "Service Credentials" link. If you don't have any service credentials listed then click on the "New Credential" button and once you have new credentials try clicking on the "Launch tool" button again.
If that doesn't work then I'd click the "x" on that error to dismiss it and then look at the service instances dropdown in the top right. Double check to make sure that the selected service instance in that dropdown is the same service instance that you created in bluemix that has the credentials. If it isn't then make sure to select the correct service instance from the dropdown.

Related

Azure App Service deploy Failed to get resource ID for resource type 'Microsoft.Web/Sites'

In the last 6 months I have been releasing with a pipeline in Azure DevOps, but today I receive the following error:
2019-09-25T14:24:38.4296875Z ##[section]Starting: Azure App Service Deploy: AS-ServiciosNegocio-API-UAT
2019-09-25T14:24:38.4419797Z ==============================================================================
2019-09-25T14:24:38.4419900Z Task : Azure App Service deploy
2019-09-25T14:24:38.4419986Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-09-25T14:24:38.4420053Z Version : 3.4.31
2019-09-25T14:24:38.4420117Z Author : Microsoft Corporation
2019-09-25T14:24:38.4420182Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment
2019-09-25T14:24:38.4420291Z ==============================================================================
2019-09-25T14:24:39.1630446Z Got connection details for Azure App Service:'AS-ServiciosNegocio-API-UAT'
2019-09-25T14:24:39.3091141Z ##[error]Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'AS-ServiciosNegocio-API-UAT'. Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.
2019-09-25T14:24:39.3140156Z ##[section]Finishing: Azure App Service Deploy: AS-ServiciosNegocio-API-UAT
If your existing service connection is the "Azure Resource Manager using service principal (automatic)" type (not manual), there's a simple but non-obvious way to renew the token.
Go to the service connection's settings page in Azure Devops as described in the other answers. (<YourDevAzureProject> Bottom Left → ⚙️ Project Settings → Pipelines subhead → Service Connections)
Click Edit and then Save without making any other changes. Assuming you have the right permissions, it will automatically get a new token.
NB: for some browsers you must enable pop-ups on dev.azure.com as it attempts to login to your azure account to get a list of resource groups.
(Figured this out from this forum comment.)
From reading others' comments/posts on this thread, the Azure UI might have changed so I'm posting the steps here for the later comers. I did what ecraig12345 suggested and it worked great!
Go to the deployment pipeline where the error occurs and click on Edit
Go to "Run on agent" task > Deploy Azure App Service
Click on the Manage hyperlink next to Azure Subscription label (see screenshot below)
Click on Edit
Click Save
Steps 1 - 3
Step 4
Step 5
If you look at the error message: "Verify if the Service Principal used is valid and not expired"
While I would have preferred more information, purely based on the above the likely scenario is the Key Used for the Service Connection has expired.
Visit you Azure DevOps org. and open the related Project and click on "Project
Settings" at the bottom left of the screen.
Click edit on the service connection in Azure DevOps and Click on the
link >> "To update using an existing service principal, use the full
version of the service connection dialog."
Copy the "Service principal client ID"
Now in the Azure Portal, Clic on Azure Active Directory and then Click on "App Registrations" to search for your application with the "client ID"
Go to "Certificate and Secrets" and check if your client certificate has expired.
If the cert is expired generate a new one and copy the key.
Go back to Azure DevOps "Service Connections", Click edit on the service connection in Azure DevOps and Click on the link >> "To update using an existing service principal, use the full version of the service connection dialog."
Update Service Principal Key with the copied value, Verify connection and click ok.
This should solve your issue
Although the route to the problem wasn't exactly the same (because devops changed so much again, probably), the answer from Venura was the root cause of my issue, and I was able to solve it thanks to this info.
steps I had to take:
In devops: go to releases
click correct project
edit
click on the stage that was failing
open the run agent task to deploy (should be an azure app service deploy)
click manage azure subscription
click manage service principal
in azure portal click on the expired registration
click on the red error that is has expired
click + new client secret
copy that new key
go back to devops
click edit on the screen of service connections (where we left at step 7) - (the subscript of the title here is Azure Resource Manager using service principal (manual))
paste that copied key in the field 'Service principal key'
click 'Verify and save'
That solved the issue, to confirm it was solved I just triggered a new release, which finally got through.
I followed JamesD's answer but when I got to step 13, there was nowhere for me to put the Service Principle Key that was generated. So I went back to square one and approached it a different way. Instead of trying to reuse the existing service connection that had exired, I created a new service connection and then changed my release pipelines to use that new service connection and things worked fine.
Here were my steps:
click on Project Settings in the lower left corner
On the left nav under the "Pipelines" section, click on "Service connections"
in the upper right corner, click on the button "New service connection"
select "Azure Resource Manager" and then "Next"
select "Service principle (automatic)" (this is the recommended option)
select the subscription from the drop down.
select the resource group from the drop down
give it a good name and hit save
then authenticate with your azure portal creds
Now you have a service connection created, lets go change the pipeline to use it
Go to your pipeline for the release and edit it
click on the Stage you want to edit (aim for the # tasks link)
click on Deploy Azure App Service
under the azure subscription drop down, select your new subscription entry you created above
then you will select the App Service name in that drop down
hit save and you are good to go
Now repeat for any other stages of the pipeline or any other failing release pipelines

Issue with Open Console button from Db2 on Cloud

When I click on the Open Console button from by Db2 resource on the IBM Cloud, I am getting the following error:
Error 401: SRVE0295E: Error reported: 401
I am logged into my Cloud account, so I'm not sure why there is an authorization error.
The Open Console button uses SSO for authentication. I can't diagnose why you're getting a 401 in this case, but you can instead try logging in using the given username and password. You can find this by navigating to the Service Credentials tab on the left side of the service instance page, clicking New Credential, clicking Add in the dialog box, and clicking View credentials to expand the JSON contents. You can find your username and password there and use them to log in.
I had the same problem. The only way how I have resolved this is just by deleting this Db2 service and creating the new one.
Be sure that the location chosen while creating the new Db2 service is DALLAS.

IBM Watson Assistant: How to get IAM key for v1 watson assistant services

I have an IBM Watson Assistant service with username and password format and now I want to create new credentials which should have IAM key for this service, Please let us know how we can achieve this.
You can also migrate your Cloud Foundry service instance that uses un:pw to one that supports IAM. See Migrating Watson services from Cloud Foundry
There are (at least) two options to obtain IAM credentials for you IBM Watson Assistant service:
In the browser, go to the service dashboard by going to the IBM Cloud resources portal, locate your service instance, click on it and then in its dashboard on Service credentials. There you can create new credentials.
In a terminal and using the IBM Cloud CLI you can use ibmcloud resource service-key-create to generate credentials.
Both options assume that you have migrated your service instance from Cloud Foundry to IAM.
For creating a new credential, you can directly go to your watson assistant service/resource page, once there, on the left hand side, you would find "Service Credentials" menu button, there you would find an option to create a "New credential", and once the credential is created, then the "apikey" of that "New credential", would actually be your "IAM key", which can be viewed by clicking on the "View Credential" button highlighted below in the image.
*This is for IBM Watson Assistant V1 only.

How to sign up for the Elephant SQL service on Bluemix

I have a BlueMix application using NodeRed and I want to sign up for the ElephantSQL service so I can store some tabular data, but when I browse to the service in the catalog I don't see any option to sign up. The only thing that is close is an option "connect to" which allows me to select one of my applications. However, selecting my target application does not sign me up for the service and when I browse back to the service I see it has forgotten my selection.
I understand and that is definitely the cause of the issue. Please open ticket with Bluemix Support so we can look into your account and resolve this issue:
https://console.ng.bluemix.net/docs/support/index.html

No cloudant DB credentials for bluemix dedicated

I have created a cloudant DB in bluemix dedicated. But it didn't give me credentials. It provides me with a link to launch the admin portal, which works fine. But clearly not very useful without credentials to use with code...
You should bind the service to an application. Doing that you will be able to see the credentials in the VCAP_SERVICES environment variable. You can find its value within the application dashboard, clicking on "Environment Variables" on the left.
You will also find the credentials clicking on the "Service Credentials" button that you can find on the service instance panel (again in the application dashboard).
Your dedicated environment may look a bit different that the public Bluemix dashboard, but when I click on the tile that shows my cloudant service, it takes me to a page with a menu on the left with the option "Service Credentials" once I choose that the window shows a button to "Add Credentials".