Where to find my Ocp-Apim-Subscription-Key in Windows azure - api

I want to use an api, but i can't find the Ocp-Apim-Subscription-Key at the page below:
Thanks.

You can find it by going to API Management services, then APIs. Select your API, your endpoint and then select the Test tab on the right hand side. Go down to Headers and against Ocp-Apim-Subscription-Key you will see it hidden; select the eye to see it.

please, following the instructions below.
You have to go through the azure portal and select your API
management component then click on the Publisher Portal in the
left top corner.
Go through the APIs and then Products tab.
Click on the ADD API TO PRODUCTS button and then select an
appropriate option.
Go through the azure portal again, but click on the Developer
Portal in the left top corner.
Click on the ComboBox which is placed on the right side and
choose Profile.
You will be able to see the access keys for the products and pick
the key for the product which you have chosen in the previous steps
(Starter or Unlimited).

Method 1:
From https://portal.azure.com/ go to your API Management service -> Subscriptions
There will find default ones and some created by your own.
Method 2:
Via https://resources.azure.com/ using HTTP GET method
az rest --method get `
--uri 'https://management.azure.com/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP_NAME}/providers/Microsoft.ApiManagement/service/{API_MANAGER_NAME}/subscriptions?api-version=2018-01-01' `
--query "value[0].properties.primaryKey" | ConvertFrom-Json
Explanation:
Replace placeholders {SUBSCRIPTION_ID},{API_MANAGER_NAME},{RESOURCE_GROUP_NAME} by your own values
"value[0]. -> indicates the required key value: first,second in the list, because as you can see in the portal there are multiple for different scopes: Starter, Service access, Unlimited etc.
properties.primaryKey -> each value has 2 defined keys: primaryKey and secondaryKey
api-version=2018-01-01 -> check the right version, can be found from https://resources.azure.com/ or from ARM template for the API Manager resource

I found the subscription key here:
In the Azure portal, navigate to the "API Management service".
Go to "Subscriptions" under the "APIs"-heading.
Press "Add subscription".
Enter a "Name", select API as "Scope" then select your API under "API".
Press "Save". This will create a subscription for the selected API.
In the list of subscriptions, locate the subscription you just created, then press the "..."-button to the far right.
Press "Show/hide keys".
The subscription key is visible and can be copied from the "Primary key"-field.

Not sure where everyone is getting their answers from...
Maybe it's just old information, but at this time you can find them by doing the following:
Go to portal.azure.com
Select "Create a resource"
Create a resource. I'm using computer vision so I search for that and hit enter
Select "create"
Go to the newly created resource
On the left side panel under the "Resource Management" section select "Keys and Endpoint"
Key 1 and Key 2 are used as the "Ocp-Apim-Subscription-Key".
That's it. Those should work for you wherever it asks for the "Ocp-Apim-Subscription-Key".

This is how I found the keys
go to the resource
Click developer portal
Click the username on right-handhand side (for me it was "Administrator"). This will drop down a menu list
Click Profile
See a list of all keys. you can click the show link to view the keys and copy them

(August 2018) For our purposes (AI / ML) I found it under Cognitive Services > Resource Management > Keys - https://portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.CognitiveServices%2Faccounts
It will be under other services though I can't say which (as you have to be using one to see the attributes of it).

It's also called the Programmatic Key. As of January 2018, if you log on to luis.ai, you can find it under settings (when you click on your name in the upper right hand corner).
Not sure why the LUIS Api documentations say the key is in azure and why there's a naming difference :/

Related

Failed to establish connection to server

