19

I am desperately trying to move 2 classic storage accounts from my old MSDN subscription to my MPN subscription and I keep hitting a brick wall as move is only supported for these through REST APIs.

I have enabled the APIs following the instructions here....

https://azure.microsoft.com/en-us/documentation/articles/resource-group-move-resources/

and here...

https://msdn.microsoft.com/en-us/library/azure/dn776326.aspx

but am completely flummoxed. I have created a POST request as suggested to check status as the first call in the 'move resources' instructions...

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ClassicCompute/validateSubscriptionMoveAvailability

(with the subscriptionId replaced with the ID for each) and passing the appropriate source / target body in.

I have also provided the Authorization header as follows...

Authorization: {key as generated by the Azure portal}

Completely lost now. I have tried using both Fiddler & Postman. PowerShell isn't an option for me because I don't know it at all. I just want to move 2 items over and so far just having these management APIs running has cost me over £15 and my website is on the verge of going down as my credit will soon expire.

Any help would be most appreciated.

Keith Jackson
  • 3,078
  • 4
  • 38
  • 66

2 Answers2

7

Per your description, it seems that there is any thing wrong of the way you generate:

Authorization: {key as generated by the Azure portal}

According the document description at https://msdn.microsoft.com/en-us/library/azure/dn790569.aspx#bk_common, the authorization header should be a JSON Web Token that you obtain from Azure Active Directory, but directly from Azure Portal.

You can refer to https://azure.microsoft.com/en-us/documentation/articles/active-directory-protocols-oauth-code/ for how to obtain a JWT from AAD.

And the Authorization header should be in like: Authorization : Bearer {JWT}.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32
  • I can't make head nor tail of any of this I'm afraid. It would make sense to me if I was trying to write my own API but I'm not, I'm trying to use the management API. According to the instructions I read the Authorization header should be as provided by the key generator in the old Azure portal. – Keith Jackson Oct 03 '16 at 21:27
  • Reading more into this, the code I get from the portal is supposed (I think) to be the encoded JWT. – Keith Jackson Oct 03 '16 at 21:38
  • 1
    Thanks Gary - In the end I just gave up on this due to it being insanely over complicated and created a new storage account in the new subscription and copied everything over as I wasn't dealing with a large amount of data. – Keith Jackson Oct 04 '16 at 08:16
  • Hi, how did you added authorization in api url?, Authorization: {key as generated by the Azure portal} – Priyanka Mane Apr 05 '17 at 12:57
  • @PriyankaMane, set `Authorization` in the request headers which against to your api url. – Gary Liu Apr 06 '17 at 02:05
  • @KeithJackson, Please generate the token by clicking on "Try it" in the same page where Gary provided his links – Assil Mar 25 '22 at 23:33
0

My Error got resolved when i added the required params ,you'll find the keys on azure portal enter image description here

gouravm
  • 301
  • 1
  • 12