3

I followed the example which was provided by Azure documentation. Azure documentation section. However i got 404 resource not found error all the time.

This is the URL i used - https://xxxx.management.azure-api.net/subscriptions/xxxxxx/resourceGroups/xxxxx/providers/Microsoft.ApiManagement/service/xxxxxx/users/xxxxxx?api-version=2016-07-07

Header as - Authorization: SharedAccessSignature ###########

Further subscription id, resource group and service name was taken from properties. Which was shown in below image.

enter image description here

I couldn't find an error in my code and please help me to solve this issue.

Updated response image

enter image description here

8
  • so what request are you sending exactly? Commented Feb 8, 2017 at 13:06
  • I tried Create Or Update request (learn.microsoft.com/en-us/rest/api/apimanagement/users). Did you try to create users in Azure Rest API management? Commented Feb 8, 2017 at 13:22
  • can you update your question with the request you are sending? obviously, remove all the sensitive information Commented Feb 8, 2017 at 13:26
  • Ok sure ill do that now Commented Feb 8, 2017 at 13:28
  • Have you tried this from Fiddler or Postman? Also, be sure to use the PUT (not POST) http operation Commented Feb 8, 2017 at 13:34

2 Answers 2

1

So this is what worked for me:

PUT https://{apim-name}.management.azure-api.net/users/{username}?api-version=2016-07-07

headers:  
Authorization = SharedAccessSignature KEY  
Content-Type = application/json

body:  
{
    "email": "[email protected]",
    "password": "Qwerty123$",
    "firstname": "name",
    "lastname": "notname"
}
Sign up to request clarification or add additional context in comments.

Comments

1

It seems you mixed up the old REST url with the new one:

Try https://management.azure.com/subscriptions/xxxx/yyyy

You used the old REST URL: https://learn.microsoft.com/nl-nl/rest/api/apimanagement/apimanagementrest/api-management-rest which expects /users

The documentation on this doesn't mention this very clearly! With the new URL you will receive 401 messages (unauthorized)

You will also need to authenticate on a different way, take a look at this example: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-disaster-recovery-backup-restore

EXAMPLE:

GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/{MY_RG_APIMANAGEMENT}/providers/Microsoft.ApiManagement/service/{MY_APIM_NAME}/users?api-version=2014-02-14

headers:
Authorization = Bearer {KEY}
Content-Type = application/json

6 Comments

I'm pretty sure you have to talk to https://{APIMname}.management.azure-api.net
I use this URL for starting the backup of APIM. Your URL works, but then you need to call: https://{APIMname}.management.azure-api.net/users
Did you try this?
doesn't work with https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ApiManagement/service/{apim-name}/users/test?api-version=2016-07-07
I'm finding this new REST API confusing. Seems like a lot of unrelated steps to go through to get an auth token. The old management API just required a click and a copy-paste from the portal to get the SAS key. Was there any announcement of the new API? I just stumbled on it in the docs this week.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.