After spinning up our dedicated sql pool we receive the following message while creating a default table. "Failed to establish connection to server".
Does anyone know why this happens and how to fix it?
Edit. Connecting to sql studio I am able to create tables, however, synapse studio just can't seem to connect. It did end up working for about 5 sec via synapse studio but once I paused/resumed the pool it broke once again.
Edit2: Removed the image. Thanks for the feedback Rob, appreciate it. Table code below:
CREATE TABLE [dbo].[Table] ( col1 int NOT NULL ) WITH ( DISTRIBUTION = HASH (col1), CLUSTERED COLUMNSTORE INDEX ) GO
There are proper troubleshoot steps given by Microsoft for "Failed to establish connection to server" error. Please follow the same given steps mentioned below to resolve the issue.
Open the "Diagnostic Info" panel, select the "Download Diagnostic" button. Keep the downloaded information for error reporting. You can instead, copy the "Session ID" and attach it when opening the support ticket.
Press F12 in your browser to open "Developer Tools" (DevTools).
In the "Developer Tools" window, switch to the "Network" panel. Select the "Clear" button on the toolbar in "Network" panel if necessary. Make sure "Disable cache" in "Network" panel is checked.
Retry the operation you performed in Azure Synapse Studio. You may see new items shown in the "Network" list in "Developer Tools". Note your current system time to provide in the support ticket.
Find the item whose Url column matches the following pattern:
https://[*A*]-ondemand.database.windows.net:1443/databases/[*B*]/query?api-version=2018-08-01-preview&application=ArcadiaSqlOnDemandExplorer
Where [A] is your workspace name, and "-ondemand" could be "-sqlod" and where [B] should be a database name, such as "master". There should be at most two items with the same URL value but different method values; OPTIONS and POST. Check whether these two items have "200" or "20x" under the status column, where "x" could be any single digit.
If either one of them has something other than "20x" and:
Status starts with "(failed)", either widen the "Status" column or hover your pointer over the status text to see the complete text. Include the text and/or screenshot when opening the support ticket.
- If you see ERR_NAME_NOT_RESOLVED and you created your workspace within 10 minutes, wait for 10 minutes and retry to see whether the problem still exists.
- If you see ERR_INTERNET_DISCONNECTED or ERR_NETWORK_CHANGED, it may indicate your PC network connection is having issues. Check your network connection and retry the operation.
- If you see ERR_CONNECTION_RESET, ERR_SSL_PROTOCOL_ERROR or other error codes containing "SSL", it may indicate your local SSL configuration is having issues, or your network administrator has blocked access to the serverless SQL pool server. Open a support ticket and attach the error code in the description.
- If you see ERR_NETWORK_ACCESS_DENIED, you may need to check with the administrator on whether your local firewall policy has blocked access to either *.database.windows.net domain, or remote port 1443.
Optionally, try the same operation immediately on a different machine and/or network environment to rule out a network configuration issue on your PC.
Status is "40x", "50x", or other numbers, select on the item(s) to see the details. You should see the item details to the right. Find the "Response Header" section; then check whether an item named "access-control-allow-origin" exists. If so, check whether it has one of the following values:
* (single asterisk)
https://web.azuresynapse.net/ (or other value that the text in your browser address bar starts with)
If the response header contains one of the above values, it means we should have already collected the failure information. You can open a support ticket if needed, and optionally attach the screenshot of the item details.
If you can't see the header, or the header does not have one of the values listed above, attach a screenshot of the item details when you open the ticket.
If the steps above do not solve your issue, you may need to open a support ticket. When submitting your support ticket, include the "Session ID" or "Diagnostic Info" downloaded at the beginning of this guide.
When reporting the issue, you may optionally take a screenshot of your "Console" tab in the "Developer Tools" and attach it to the support ticket. Scroll the content and take more than one screenshot if necessary to capture the entire message.
If you're attaching screenshots, provide the time (or an estimated time range) of when you took the screenshots. It will help us when looking into the problem.
Certain browsers support showing timestamps in the "Console" tab. For Chromium Edge/Chrome, open the "Settings" dialog in "Developer Tools", and check "Show timestamps" in "Preferences" tab.
Original content by Microsoft: Synapse Studio troubleshooting

Can't Connect to Notion API

