Тёмный
No video :(

Azure REST APIs with Postman (2021) 

Jon Gallant
Подписаться 2,1 тыс.
Просмотров 83 тыс.
50% 1

Опубликовано:

 

23 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 97   
@DarkGT
@DarkGT 3 года назад
Microsoft feature this video in their docs, not disappointed.
@93Allene
@93Allene 3 года назад
Didn't know about the SDK's! That is going to make everything much easier!!
@arestlessmind780
@arestlessmind780 2 года назад
Hey Jon, great tutorial. Sadly it seems that changes have caused this to break in 2022. My attempts to execute the GET response receive the following error: The client 'xxxxxxxxxxxx with object id 'xxxxxxxxxxxx' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/xxxxxxxx' or the scope is invalid. If access was recently granted, please refresh your credentials." The bearer token as well as the "bearerTokenExpiresOn" fields are all populated but It still isnt working. Would appreciate some guidance!
@robertkirwan29
@robertkirwan29 2 года назад
Same error here
@arestlessmind780
@arestlessmind780 2 года назад
@@robertkirwan29 one thing you can do Robert is add the application as a contributor to whichever scope you want to have access to (either a certain resource group or a subscription). This resolved the issue for me
@harshavardhan637
@harshavardhan637 Год назад
@@arestlessmind780 I am having the same issue - How to do that ? Please advice
@arestlessmind780
@arestlessmind780 Год назад
@@harshavardhan637 Hi Harsha, you only need to change the permission of your application in your active directory. Give the application registration the "contributor" role to your subscription and this will work
@harshavardhan637
@harshavardhan637 Год назад
@@arestlessmind780 Under my subscription-> my permissions I have contributor - is it where I should be looking at ? Is there is a way we could connect ?
@owenashcroft8167
@owenashcroft8167 3 года назад
Thanks so much, just saved me a chunk of time as I'd started recreating this.
@JonGallant
@JonGallant 3 года назад
Glad I could help!
@Xania-js
@Xania-js Год назад
"AuthorizationFailed" is sticking, cant get rid of it, I tried every suggestion in the comments below. Authorization / access settings is not mentioned in the video, does it mean it should just work?
@JohnSmith-jg8cw
@JohnSmith-jg8cw 2 года назад
Thank you Jon, it was very helpful! It was very precise and well explained.
@BrendanMetcalfe
@BrendanMetcalfe 3 года назад
Nice content man! You're almost at 1000 subs haha
@JonGallant
@JonGallant 3 года назад
Thank you! We are there!
@BrendanMetcalfe
@BrendanMetcalfe 3 года назад
@@JonGallant Congrats! Hitting 1000 gave me the motivation to keep going.. at least I was getting paid a bit 😂
@phongphanthanh6878
@phongphanthanh6878 2 года назад
I follow instructions in video but got this error: The client '...' with object id '...' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/...' or the scope is invalid. If access was recently granted, please refresh your credentials. What should i do?
@harshavardhan637
@harshavardhan637 Год назад
same here
@SaaSFamily
@SaaSFamily Год назад
I got the same error, is there a way around it ?
@Corelianer
@Corelianer 2 года назад
Great video, sadly Microsoft dropped the Ruby support. Would be great to at least offer a limited Ruby on Rails support for Azure AD and Graph. Improvement: Put the secrets into Environment variables that can be kept secret. Collection Variables are not hidden.
@sachinraverkar4257
@sachinraverkar4257 Год назад
We need to add IAM Role Assignment (e.g. Contributor role) to the app (service principle ) and then the APIs work... otherwise it gives unauthorized error.
@thomaswilson2382
@thomaswilson2382 Месяц назад
Do you have an example using certificates? Thank you so much.
@MikhailD-sr1hy
@MikhailD-sr1hy 3 года назад
Hello Jon, awesome video! However, I still have one question regarding authentication: The generated bearer tokens are valid for an hour. In a production environment, when I am calling the APIs, should I generate a token before each API call, or should I run a script to save the token centrally every hour? Is there maybe another way to authenticate the API with a "permanent" API key or token in order to avoid the overhead of creating a new token each time?
@JonGallant
@JonGallant 3 года назад
I just published an updated pre-request script that should only request a new token if we don't already have a token or if the token has expired. Please have a look, try it out, and let me know if you run into any issues. Thanks! Jon blog.jongallant.com/2021/02/azure-rest-apis-postman-2021/#Pre-request-Script
@ahjee718
@ahjee718 3 года назад
Thank you for this video and the link to your tutorial! Because of you, I was able to figure out how to automate with the Azure API in Python. I might post a tutorial myself on how to do it on Medium.
@geosystems2106
@geosystems2106 Год назад
SubscriptionId topic is quite complicated; Azure does all sorts of crap that you need a subscription, and you cannot have access to shell because your subscription is not linked to your target Directory, you want to assign a subscription and its is not allowed. After some re-shuffle I could see the option and it insists on generating disk space. I was like WHAT THE HELL !! 💀
@theduskyreaper
@theduskyreaper 3 года назад
I'm getting: { "error": { "code": "InvalidSubscriptionId", "message": "The provided subscription identifier 'resourcegroups' is malformed or invalid." } } I have checked both in cli and the portal. It is the correct subscriptionId I have entered in Postman. The other variables is correct aswell.
@theduskyreaper
@theduskyreaper 3 года назад
@@vincentalm7161 Yes, that did the trick. Thank you very much!
@JonGallant
@JonGallant 3 года назад
I think initial value is not required. But I’ll keep note of that for next years video.
@GregorSuttie
@GregorSuttie 2 года назад
@@theduskyreaper how did u get this fixed as I am getting this error now.
@Francisco-Gutierrez
@Francisco-Gutierrez 2 года назад
@@GregorSuttie In postman variables there are two values, one for current value and other for inital value. Set it to the current value will fix the error
@scycer
@scycer 3 года назад
Nice video, just wondering why you chose to use a pre-script for the auth rather than the native postman oauth2 functionality?
@JonGallant
@JonGallant 3 года назад
I've played with the built in oauth support over the years and never found a solution. I believe it is because of this issue: github.com/postmanlabs/postman-app-support/issues/4391 Please let me know if you find a way to get it to work
@JonGallant
@JonGallant 3 года назад
Another reason is that Postman doesn't automatically handle the token refresh if it expires.
@luistrejo1609
@luistrejo1609 2 года назад
The bearer token doesn't work for azure service bus.
@ruthvikravikumar
@ruthvikravikumar 3 года назад
{ "error": { "code": "AuthenticationFailed", "message": "Authentication failed. The 'Authorization' header is missing." } } getting this error. :( . i had made a typo in setting environment variable, "clientId". i changed it, however i still get the same error. could you please help after sending the request, along with above error in the "Body" tab, I get the following error in the "Test Results" tab. Check for collectionVariables | AssertionError: clientId variable not set: expected '' not to be empty I have fixed the typo, even then i get this error
@JonGallant
@JonGallant 3 года назад
Did you click the "Save button"?
@vedantbobade2487
@vedantbobade2487 3 года назад
I'm getting an error 'AccountTypeMissing' when I am trying to create a storage account using PUT request. Please help
@johnhackman2825
@johnhackman2825 2 года назад
Followed everything , it says invalid authentication token
@ulrichbeutenmuller8101
@ulrichbeutenmuller8101 2 года назад
same here
@spicmacay5653
@spicmacay5653 2 года назад
I am using rest api to access logic app runs but getting error that resource not found but resource is already there have checked everything but not sure why its happening could you please help
@SaaSFamily
@SaaSFamily Год назад
I got authorization failed error, any suggestions to fix it ?
@Xania-js
@Xania-js Год назад
same here => "...does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read'"
@j.r.3664
@j.r.3664 3 года назад
Thank you very much for the video. Are you planning on doing one abput how to get data files stored in Azure VMs using REST APIs?
@JonGallant
@JonGallant 2 года назад
I'm not planning on creating one. Can you try it and LMK if you get stuck and send code that you tried? jong.io/contact
@vinospubgdairies235
@vinospubgdairies235 Год назад
Is there any way to pull vulnerability from Azure using rest API
@danielduval3040
@danielduval3040 2 года назад
for those of you getting errors, you need to first give your service principal contributor permissions on the subscription you are trying to work with. Next, In postman variables there are two values, one for current value and other for initial value. Set it to the current value will fix the error. I had put the variables in the "initial value" column and it wasn't working because of that. Just wanted to share in case this helps someone else.
@harshavardhan637
@harshavardhan637 Год назад
Under subscription -> my permission I have contributor . I am still getting errors ! Can you please help ?
@ulgrimthemad
@ulgrimthemad Год назад
Worked for me. Had to find the app Display name in App Registration to add as contributor under the sub. Make sure you put it under the correct sub!
@crowwhite92
@crowwhite92 Год назад
@@ulgrimthemad That did the trick!
@patricioamarelle8585
@patricioamarelle8585 3 года назад
how to request my api diployed at azure with postman client?
@KenCoppola
@KenCoppola 3 года назад
Is there a part 2? I'm looking for how to delete an azure blob in postman.
@JonGallant
@JonGallant 3 года назад
You can use the REST API docs to create the requests you need: For delete blog: docs.microsoft.com/en-us/rest/api/storageservices/delete-blob I'm working on getting a Postman collection that has more of the REST API commands.
@alexkimathi6359
@alexkimathi6359 3 года назад
hello can you help me connect my azure model to an android app interface i use kotlin but you can do a step by step tutorial even in java am having errors following the documentation
@rajum5453
@rajum5453 2 года назад
thnx..I want to get Azure logs for a function, is it possible? pls explain...
@nagarajsekar6919
@nagarajsekar6919 2 года назад
Hi Jon, Is it possible to get the Office 365 subscription details like, subscription name, assgined user, etc via Azure APIs?
@billatkin3956
@billatkin3956 5 месяцев назад
Thank you for the video! When I send the request (at 5:49), however, I get the following error returned: "error": { "code": "InvalidSubscriptionId", "message": "The provided subscription identifier 'resourcegroups' is malformed or invalid." } Any idea what's going on?
@DarrenJohnson42
@DarrenJohnson42 5 месяцев назад
I got the same error. Any updates on this?
@Rajath-fo7uy
@Rajath-fo7uy 2 месяца назад
@@DarrenJohnson42 - I hope you have saved the Variables values as current value not as Initial value and save it
@manasbehera-cd3fj
@manasbehera-cd3fj 2 года назад
Thank you for the video
@lucasduran4736
@lucasduran4736 Год назад
I need to code the postman collection in python, my question is if there is another way to get the bearertoken other than through the pre-script since I don't know how to pass it to my project and I can't depend on the collection in postman it must be something independent in my project, any ideas?
@JonGallant
@JonGallant Год назад
Can you use the Azure SDKs?
@marlonmorales8672
@marlonmorales8672 2 года назад
Hi, I received '"code": "AuthorizationFailed"', seems to be rights issues. Which should be check first? Thank you.
@srujanswathi5169
@srujanswathi5169 2 года назад
By default, when you create an SP, it does not have permissions to do anything. Make sure you assign the right RBAC role to your Service principal you created and try again. Hope this helps!
@thameemtk8953
@thameemtk8953 3 года назад
Can we send any JSON files to any particular azure blob storage using this method?!
@JonGallant
@JonGallant 3 года назад
Yes you can do that with Azure REST - but using the Blob storage lib is much easier. What language? They are all here: aka.ms/azsdk
@manasbehera-cd3fj
@manasbehera-cd3fj 2 года назад
Do you know how to access Azure single sign on using Azure SDK?
@JonGallant
@JonGallant 2 года назад
Feel free to ping me here to discuss more jong.io/contact
@biswajee
@biswajee 3 года назад
Blueprints are not supported yet for js :(
@JonGallant
@JonGallant 3 года назад
What do you need to do with blueprints? Feel free to ping jong.io/contact to discuss.
@ermukesh09
@ermukesh09 3 года назад
@@JonGallant I am also looking for the blueprint as I want to create blueprint on the Management group level so the owner will not able to delete blueprint.
@metin4yt
@metin4yt 3 года назад
Can it be done without a Service Principal? Only using my credentials?
@JonGallant
@JonGallant 3 года назад
Probably but I haven’t tried because you still need an app to authenticate your account to. Which is more setup.
@gegao7263
@gegao7263 3 года назад
@@JonGallant a sample with personalised token would be very helpful, because service principals authorised for multiple tenants has a higher risk than personalised token limited to only the user's tenants. and the token can be issued via a strong authN (e.g. MFA), while client_credentials not. Do you have any doc links to this setup if a sample is not yet planned?
@justair07
@justair07 3 года назад
Hi Jon, I'm getting this error when I hit Send on the GET request "There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'get' of undefined"
@JonGallant
@JonGallant 3 года назад
What version of Postman are you using? I'm using v8.0.6
@JonGallant
@JonGallant 3 года назад
I just retested and everything works on my machine. Feel free to ping me here: jong.io/contact so we can try to repro together.
@justair07
@justair07 3 года назад
@@JonGallant Thank you, I just send you a message.
@justair07
@justair07 3 года назад
@@JonGallant 7.1
@JonGallant
@JonGallant 3 года назад
@@justair07 Okay, please use this method instead if you need to use an old version of Postman that doesn't support collection variables. blog.jongallant.com/2017/11/azure-rest-apis-postman/
@codex4483
@codex4483 3 года назад
Can i perform only the primary authentication using Rest
@JonGallant
@JonGallant 3 года назад
Can you explain that more?
@codex4483
@codex4483 3 года назад
@@JonGallant i am trying to build an MFA application and i wanted to integrate it with azure authentication. Is there a way to pass the username and password without interacting with UI and then perform the MFA with azure on the UI?
@JonGallant
@JonGallant 3 года назад
@@codex4483 Do you want to call the rest endpoints on behalf of a user? Typically people wrap the Azure REST API in their own API. Then they do user auth against their API with Azure AD B2C. Either way you’d need to create an Azure AD app and control MFA with that.
@codex4483
@codex4483 3 года назад
@@JonGallant yes i want to do it on behalf of a user.. like i will be passing my username and password in the request and will the get the response accordingly..is that possible?
@JonGallant
@JonGallant 3 года назад
@@codex4483 Look into Azure B2C with MFA
@summersnow2288
@summersnow2288 2 года назад
InvalidSubscriptionId, although it is correct. I just copy pasted it.
@alexanderziemann1353
@alexanderziemann1353 Год назад
Make sure your initial and current values are both set with the value in the variable section of the collection.
@raghavendraviswanath6419
@raghavendraviswanath6419 2 года назад
Great video and awesome script. @jon gallant Thanks a ton for this informative video
Далее
API vs. SDK: What's the difference?
9:21
Просмотров 1,4 млн
OBLADAET - BARMAN
03:06
Просмотров 236 тыс.
Avaz Oxun - 10 yillik yubiley konsert dasturi 2023
2:52:33
Learn Postman in 15 Minutes
15:20
Просмотров 31 тыс.
Azure OpenAI BYOD: ChatGPT with Your Own Data!
9:07
Просмотров 48 тыс.
What is a REST API?
9:12
Просмотров 1,5 млн
How to use the Azure DevOps REST API with PowerShell
18:06