0

When deploying IBM Cloud Functions using a manifest file from the CLI, the API isn't created in the targeted namespace if it's in an IAM-enabled Resource Group, but it works if targeting a Cloud Foundry-based namespace. How can I deploy an API using a manifest file to a namespace inside an IAM-enabled Resource Group?

$ ibmcloud resource group-create TodoBackendRG
$ ibmcloud fn namespace create TodoBackendNamespace
ok: created namespace TodoBackendNamespace
$ ibmcloud target -g TodoBackendRG
Targeted resource group TodoBackendRG

API endpoint:      https://cloud.ibm.com
Region:            us-south
User:              matthew@example.com
Account:           Matthews Account (blah) <-> blah
Resource group:    TodoBackendRG
CF API endpoint:   https://api.ng.bluemix.net (API version: 2.141.0)
Org:               TodoBackendOrg
Space:             dev
$ ibmcloud fn property set --namespace TodoBackendNamespace
ok: whisk namespace set to TodoBackendNamespace
$ ibmcloud fn deploy -m manifest.yml
Success: Deployment completed successfully.
$ ibmcloud fn api list
ok: APIs
Action                            Verb             API Name  URL

The above deployment doesn't fail, but instead of deploying to the namespace TodoBackendNamespace in the IAM-enabled Resource Group TodoBackendRG, it deploys to the Cloud Foundry-based namespace TodoBackendOrg_dev.

If I try to call out the namespace the deployment fails.

$ ibmcloud fn deploy -n TodoBackendNamespace -m manifest.yml
Error: Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.
servicedeployer.go [1656]: [ERROR_WHISK_CLIENT_ERROR]: Error code: 147: The supplied authentication is not authorized to access 'TodoBackendNamespace/TodoBackendFN'. (code 33f32f829a3d1b88e8bccd440f13ee91): HTTP Response Status: 403 Forbidden HTTP Response Body: {"code":"33f32f829a3d1b88e8bccd440f13ee91","error":"The supplied authentication is not authorized to access 'TodoBackendNamespace/TodoBackendFN'."}
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163

1 Answers1

1

First, make sure you are updated to the lastest version of cli. Currently, it is 1.0.36. Using ibmcloud plugin install cloud-functions will update your functions CLI to the latest.

Second, before issuing ibmcloud fn deploy, please issue ibmcloud fn property get command to get your properties. What is your whisk namespace value? Is it a random string or TodoBackendOrg_dev? If it is TodoBackendOrg_dev, that means you are still target your CF namespace.

StevenD
  • 21
  • 3
  • All in all, you will need to to have the latest version of cli and target the IAM namespace before deployment. – StevenD Jan 29 '20 at 15:27