My goal is to fetch all the resources from the azure to our local database. I've been able to fetch various types of resources (virtual machines, websites, storage accounts etc.) using C# SDK (https://github.com/Azure/azure-sdk-for-net). However, it seems there's no wrapper for DocumentDb resource, what's more, I can't event find an endpoint to query it. Do you know how to fetch all DocumentDb resources ?
Try something like this powershell cmdlet
Find-AzureRmResource -ResourceType "Microsoft.DocumentDB/databaseAccounts"
Unfortunately, this doesn't seem to work exactly as expected, which is kind of weird. If I run this
Find-AzureRmResource -ResourceType "Microsoft.Storage/storageAccounts"
It outputs all the storage accounts. Go figure...
edit:
Yes it is working fine. I was looking in the wrong subscription for docDbs... idiot.
As for doing it with REST, #macpak I haven't done it myself, but I suspect you could do something like:
GET https://management.azure.com/subscriptions/yourSubId/resourceGroups/yourResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts?api-version=2016-03-31
This is how https://resources.azure.com works, check it out. Obviously you parameterise the subId and RGname and build the URI. You would also need to get a bearer token and put it in the authorisation header. Use postman and/or fiddler..
Related
Morning all,
I've not posted on SO for quite some time, but I need to ask the question, I’ve spent a day and a half trying to get this to work - it’s super frustrating considering I managed to implement v2 with posting a tweet in 2 - 3 hours but because I need the media endpoint (does not exist in v2), I rebuilt my flow into v1 to upload media.
Ok, so my app allows the user to authenticate with twitter and tweet/upload media. I’m using (I think) the 3-legged oauth flow.
Currently, the flow is :
https://api.twitter.com/oauth/request_token - 200 status code and I
confirm the callback URL
I use the access token from step 1, and then call/redirect
https://api.twitter.com/oauth/authorize?oauth_token={accessToken}
this obviously redirects to my endpoint.
I extract the oauthToken and oauthVerifier and call:
https://api.twitter.com/oauth/access_token, this returns an
oauthToken and oauthTokenSecret, I store the values.
All of the above conforms to what is in the docs, but when I use the stored values from step 3 to post a tweet I get unauthorized.
The signing logic works because it’s what’s used in “Request access token” - with a couple of changes.
I'm learning more towards a flow issue due to trying various nuget packages(tweetinvi in particular) and I get exceptions in those too.
Any help is greatly appreciated.
Not really an answer per-se, but rather notable actions.
At this point in time, you cannot upload media with V2 of the API, whilst you can integrate quite quickly and send a tweet, it's almost pointless without media.
So, you'll need to build/integrate with V1.
The unknowns and curve balls:
The most important! V1 requires elevated access! Which you'll need to
apply for, not all get accepted! but V2 just integrate and tweet with
no elevated access - very strange.
Always ensure to read the resp correctly, and try few times in code, postman,
fiddler etc. Whilst the resp contains a collection of errors object,
you'll never get a collection of errors.
If you're not using any sort of package/library, pay close attention
to crafting the request signature - it's a pain.
I am trying to get MailboxSettings of the currently logged in user ("/me") using the .net graph client.
I have a working solution, using an extension method that uses "/me/mailboxSettings", but I have found out that extension methods are not easy to test, though possible, and would prefer a solution that works without one.
I have found out that using Me.Request().Select("MailboxSettings") should work as well but I get a service exception with "Access denied" using the same authentication, which has these permissions : "(...) MailboxSettings.Read User.Read User.ReadBasic.All"
Testing with the graph explorer shows that the request does generally work, though I am not sure if this is because it has more permissions as our app on azure - specfically MailboxSettings.ReadWrite, but I would not know why these should be required on a Get method.
I have found that MailboxSettings.Read did not work for me. I needed to consent to MailboxSettings.ReadWrite before I could actually read the settings. Could you try that and confirm if that works for you?
I want to implement a simple way for a user to upload a save file (a really simple json file with no personal information) to their cloud account.
The main problem is that dropbox, google drive etc... don't work with simple username and password, they need OAuth 2, and a browser for log in. But it's not easy to implement that in a Unity game, and it require that I set up a secret API key connected to my account (with limited put and get possible without pay).
I want to be able to use the final user account to upload 1 single json file to the user account, and be able to download it from another device (that's the only reason why I want to be able to log in... without log in I can use something like htput, jsonblob or myjson... but if I want the user to be able to get their save in another device I would need that they copy a really long and not easy keyurl generated by those services).
I saw that with MegaApiClient it should be possible. I imported it into Unity as a native Plugin and I was able to use it in my code.
Problem is that I cannot Login because I get an error:
TlsException: Invalid certificate received from server
the code I use it the one in the example:
var client = new MegaApiClient();
client.Login("username#domain.com", "passw0rd");
There is a way to make it work? If not do you have any idea how to solve my problem?
In the end I decided to go with Dropbox. It's easier than I expected, but you will need to use the code flow with copy/paste (you cannot use the redirect_uri, at least I don't know how to redirect to the app on all platforms).
I don't know how to solve the mega problem.
EDIT. With Unity 2018.2 now MegaApi works.
EDIT. You can use the redirect_uri too, just redirect to 127.0.0.1 on android and localhost on pc.
I'm using authbot (AuthBot) to login users on my bot, but, I'm using a large amount of data, and since than, it starts gives me an error that I'm overload (Stackoverflow)
So, I do as suggested, I create an Azure Table Storage, since than, my bot does not recognize the authentication. It seems Authbot cannot get \ set the data from table storage. Do you know something about it?
The current AuthBot uses the default state client. I've submitted a PR to fix this: https://github.com/MicrosoftDX/AuthBot/pull/37/files
In the interim, you can download the AuthBot source and include the changes to OAuthCallbackController in your project.
Edit:
This repo will eventually replace AuthBot: https://github.com/richdizz/BotAuth It is already using the correct state client interfaces.
I need to get the parameter values of Get-ThrottlingPolicy for Exchange 2013. I am looking at getting the values.
Is it possible to get this through EWS API?
I have tried extracting this through powershell from C#. I am not able to find the cmdlet Get-ThrottlingPolicy. What is the solution, what could be wrong. I am new to powershell.
Also can we retrieve the current status - ex current concurrency.
Sadly doesn't look like is possible. The github repo does not appear to contain any reference to throttling.
https://github.com/OfficeDev/ews-managed-api/search?q=throttling