I'm Uğur,
https://developers.notion.com/reference/retrieve-a-database
https://api.notion.com/v1/databases/database_id
I used "https://www.notion.so/111111111111111111?v=222222222222222" as a database ID. (http://prntscr.com/22cn4dp)
I used "Authorization: Bearer $NOTION_API_KEY and Notion-Version: 2021-08-16" as a cURL.
I used it with Postman but I got an error.
Error Code:
{
"object": "error",
"status": 404,
"code": "object_not_found",
"message": "Could not find database with ID: 1111111111111111."
}
How do I solve it?
Notion's update has changed the location for Integration. Now you'll find it here:
Go to the database page in your workspace.
Click the ••• on the top right corner of the page.
At the bottom of the pop-up, click Add connections.
Search for and select your integration in the Search for connections... menu.
Your integration now has permission to edit the database.
I had the same issue for a few days now. The problem I had was quite simple and turns out that I just never had the workspace shared with my integration.I [checked this video][1] at around 3 mins and only then realised that you need to share your pages and databases with the integration
Your Notion-Version looks correct but your database id should be the content after your Notion page url i.e. https://www.notion.so/DatabaseiD. Also if you're using Postman your Authorization should be set to type 'Bearer Token' with the Notion API Key that you obtained from your integration found here.
I had some trouble getting notion to work with Zotero using the Notero plugin. I created the integration and created the database but I did not explicitly share the database with the integration. After sharing the database with the integration, Notero works perfectly.
To share the database with the integration after creating the database and integration
Go to the Notion page containing the database
Click the share button in the upper right corner of the Notion window
In the text box type in the name of your integration (In the picture below my integration was called "papers")
Select your Integration (the window should now resemble the picture below)
Alter a citation in Zotero to confirm that your integration works.
Did Notion redesign/update that Share popup shown in the screenshot by alluppercase? I created an internal integration, but I am only seeing "add emails or people". (And when I try to connect in my react app - I get the error - APIResponseError: Could not find database with ID)

How can I refresh datasets/resources in the new Google BigQuery Web UI?

I'm creating tables via the Big Query command-line utility, but occasionally ad-hoc querying with the new web UI. After creating a table via the CLI, how do I refresh the datasets/resources section in the new Google BigQuery Web UI so that I can see the newly-created table? The old UI had a "refresh" drop-down menu item next to the dataset name.
I do not want to reload the entire webpage because it removes the text I have in the query editor and requires me to search for the tables again. I would ideally like to just refresh the list of datasets in the "Resources" section.
The BigQuery team is already considering the possibility to add the "Refresh" button that was available in the Classic UI, to the New UI, in order to be able to reload the datasets and tables on a project without the need of reloading the entire page, as is needed now in order to see all the changes in the BigQuery project.
There are already several public Feature Requests available in the Public Issue Tracker, but let me share with you the one which is receiving more attention from other users. Feel free to "star" this issue in order to highlight its importance and leave a comment if you feel like there is anything relevant you want to add to the discussion.
Rest assured that this topic is already being discussed internally and the BigQuery team will update the public Feature Request whenever there is any relevant information to be shared with the users.
I have found a workaround for anyone still waiting.
If you click the search box in the project/dataset "Explorer" sidebar, then press enter, it will refresh the list.
This one... https://i.stack.imgur.com/Uce18.png
This is now possible. From the release notes:
Cloud console updates: In the Explorer pane, you can now refresh the contents of a resource (project or dataset). To refresh the contents of a resource, click more_vert View actions, and then click Refresh contents.

How can I obtain an API-key for my Fusion Tables

Yep, newbie question here, but it's bothering me for some days now, trying to read all the docs on google developer site, but I'm spinning in circles.
I've created a Fusion Table and set the access to 'public' and got an ID.
According to Goolge I should have an API key to access the data from a REST-call. Google suggests:
Go to the Google Developers Console.
Select a project, or create a new one.
In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Fusion Tables API.
In the sidebar on the left, select Credentials.
I can do that all I've got an API-key, but how does this relates to the Fusion Table I've created? Can I use that API key for
this is really simple API key give the ability to do the most of mysql request type SELECT,INSERT,UPDATE,DELETE using GET and POST also PUT request , for GET you can use the navigator for that but the most effective way for your case is the use of curl librairie for php or jaira for java ... so you can send post or put request with a simple script.
So, what you can do with fusion table is automating the process of manipulating data and the option to share those data with someone else.
Edit: procedures changed since this post. Your mileage may vary
Head to the Google Developers Console
Create a project
Under Explore other services click "Enable APIs and get credentials like keys"
Search for Fusion Tables
Enable Fusion Tables API as a service under APIs & Auth --> APIs
You probably want the browser key. Grab the API key.
Happy Mapping...
API-keys are not related to specific Fusion Tables, they are related to projects.
You may use the key to request data from any public and downloadable FusionTable(not only your own Tables ), the key basically is used to identify your project(google-account) .
So when you have problems with requesting data from a public table, check if the table is downloadable too(click on the table-name on top-left->reuse access->allow downloads ).

How can i generate an API key for Baidu China for an website store locator?

I have been asked by our developers to give them an API key for Baidu maps so they can set up our on site store locator and I'm not really sure how to go about doing this.
I tried to set up an account on Baidu but it asked for a chinese mobile number. Do I have to get one of these before I can get the key? And how easy is it to work out how to obtain the key once i've got an account?
Can anyone advise on the best way to set this up?
Thanks in advance!
Update 2016: It now appears to be possible to use non-Chinese phone numbers to create Baidu accounts, see this page.
Once you're logged into Baidu you need to find their LBS (location-based services) cloud and go to the control center there:
http://lbsyun.baidu.com/apiconsole/key
There you click "Create a new app/key" 创建应用(0/20) (orange button). In the popup you give it a name and then in your case probably select "for server". The following list of checkboxes is for the things you want to BLOCK for your key. If you want access to everything then tick NOTHING (took me a while to figure that out, I always ticked everything...)
For server keys you can select an IP based whitelist for users, you would enter the addresses of your servers there. I'm not sure about the other (sn) option.
When you click Confirm the new key should appear in the table, copy & use it.
Here's an easier answer than peedee's:
If you can't read Chinese, install the Google Translate extension in Chrome (translate.google.com can't translate HTTPS pages). On each new page, you'll have to click the extension in the toolbar and choose "TRANSLATE THIS PAGE".
Create an account at http://passport.baidu.com. You'll need a valid email address and a password.
Set up a developer account at http://developer.baidu.com/user/reg. You'll need to verify a mobile phone number by typing in a code sent via SMS. A Google Voice worked for that. The format for US numbers is "(1)760-123-4567". You only have 60 seconds to enter the 6-digit code.
Go to http://lbsyun.baidu.com/apiconsole/key.
Click the "I agree" button.
Choose "Browser" as the application type.
Enter * in the Refer whitelist (unless you want to only allow certain domains to use the API)
That's it. You'll get an "Access application (AK)" key.